Re: [Iup-users] Transperency bug (?)
Brought to you by:
scuri
From: Antonio S. <sc...@te...> - 2011-09-21 12:43:38
|
That depends on the system. For instance, stipple is always opaque in the base Windows driver which the CD_IUP driver relies on. Best, Scuri From: Robert Persson [mailto:r.k...@gm...] Sent: terça-feira, 20 de setembro de 2011 08:34 To: iup...@li... Subject: [Iup-users] Transperency bug (?) Hi! I have created a small IUP+CD program which draws a box sith a stipple pattern. Code attached below. It seems that CD_TRANSPARENT does not work for back opacity using stipples (?). For Hatches it works as expected. /* Robert.P., Sweden */ //CODE START #include <cd.h> #include <cdpdf.h> #include <iup.h> #include <cdiup.h> static cdCanvas* cdcanvas; static unsigned char stip[]= { 1,1,0,0,0,0, 1,1,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0, 0,0,0,0,0,0 }; int canvasaction(Ihandle* ih) { cdCanvasActivate(cdcanvas); //draw a see-through line cdCanvasForeground(cdcanvas,0xff0000); cdCanvasLine(cdcanvas,0,0,200,200); //draw a test rectangle cdCanvasBackground(cdcanvas,0xffff00); cdCanvasForeground(cdcanvas,0x00); cdCanvasBackOpacity(cdcanvas,CD_TRANSPARENT); cdCanvasStipple(cdcanvas,6,6,stip); cdCanvasBox(cdcanvas,50,200,50,200); return IUP_DEFAULT; } int main() { IupOpen(0,0); Ihandle* canvas; Ihandle* dlg=IupDialog(canvas=IupCanvas(0)); IupSetAttribute(canvas,"RASTERSIZE","500x500"); IupSetCallback(canvas,"ACTION",canvasaction); IupMap(dlg); cdcanvas=cdCreateCanvas(CD_IUP,canvas); IupShow(dlg); IupMainLoop(); IupClose(); return 0; } //END |