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 
Return to the default flat view Create a new topic Submit Reply
Re: Rotating a Pixmap? [message #22879] Wed, 13 December 2000 10:31 Go to previous message
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/
[Message index]
 
Read Message
Read Message
Previous Topic: Rotating a Pixmap?
Next Topic: Smooth()

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

Current Time: Thu Oct 09 21:10:53 PDT 2025

Total time taken to generate the page: 1.03993 seconds