I'm developing a Windows Phone app (for technical reasons it must be WP7). I need to show images that are originally stored as hi-res PNGs, but they are shown at a smaller size. I'm using an <Image>
inside a <Grid>
with star row heights.
The problem is that the downscaled images look kind of choppy (as if the downscaling algorithm is not good), but I can't seem to find a way to show them smoothly without knowing beforehand the display size of the image and generating a new image programmatically.
Is there a property that I can change so that the app uses a different downscaling algorithm and so the image is only defined in XAML, or am I stuck with having to write logic in the code behind so that the image looks smooth?
Update: I got some screenshots to show the problem.
<Image>
inside a <Grid>
<Image>
inside a <ViewBox>
inside a <Grid>
ViewBox can help with scaling, but the algorithm it uses is the same, which is not useful at all to me.
See below post to re-size image this might help you
The Microsoft.Phone assembly includes WriteableBitmap class, SaveJpeg()
. The SaveJpeg signature looks like this: You can specify image height and width for scaling.
public static void SaveJpeg(
this WriteableBitmap bitmap,
Stream targetStream,
int targetWidth,
int targetHeight,
int orientation,
int quality
);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.