Re: Rotating a Pixmap? [message #22879] |
Wed, 13 December 2000 10:31 |
efrans
Messages: 8 Registered: June 2000
|
Junior Member |
|
|
Ben Tupper <btupper@bigelow.org> replied:
>
>
> efrans@my-deja.com wrote:
>>
>> I have copied an image from a window into a pixmap. Now I'd like to
>> rotate the pixmap before I copy it into a different window. How is
this
>> done?
>>
>
> Hello,
>
> I think that you will need to take a snapshot of the pixmap (or the
> original window), storing it into an array, using TVRD(). Then you
can
> fiddle with the orientation of the image before redisplaying it else
> where.
Thanks Ben. Initially I was planning on using TVRD() instead of a
pixmap, but I got fed up because I couldn't get the *color* image to
display correctly after the rotation. After consulting the ever useful
David Fanning site, I found the section "What Can Be Done?" on the
"Strange TVRD Results":
http://www.dfanning.com/tips/strange_tvrd.html
My problem was that I followed the golden rule of setting DEVICE,
DECOMPOSED=0, but I forgot to set DEVICE, DECOMPOSED=1 before displaying
the rotated color image!
Here is an example:
PRO tvcolor
image = BYTARR(256,256)
image[*,*] = INDGEN(256,256)
WINDOW, 0, XSIZE=256, YSIZE=256
DEVICE, DECOMPOSED=0
LOADCT, 33
TV, image
image2 = TVRD(TRUE=1)
; rotate 90 degrees ccw
FOR i=0,2 DO image2[i,*,*] = ROTATE(REFORM(image2[i,*,*]),1)
WINDOW, 1, XSIZE=256, YSIZE=256
DEVICE, DECOMPOSED=1 ; <--- the key
TV, image2, TRUE=1
END
- Eric Frans
Sent via Deja.com
http://www.deja.com/
|
|
|
Re: Rotating a Pixmap? [message #22880 is a reply to message #22879] |
Wed, 13 December 2000 07:57  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
efrans@my-deja.com wrote:
>
> I have copied an image from a window into a pixmap. Now I'd like to
> rotate the pixmap before I copy it into a different window. How is this
> done?
>
Hello,
I think that you will need to take a snapshot of the pixmap (or the
original window), storing it into an array, using TVRD(). Then you can
fiddle with the orientation of the image before redisplaying it else
where.
Ben
--
Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd.
W. Boothbay Harbor, ME 04575
btupper@bigelow.org
|
|
|