How to specify the image scaling algorithm used by a WPF Image?
Posted
by mackenir
on Stack Overflow
See other posts from Stack Overflow
or by mackenir
Published on 2010-05-26T12:49:17Z
Indexed on
2010/05/26
12:51 UTC
Read the original article
Hit count: 249
wpf
|image-scaling
Is there a way to specify how an image is scaled up in an Image
element with LayoutTransform
set to a ScaleTransform
with integer values for ScaleX
and ScaleY
?
I want to display the scaled image crisply (ie using 'nearest neighbour' scaling), with no blurring. (Imagine how you would want a bitmap editing program to behave when zooming in).
I noticed the protected property VisualBitmapScalingMode
on Image
, so created a subclass of Image
that sets this property to BitmapScalingMode.NearestNeighbor
. However, this had no effect.
© Stack Overflow or respective owner