LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Make translucent color

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

0 Kudos
Message 1 of 6
(3,714 Views)

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

0 Kudos
Message 2 of 6
(3,706 Views)

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

0 Kudos
Message 3 of 6
(3,698 Views)

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:

 

捕获.jpg

 

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:

 

捕获.jpg

 

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

 

0 Kudos
Message 4 of 6
(3,692 Views)

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

0 Kudos
Message 5 of 6
(3,687 Views)

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 

0 Kudos
Message 6 of 6
(3,682 Views)