mpiontek$2007022
mpiontek

02/13/2007 :: 17:08

Registered

Hello,

It seems that no matter what I try do with SetColorizeEffect, I just get a black picture. My HSL values are valid. Do I need to perform some other operation to see the results?

Thanks
Mike
nwmark$2007042
nwmark

02/14/2007 :: 10:33

Registered

Ive just tried this with the following code using a jpeg picture and it worked fine.

oGdViewer.DisplayFromFile("<filepath>\mlp.jpg")
oGdPicture.LoadFromImage(oGdViewer.GetNativeImage)
oGdPicture.SetColorizeEffect(20, 55, 80)
oGdViewer.Redraw()

Hope this helps

Mark
Loïc$2006306
Loïc

02/14/2007 :: 10:37

Registered

The tree parameter are percentage of hue, saturation and lightness component.


=>
-Hue must be value between 0 and 100.
-Saturtation between 0 and 100.
-Lightness between 0 and 100.


Note if you are trying to run this effect on indexed palette image you have to convert it first as 24 bpp.

Best regards,

Loïc Carrère
mpiontek$2007022
mpiontek

02/14/2007 :: 16:07

Registered

Hi,

Very confusing. The .NET color dialog shows values ranging from 0 to 240 for each HSL component. But when I try and grab them from the dialog properties I get very different numbers. So, I tried to use gdpicture.ColorRGBtoHSL. The input parameters are the same as shown in the color dialog (26, 39, 215) which is very blue. But the returns are 3.9, .78, .47, which, if left that way result in a black picture. If I mulitply S and L by 100 I get a very orange screen. Any ideas?

Thanks
Mike
Loïc$2006306
Loïc

02/15/2007 :: 18:16

Registered

Mike,

The parameters of the SetColorizeEffect() are percentage of each HSL components. (NOT real HSL values)

the method ColorRGBtoHSL returns hue value between (0 and 5), saturation value between (0 and 1) and a lightness value between (0 and 1). It is not the same system used in .net color system which is not the same used in photoshop...

If you want to convert HSL values from the .NET color system to SetColorizeEffect parameters you can do like that:

H = (netH / 240) * 100
S = (netS / 240) * 100
L = (netL / 240) * 100

If you want to convert HSL values from theColorRGBtoHSL method color system to SetColorizeEffect parameters you can do like that:

H = (gdpictureH / 5) * 100
S = gdpictureS * 100
L = gdpictureL * 100


I hope i was helpfull.


Best regards,

Loïc Carrère
mpiontek$2007022
mpiontek

02/16/2007 :: 21:32

Registered

That took care of the problem. Thanks for the explanation and keep up the good work. And thanks again for the quick response.
back to forum