11-06-2010 10:43 PM
Hello,
Is there any way to make a translucent color? Want to simulate the radar beam to scan when it meeting the object, the beam filled area should be changed the translucent.
David
11-07-2010 02:13 AM - edited 11-07-2010 02:14 AM
And the other problem encountered: the code phase as follows:
...
1, SetCtrlAttribute (panel, PANEL_CANVAS, ATTR_PEN_FILL_COLOR, MakeColor(199, 172, 223));
2, CanvasDrawArc(panel, PANEL_CANVAS, MakeRect(0,0,height, width), 0, 150, VAL_DRAW_FRAME_AND_INTERIOR);
3, Delay(0.2);
4, SetCtrlAttribute (panel, PANEL_CANVAS, ATTR_PEN_MODE, VAL_XOR_MODE);
5, CanvasDrawArc(panel, PANEL_CANVAS, MakeRect(0,0,height, width), 0, 150, VAL_DRAW_FRAME_AND_INTERIOR);
...
the idea is that after drawing the arc by line 1, line 2 syntax, then using line 4, line 5 syntax to erase the arc, so as to restore the background, but the effect is that there leaving a black arc. which function should be used to achieve the idea?
David
11-07-2010 04:01 AM
Hi David,
two ideas: you could 'delete' the rectangular area of the old line using CanvasClear, or you could try drawing the old line with the background color, which you may obtain using GetCtrlAttribute (, , ATTR_PICT_BGCOLOR)
Wolfgang
11-07-2010 05:08 AM
Hi Walfgang,
Changed the code :
1, SetCtrlAttribute (radarPanel, RADARPANEL_CANVAS, ATTR_PEN_MODE, VAL_XOR_MODE);
2, SetCtrlAttribute (radarPanel, RADARPANEL_CANVAS, ATTR_PEN_COLOR, MakeColor(199, 172, 223));
3 , CanvasDrawArc(radarPanel, RADARPANEL_CANVAS, MakeRect(0,0,height, width), 0, 150, VAL_DRAW_FRAME_AND_INTERIOR);
after line 1~3 executed, the effect is the follows:
then executing the follows code:
5, CanvasDrawArc(radarPanel, RADARPANEL_CANVAS, MakeRect(0,0,height, width), 0, 150, VAL_DRAW_FRAME_AND_INTERIOR); the effect is as follows:
Through XOR operation, it leaving the black arc, but at least I can see the circles. Now hope can delete the black arc and restore the background color and also keep the circles is visiable. How to resolve the problem?
David
11-07-2010 06:54 AM
Hi,
The problem has got released. Because the canvas color is set to transparent, so when redrawing with XOR mode, it could resualt the black area, after changing the control background color to the same as the panel color, it can erase correctly.
David
11-07-2010 08:48 AM
Hello,
Assuming there are some LED control is distributed in the circles, when the beam covering them, want to highlight the LEDs, is there any method to notify them that they are in the beam?
David