06-18-2013 06:19 AM
OK, so I'm working on a workaround for this bug. Basically I read my picture rings and generate new canvases on which I put the images from the ring. Then I just put whatever canvas I want on top. Except that there's a problem with the transparency of the images which gets lost in the process:
int j, New, Bitmap, Left, Top, Width, Height, Pre[3]={1,3,2}; // Only some colors for (j=0; j<Nb; j++) { GetCtrlBitmap (Pnl, PNL_PICRING, i, &Bitmap); GetCtrlAttribute(Pnl, PNL_PICRING, ATTR_LEFT, &Left); GetCtrlAttribute(Pnl, PNL_PICRING, ATTR_TOP, &Top); GetCtrlAttribute(Pnl, PNL_PICRING, ATTR_WIDTH, &Width); GetCtrlAttribute(Pnl, PNL_PICRING, ATTR_HEIGHT,&Height); New = NewCtrl (pDgrm, CTRL_CANVAS, "", Top, Left); SetCtrlAttribute(Pnl, New, ATTR_DRAW_POLICY, VAL_MARK_FOR_UPDATE); SetCtrlAttribute(Pnl, New, ATTR_WIDTH, Width); SetCtrlAttribute(Pnl, New, ATTR_HEIGHT, Height); SetCtrlAttribute(Pnl, New, ATTR_PICT_BGCOLOR, VAL_TRANSPARENT); CanvasDrawBitmap(Pnl, New, Bitmap, VAL_ENTIRE_OBJECT, VAL_ENTIRE_OBJECT); DiscardBitmap(Bitmap); } SetCtrlAttribute(Pnl, PNL_PICRING, ATTR_VISIBLE, FALSE);
Am I forgetting something about transparency ?
Solved! Go to Solution.
06-19-2013 10:16 AM
Hi gdargaud,
Are you expecting to have the bitmap drawn into the canvas be transparent?
06-19-2013 10:34 AM
Yes. Actually, reading the documentation, I figured out it's actually simpler to use a picture control instead of a canvas. I had forgotten about those. Case closed. But could you please answer my other thread about the major memory leak when using picture rings, which is actually the reason I'm using this workaround ? Thank you.