SetBorderColor DynaPDF Channels??

Hi all!

I’m playing with coloring border colors on a DynaPDF table and I found this:
SetborderColor.

I found this useful.

But I found that ARE NOT RGB COLORS.
For example, I have this RGB color: 146,216,230

But when I put it, I got Black, but when I play with another combination of colors, ex. 100,50,100
I got colors, well not the color that I want, but I got a Purple color
call tablaPDF.SetBorderColor(AllRows, AllColumns, 102, 204, 255).

Am I Missing something to use RGB colors as BorderColor?

Thanks

Yes, with channels() as integer, the parenthesis means it’s an array of integers.
Without looking at any example projects, I would assume it’s in standard RGB order.

dim ariMyColor(2) as Integer = Array(146, 216, 230) call oTable.SetBorderColor(-1, -1, ariMyColor)

[quote=317001:@Tim Parnell]Yes, with channels() as integer, the parenthesis means it’s an array of integers.
Without looking at any example projects, I would assume it’s in standard RGB order.

dim ariMyColor(2) as Integer = Array(146, 216, 230) call oTable.SetBorderColor(-1, -1, ariMyColor)[/quote]

[quote=317001:@Tim Parnell]dim ariMyColor(2) as Integer = Array(146, 216, 230)
call oTable.SetBorderColor(-1, -1, ariMyColor)[/quote]
:frowning: :frowning: No, It doesn’t work for me:

Already black

Hm that was my best guess without playing around.
@Christian Schmitz ?

There are no worked examples in Christian’s online doc.

The SetBackColor example assumes a CMYK color space

// row 0 in 100% Cyan call tbl.SetBackColor(0, allColumns, array(255,0,0,0), pdf.kcsDeviceCMYK)

Try this:

call tbl.SetBorderColorColor(-1, -1, Array(146, 216, 230), pdf.kcsDeviceRGB)

[quote=317023:@Jeff Tullin]There are no worked examples in Christian’s online doc.

The SetBackColor example assumes a CMYK color space

// row 0 in 100% Cyan call tbl.SetBackColor(0, allColumns, array(255,0,0,0), pdf.kcsDeviceCMYK)

Try this:

call tbl.SetBorderColorColor(-1, -1, Array(146, 216, 230), pdf.kcsDeviceRGB) [/quote]

It sounds more logical, unfortunately for me It doesn’t work. As you say It lacks RGB Device.

cuz, If I do this:
call tablaPDF.SetBorderColor(AllRows, AllColumns, 100, 100, 100)

The Red color in RGB (100,100,100) shows me gray.

Even in the Example located at /Examples/DynaPDF/Table with Listbox auto width on DynaPDF Plugin.

It setup Red color and it shows gray :frowning: :frowning:

Because you’re not passing an array of integers to represent the color.

Dim Colors(3) as Integer
Colors(1) = 100
Colors(2) = 100
Colors(3) = 100
call tbl.SetBorderColor(-1, -1, Colors, pdf.kcsDeviceRGB)

Like this?, No results :frowning:

link text

Close, except arrays are 0 based.
As I posted above

dim ariMyColor(2) as Integer = Array(146, 216, 230)

Using your sample project, I got the correct color when I implemented the SetBorderColor using the array properly.

Sorry, missed the thread.

So for border color we have 5 variants:

SetBorderColor(Row as Integer, Column as Integer, paramarray channels as integer) as boolean SetBorderColor(Row as Integer, Column as Integer, channels() as integer, ExtColorSpace as Integer = 0, ColorSpaceHandle as integer = 0) as booleanSetBorderColorValue(Row as Integer, Column as Integer, TPDFColorSpace as Integer, ColorValue as UInt32) as boolean SetBorderColorFloat(Row as Integer, Column as Integer, channels() as double, ExtColorSpace as Integer = 0, ColorSpaceHandle as integer = 0) as boolean SetBorderColorFloat(Row as Integer, Column as Integer, paramarray channels as double) as boolean

so with channels as integer, you pass the integer values, but you need to define a color space of course.
The version where you pass ExtColorSpace than allows you to specify RGB as color space.
SetBorderColorFloat does the same, but with floating point numbers. There the range is usually 0 to 1.

call table.SetBorderColor(-1, -1, 0, 0, 255) call table.SetBorderWidth(-1, -1, 1.0, 1.0, 1.0, 1.0)

this makes it blue.

Probably I need to reinstall Xojo, none of these work for me

Maybe you call it on the wrong position in code?

Did you try the examples?
Or is that an old DynaPDF version with a bug?

call table.SetBorderColor(-1, -1, 0, 0, 255)

Works for me

BUT… surprisingly (because of the -1 , -1 parameters) , it only affects the line around the outside of the table.
There are other calls to set HorizontalColor and VerticalColor if you want to affect the gridlines.

also

call table.SetBorderColor(AllRows, AllColumns, 102, 204, 255)

as per the original post, gets me a pale blue (onscreen) , which is what I would expect.

Are you looking at the screen or a printer?

[quote]when I play with another combination of colors, ex. 100,50,100
I got colors, well not the color that I want, but I got a Purple color[/quote]

But 100 red, 50 green, 100 blue IS purple.
What color did you expect to get?

the lines inside are the grid lines which can be set differently.