0

I am not sure if this is possible or not, but here is the goal:

  1. Mixed-transparency PNG image is grabbed from relative URL (to silverlight app)
  2. All pixels in image are then changed to a specified color without altering opacity (ie, transparent px will remain transparent, semi-transparent will be semi-transparent)
  3. Image will display in an image control.

Is there a way to do this kind of color overlay and image manipulation in silverlight?

Also, computing time is also an issue. This will have to happen many times, and if it is an intensive and time consuming operation that could be an issue.

There doesnt seem to be alot of information in Google, am I correct to assume a WritableBitmap will have to be used?

caesay
  • 16,932
  • 15
  • 95
  • 160

1 Answers1

0

Sounds like the perfect job for a ShaderEffect. These are pixel shaders that run on the GPU. They are very fast and a simple per-pixel color operation will be breezy work for them. You don't need to parse the PNG format or anything like that either (the Image control that you'll apply the shader to will do this for you).

A WriteableBitmap will be far slower, and I'm not sure you could avoid having to parse the PNG.

Aleksandr Dubinsky
  • 22,436
  • 15
  • 82
  • 99