c# - Bitmap.MakeTransparent in Silverlight? -


how can make of white pixels of bitmapimage transparent in sivlerlight?

this using regular bitmap:

//bitmap white background: var bmp = new bitmap(100, 100); using (var g = graphics.fromimage(bmp)){     g.clear(color.white);     g.drawstring("string", new font(fontfamily.genericserif,10.0f), new solidbrush(color.red), 30, 30); }  //i want make white transparent bitmap.maketransparent does: bmp.maketransparent(color.white); 

in silverlight, how do this?:

var bmp = new bitmapimage(new uri("http://www.google.com/images/logos/ps_logo2.png")); bmp.maketransparent(color.white); 

i'm new silverlight, expect drawing canvas or later, can shader or if needs be.

a shader perfect if need effect applied again , again there more options:

  1. preproces image in favorite paint program. (fastest, less flexible)
  2. preproces image using writeablebitmap. (slowest, more flexible)
  3. use shader. (fast, flexible)

for shaders @ this wonderful tool shazzam


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -