Monday, 13 October 2014

Rectangle Centerlines Part 02

...continued from Part 1

Creating the UI

When creating the UI, you can directly copy the images at the beginning of Part 01 for use in the PictureBox control. This would display the images as below:

04

Here's a free program called paint.Net that can be used for making transparent background images.

Once installed, click the Colors icon in the top-right corner or press F8 to display the Colors palette if not already visible.

05

On the Colors palette, click the More>> button

06       07
      Expanded palette, bottom-left corner.

On the expanded palette, Right-Click on the color in the bottom left corner which looks like chequered gray and white. This is a transparent color or Alpha Channel. By right-clicking this becomes the secondary or background color.

Next, select the 'Magic Wand' tool from the Tools palette and click in the white area of the image. Press Delete on the keyboard. The color is now replaced with the secondary color i.e. transparent color.

08 09

When assigned to the Image property of the PictureBox control, the image appears as below. The image on the right still has a white background.

10

Additionally, set the BorderStyle property of the PictureBox to None.

Also add a ColorDialog 11 control to the Form. Note that the Orange control for picking the color for centerlines is a Button.

More on coding and geometry follows in Part 3...

Index of all Solid Edge Tutorials, Tips, Videos...