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

Home » Public Forums » archive » Color behavior when using TEXTURE_MAP
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Color behavior when using TEXTURE_MAP [message #42333] Tue, 01 February 2005 03:53
Jesus Dominguez is currently offline  Jesus Dominguez
Messages: 2
Registered: February 2005
Junior Member
Hello all,
I´m trying to use translucent polygons and i have read a lot about it
in the list already. Still, i cannot get the colors i desire for my
polygons. I have written here a small example where i read a tiff image
and try to draw an opaque rectangle setting an alpha channel of 255 for
the image. I try to draw a white rectangle but i get a grey one! If i
draw to a window, instead of a widget_draw i get black! I have tried to
change background colors but i don´t get it. Using IDL 6.1 this is
easy to do through the keywork ALPHA_CHANNEL, but i cannot imitate this
behavior using IDL 6.0, (no ALPHA_CHANNEL for IDLgrPolygon).
Can anybody tell me what i´m missing? Thanks in advance!

PRO testPolygon, image, wDraw

;Read the image
ok = QUERY_TIFF(image,s)
IF ~ok then MESSAGE,'Error reading tiff file'
sImage=READ_TIFF(image)

;Create an alpha channel (opaque)
alphaChannel=bytarr(1,s.dimensions(0),s.dimensions(1))+255
optImage=[sImage,alphaChannel]

;Create image object and add to the model
ImgObj=OBJ_NEW('IDLgrImage',optImage,dimensions=[s.dimension s(0),s.dimensions(1)])
oModel=OBJ_NEW('IDLgrModel')
oModel->Add,ImgObj

;Create rectangle
PolObj=OBJ_NEW('IDLgrPolygon',[0,100,100,0,0],[0,0,100,100,0 ],$
TEXTURE_MAP=ImgObj,$
TEXTURE_COORD=[[0,100,100,0,0]/s.dimensions(0),[0,0,100,100, 0]/s.dimensions(1)],
$
COLOR=[255,255,255])

;Add to the model
oModel->Add,PolObj

;Create view and add to the model
oView=OBJ_NEW('IDLgrView',VIEWPLANE_RECT=[0,0,s.dimensions(0 ),s.dimensions(1)])
oView->Add,oModel

;Draw in the widget_draw given
widget_control,wDraw,get_value=oWindow
oWindow->Draw,oView

END
[Message index]
 
Read Message
Previous Topic: Aggregating an array
Next Topic: Plot Title

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

Current Time: Sat Oct 11 08:37:37 PDT 2025

Total time taken to generate the page: 6.96090 seconds