GDI+ graphic layer problem

  • Thread starter Thread starter pei_world
  • Start date Start date
P

pei_world

Hi

I want to create a image with multiple layers on top. the background color
of each layer should be transparent except the last one, hence I can only
see the drawed items on such layers.
can anyone tell me whether or not C# allow to do this?



pei_world
 
Pei,

The Graphics object doesn't support the concept of layers, or
composition. You will have to wait until Avalon for something like that.

If you want to do it yourself, then you will have to create multiple
Graphics layers, and have each layer's background have a color, but mark the
color as being 100% transparent. This way, when you compress all of them,
you don't have to worry about the background colors of each layer.

Hope this helps.
 
You can draw images with transparency keys or semi-transparent images one on
top of the other.

The GDI+ FAQ has an article on drawing images which includes details on how
to draw a semi-transparent image on top of a solid one.

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
 
Back
Top