image.Tint(+55,+90)

Started by sinus, June 04, 2014, 02:02:45 PM

Previous topic - Next topic

sinus

Inside a script this has not any effect

image.Tint(+55,+90)            'hatte keinen effekt
or
image.Tint(10,10)


(in contrary for example to
image.AdjustRGB(0,0,10)   'rgb blauer

what makes the image more blue).

So I guess the
image.Tint from the IMIMage class does not work.

But of course a small thing
Best wishes from Switzerland! :-)
Markus

Ferdinand

It seems that the first parameter must be of the type OLE_COLOR.  I don't know a lot about this variable type (like nothing), but Google showed me this:

http://forums.codeguru.com/showthread.php?357628-OLE_COLOR-confusion

The second post shows you how to enter various kinds of colours.  This gives a magenta tint:

    image.Tint(&hFF00FF,10)

But I'm not sure whether it does what you want.  It seems to turn the image into a greyscale and then add a tint back in.

sinus

Quote from: Ferdinand on June 04, 2014, 02:33:15 PM
It seems that the first parameter must be of the type OLE_COLOR.  I don't know a lot about this variable type (like nothing), but Google showed me this:

http://forums.codeguru.com/showthread.php?357628-OLE_COLOR-confusion

The second post shows you how to enter various kinds of colours.  This gives a magenta tint:

    image.Tint(&hFF00FF,10)

But I'm not sure whether it does what you want.  It seems to turn the image into a greyscale and then add a tint back in.

Thanks, Ferdinand
Curious

Your expample does not have an effect also. I am sure, I do it correct. I have these lines (for example):

image.AdjustRGB(0,0,10)   
image.Rotate(30,False)
image.Tint(222,50)   
image.Tint(&hFF00FF,10)         

The first line works (makes the image a bit more blue)
The second also,rotates it for 30%
The 3. and 4. does not have any effect, they runs, but have no effect.

But it is not that important, do not wasty your time with me, though it is of course very nice and I appreciate it.


Best wishes from Switzerland! :-)
Markus

Ferdinand

I did try my line of code in your script and it worked.  Perhaps it depends on where in the script you insert it?  You have to insert it in a place where you are sure that it will be run, given the options you have chosen.  Because so much of your script is in German it is hard for me to know.  I had to find place that always worked.  I inserted it after "image.ConvertTo24BPP" but this may not always be the right place.

sinus

Quote from: Ferdinand on June 04, 2014, 03:55:48 PM
I did try my line of code in your script and it worked.  Perhaps it depends on where in the script you insert it?  You have to insert it in a place where you are sure that it will be run, given the options you have chosen.  Because so much of your script is in German it is hard for me to know.  I had to find place that always worked.  I inserted it after "image.ConvertTo24BPP" but this may not always be the right place.

Oh, thanks very much, Ferdinand,

Yes, so it seems to me in this case, that I must check this again.
I will report it here ;)
Best wishes from Switzerland! :-)
Markus

sinus

Quote from: Ferdinand on June 04, 2014, 03:55:48 PM
I did try my line of code in your script and it worked.  Perhaps it depends on where in the script you insert it?  You have to insert it in a place where you are sure that it will be run, given the options you have chosen.  Because so much of your script is in German it is hard for me to know.  I had to find place that always worked.  I inserted it after "image.ConvertTo24BPP" but this may not always be the right place.

Boah, your are completey right.
Found it must be in the correct place, because the rotate - command and also this one

image.AdjustRGB(0,0,10)

worked, but the tint-command not.

Thanks, Ferdinand, you hit the nail on the top!
Best wishes from Switzerland! :-)
Markus

Mario

You can use the standard function RGB to produce the first parameter for Tint:

img.Tint(RGB(255,0,0),50)

The RGB function takes the Red, Green and Blue value [0..255].
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on June 04, 2014, 06:38:18 PM
You can use the standard function RGB to produce the first parameter for Tint:

img.Tint(RGB(255,0,0),50)

The RGB function takes the Red, Green and Blue value [0..255].

That is surely also a good think, I like better RGB than OLE colours ;)

BTW: Super, mein Word-Contact - script läuft und erst noch besser als bei 3.6 ... bin also bald bereit für das echte IMatch 5 - opening  :D
Best wishes from Switzerland! :-)
Markus

Mario

Hört sich prima an.

IMatch official release wird auch nicht mehr lange auf sich warten lassen. Sind halt 1000 Sachen zu tun.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ferdinand

Quote from: Mario on June 04, 2014, 06:38:18 PM
You can use the standard function RGB to produce the first parameter for Tint:

img.Tint(RGB(255,0,0),50)

The RGB function takes the Red, Green and Blue value [0..255].

Thanks.  I was looking for something like this, since I thought I'd used it before, but couldn't find it quickly.