1

I am a decent winforms programmer and I have done a little programming in XNA, I am trying to learn WPF.

I have a bunch of greyscale images that I want to add color to dynamically. to do this in XNA is easy simply indicate the color you want to use in the SpriteBatch.Draw method

SpriteBatch.Draw(Image,0,0,Color.blue)  

Or something like that. That would draw my greyscale image with a blue hue to it. The purpose of this is to change the look of an Item, without having to draw them all manually.

I can't seem to find a good option in WPF

General Grey
  • 3,598
  • 2
  • 25
  • 32
  • Maybe a modification of this answer, which uses multiple colours, would do the job http://stackoverflow.com/a/8871500/2046117 – owenrumney Jan 22 '14 at 09:43

1 Answers1

2

Ok, well I hope your are a decent ... programmer. This kind of image processing in WPF is not for the feint hearted. You certainly can't do it with the same ease that you displayed in your question example. Your best bet is to use someone else's code to do it for you. Please see the following articles for further help:

Image Processing Lab in C#
Image Processing is Done using WPF

If you're really hardcore, you can even plug High Level Shading Language (HLSL) pixel shader files into WPF to create all sorts of crazy visual effects. See Chapter 13 of the wonderful WPF Control Development UNLEASHED book online for a great introduction to this subject.

Sheridan
  • 68,826
  • 24
  • 143
  • 183