comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Rotating a Pixmap?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Rotating a Pixmap? [message #22879] Wed, 13 December 2000 10:31
efrans is currently offline  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 Go to previous message
btt is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Rotating a Pixmap?
Next Topic: Smooth()

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:06:06 PDT 2025

Total time taken to generate the page: 0.00551 seconds