Discussion:
Copying an image to a new window
(too old to reply)
Jester
2007-01-29 04:35:04 UTC
Permalink
Hey group!

I have a problem - I want to take a section of an image from one pic
win to another but when I use the -r switch and the
$rgb($getdot(@window, x, y)) it's drawing out the section in a red-
scale. Why? Any way to fix this?

Thanks,
Jesse.
voipme
2007-01-29 16:43:59 UTC
Permalink
It seems to me that $getdot will only return the color code of the
pixel at the coordinates x, y, and the $rgb will turn it into a
color. You'll need something that actually grabs a section of the
image (it'll have width and height in it). I can't remember the name
of a command that will do that, but I assume one exists. Check your
helpfile around the $getdot entry.
Post by Jester
Hey group!
I have a problem - I want to take a section of an image from one pic
win to another but when I use the -r switch and the
scale. Why? Any way to fix this?
Thanks,
Jesse.
Jester
2007-01-30 01:18:20 UTC
Permalink
Yeah, I did that - looked at each identifier and command to try and
use, the best (if not, only) way is basically made a nested loop to
scroll through x height and y width, grab the coordinate at both loop
points and using:

/drawdot -r $rgb($getdot(@window, %widthloop, %heightloop))

$getdot returns one number, multiples of 1 = 0 - 255 of red, multiples
of 256 in the number = 256 for each increment of green and multiples
of 65536 = 1 increment of blue. $rgb takes that one number and turns
it in to it's rgb value (eg: 0,0,0 - 255,255,255).

SO, with that written in the help (well, not entirely, tried it and
worked it out), it just does not make sense the above command I'm
using should not work and draw out the section in a red-scale. I
would rather find a way to fix it this way than to cut out a specific
area as well. . . . .

Please help! :o(

Jesse.
Post by voipme
It seems to me that $getdot will only return the color code of the
pixel at the coordinates x, y, and the $rgb will turn it into a
color. You'll need something that actually grabs a section of the
image (it'll have width and height in it). I can't remember the name
of a command that will do that, but I assume one exists. Check your
helpfile around the $getdot entry.
Post by Jester
Hey group!
I have a problem - I want to take a section of an image from one pic
win to another but when I use the -r switch and the
scale. Why? Any way to fix this?
Thanks,
Jesse.- Hide quoted text -- Show quoted text -
voipme
2007-01-30 13:13:49 UTC
Permalink
Got it. I just needed to read the helpfile a little more. It seems
that $getdot returns an RGB value. Meaning, its not in the form of
255,255,255, etc, but in the form of some 6-8 digit number.
Basically, its all red scale because $rgb is receiving only one
number, which happens to be in the red slot of the color code.

$rgb(red, blue, green)
$rgb(348283,0,0) = maximum red, automatically converted to 255.

So, take out the $rgb along with their parentheses and you should be
good.
Post by Jester
Yeah, I did that - looked at each identifier and command to try and
use, the best (if not, only) way is basically made a nested loop to
scroll through x height and y width, grab the coordinate at both loop
$getdot returns one number, multiples of 1 = 0 - 255 of red, multiples
of 256 in the number = 256 for each increment of green and multiples
of 65536 = 1 increment of blue. $rgb takes that one number and turns
it in to it's rgb value (eg: 0,0,0 - 255,255,255).
SO, with that written in the help (well, not entirely, tried it and
worked it out), it just does not make sense the above command I'm
using should not work and draw out the section in a red-scale. I
would rather find a way to fix it this way than to cut out a specific
area as well. . . . .
Please help! :o(
Jesse.
Post by voipme
It seems to me that $getdot will only return the color code of the
pixel at the coordinates x, y, and the $rgb will turn it into a
color. You'll need something that actually grabs a section of the
image (it'll have width and height in it). I can't remember the name
of a command that will do that, but I assume one exists. Check your
helpfile around the $getdot entry.
Post by Jester
Hey group!
I have a problem - I want to take a section of an image from one pic
win to another but when I use the -r switch and the
scale. Why? Any way to fix this?
Thanks,
Jesse.- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
Jester
2007-02-01 00:11:10 UTC
Permalink
Yep, that fixed it!

It's funny though, the $rgb should not have taken the one number as
the only parameter for red. I tried testing it with $rgb(long number
here) and then getting the result of x,y,z and then using $rgb(x,y,z)
and having it correctly give the original number...... However, just
pleased it's working now.

Many thanks!
Jester.

Loading...