LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Round image place on button ?

Is it possible to place a round image on rectangle image control ?.

Thanks

0 Kudos
Message 1 of 4
(3,199 Views)

Can you add some more details on what you are trying to do?

On one hand, on Windows there really do not exist round objects: each object is encloded in a rectangle (you can retrieve this rectangle with GetCtrlBoundingRectangle function).

 

What you may be trying to do is to hide the borders of the rectangle so that only the round part is visible and objects below the corners are not covered by rectangle edges. This can obtained with the use of transparency: some file formats support transparency so you can create for example a .PNG image with transparent background (some drawing tools permit to do so. Paint does not). The .PNG image can then be loaded into a picture control painted in transparent too: the resulting effect is that only the round portion will be visible.

 

If you don't have a tool for image manipulation that can add transparency to your image you can paint the background in a known color (e.g. white or black) and then use the function provided by Alex D in this old post to make that color transparent.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,195 Views)

Thanks to replay,

I attach a screen shot, plz see and give me solution

 

Thanks

umer

0 Kudos
Message 3 of 4
(3,172 Views)

The solution is the one I described in my previous post:

 

Option 1:

- use some tool to paint image background in transparent (I am using Photo Editor included in Office 2000; there are other tools available). Save it in .PNG format

- paint the picture or picture ring control in transparent

- load the image in the control either in the UIR editor or programmatically

 

Option 2:

- paint picture background in white

- paint the control in transparent

- load the image with GetBitmapFromFile

- apply Alex D routine to the bitmap

- load the bitmap into the control with SetCtrlBitmap (picture control) or InsertListItem and SetCtrlBitmap (picture ring)

 

With regard to the picture ring, if it is in hot mode you cannot avoid a dotted rectangle to appear around the control when it is the active one if it hasn't a visible lable. One possible solution in case you do not want a lable to be visible for the control is to actually have a lable visible but move it programmatically out of the visible portion of the panel: in tihs case the dotted border will be around the label but on a off-screen area.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 4
(3,170 Views)