This may be what you are looking for ...
TransformedBitmap
Here is the static method I made in the ImageUtility class.
public static TransformedBitmap GetScaledBitmapImageSprite(BitmapSource src, double x_scale, double y_scale) { return (new TransformedBitmap(src, new ScaleTransform(x_scale, y_scale))); {
x_scale and y_scale are doubles of the form:
required_width / original_width
It may be a little different from what you are looking for, but I think it can make you start correctly.
You can save the TransformedBitmap in memory and apply the new transforms via:
TransformedBitmap x = new TransformedBitmap(); x.Transform = new ScaleTransform(x,y);
mwjohnson
source share