Nevron Forum

Transparent Shapes

https://www.nevron.com/Forum/Topic5094.aspx

By Ashton Hobbs - Monday, April 18, 2011

Is there any way to make everything within a particular shape transparent (or set the alpha level) so that different shapes can appear with different transparency levels. I saw where I could set the fill transparency but that didn't seem to affect the text and the bitmap within the shape.

Essentially I want some shapes visible but almost faded out and others to be drawn normally so that I can emphasize which shapes are important in the diagram.

Thanks
By Nevron Support - Tuesday, April 19, 2011

Hi, you can set the transparency of a shape using the SetTransparencyPercent method of its fill style:

shape.Style.FillStyle.SetTransparencyPercent(50);

By Ashton Hobbs - Wednesday, April 20, 2011

I tried setting the FillStyle and was unable to make it work. I have the following:

tbl.InitTable(1, 2);
tbl.BeginUpdate();
tbl.ShowGrid = false;
// trying several different types, none seems to make anything in the shape transparent/translucent
tbl.Style.FillStyle = new NColorFillStyle();
tbl.Style.FillStyle.SetTransparencyPercent(50);
tbl[0, 0].Style = new NStyle();
tbl[0, 0].Style.FillStyle = new NColorFillStyle();
tbl[0, 0].Style.FillStyle.SetTransparencyPercent(50);
tbl[0, 1].Style = new NStyle();
tbl[0, 1].Style.FillStyle = new NColorFillStyle();
tbl[0, 1].Style.FillStyle.SetTransparencyPercent(.50f);
tbl[0, 0].Bitmap = Properties.Resources.Adobe.ToBitmap();
tbl[0, 1].Text = "Ashton";
tbl.EndUpdate();

Should the above code do what I want or am I missing something.

Also, if it is not possible to do it like I am doing above is it possible to have a custom shape whereby I could handle the paint/draw event and get access to the GDI Graphics object and draw the items for the shape with the alpha percentage (I would prefer to use regular NShape object derivatives if possible)

thanks