Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Copying an image to a new window

0 views
Skip to first unread message

Jester

unread,
Jan 28, 2007, 11:35:04 PM1/28/07
to
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

unread,
Jan 29, 2007, 11:43:59 AM1/29/07
to
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.

Jester

unread,
Jan 29, 2007, 8:18:20 PM1/29/07
to
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.

> > Jesse.- Hide quoted text -- Show quoted text -

voipme

unread,
Jan 30, 2007, 8:13:49 AM1/30/07
to

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.

> > > Jesse.- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -

Jester

unread,
Jan 31, 2007, 7:11:10 PM1/31/07
to
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.

0 new messages