最近在研究phone7,有一个程序,把图片的一部分剪切下来,用到image.clip,但是发现是把源图缩小至我要的尺寸,代码如下:
StreamResourceInfo streamSource = Application.GetResourceStream(new Uri("2011-11-28 PuzzleGame;component/Image/Puzzle.jpg", UriKind.Relative));
BitmapImage bitmap = new BitmapImage();
bitmap.SetSource(streamSource.Stream);
Image image = new Image();
image.Height = 435;
image.Width = 435;
image.Source = bitmap;
this.image_1.Source = image.Source;
RectangleGeometry r = new RectangleGeometry();
r.Rect = new Rect(0, 0, 100, 100);
image.Clip = r;
this.image1.Source = image.Source;
现在就是想从起始座标0,0开始取高和宽都是100的图像,但取到的是源来的大图的缩小版,请高手帮忙指点,谢谢