Transparent Shapes


Author
Message
Ashton Hobbs
Ashton Hobbs
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)
Group: Forum Members
Posts: 3, Visits: 1
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
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

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

shape.Style.FillStyle.SetTransparencyPercent(50);



Best Regards,
Nevron Support Team


Ashton Hobbs
Ashton Hobbs
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)
Group: Forum Members
Posts: 3, Visits: 1
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
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search