本文介绍了图像缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢WPF缩放的简单程度(转换任何控件的转换能力).但是,我想将其用于图像,并且需要像素化,即不进行混合/平滑处理.

因此,如果我一直都在拍摄黑白格仔的图像,那么随着我放大的越来越远,我希望能够一直放大到黑色(或白色像素).

I love how simple the WPF zooming is (transform ability to zoom any control). However, I wanted to use it for an image and I require the pix-elation, i.e. no blending/smoothing.

So if I have an image of checkered Black and White pixels all through out, as I zoom further and further in I want to be able to zoom all of the way into a Black (or White Pixel).

Is this possible?

推荐答案

System.Windows.Media.Imaging.BitmapImage

及其方法CopyPixels.

如果您需要更新图片(如果这是一种编辑器),则可能需要将正方形"数据打包回真实位图.然后使用

and its method CopyPixels.

If you need to update picture (if this is a kind of editor), you may need to pack your "square" data back to real bitmap. Then use

System.Windows.Media.Imaging.WriteableBitmap



请随时提出任何其他问题(如果您认为有问题,请在投票前这样做:))

谢谢.



Please feel free to ask any further questions (and certainly do that if you think something is wrong, before you vote :) )

Thank you.


这篇关于图像缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 16:01