Windows phone 7 如何使用c#windows phone裁剪图像
如何使用c#windows phone裁剪图像 从图像裁剪矩形 如何从图像中裁剪人脸 守则:Windows phone 7 如何使用c#windows phone裁剪图像,windows-phone-7,windows-phone-8,Windows Phone 7,Windows Phone 8,如何使用c#windows phone裁剪图像 从图像裁剪矩形 如何从图像中裁剪人脸 守则: BitmapImage bmp = new BitmapImage(); bmp.SetSource(e.ChosenPhoto); imgShow.ImageSource = bmp; var wb = new WriteableBitmap(bmp); var sdkImg = ImageConverter.SystemToSdk(wb); IFa
BitmapImage bmp = new BitmapImage();
bmp.SetSource(e.ChosenPhoto);
imgShow.ImageSource = bmp;
var wb = new WriteableBitmap(bmp);
var sdkImg = ImageConverter.SystemToSdk(wb);
IFaceDetector detector = FaceDetectorFactory.Create(FaceDetectionType.Haar);
var gray = new ImageGray(sdkImg);
FaceRect[] rc = detector.Detect(gray);
MessageBox.Show(rc[0].ToString());
faceRect.Margin = new Thickness(rc[1].Rect.Left / 2, rc[1].Rect.Top / 2, 0, 0);
faceRect.Width = rc[1].Rect.Width;
faceRect.Height = rc[1].Rect.Height;
faceRect.Visibility = System.Windows.Visibility.Visible;
只需使用继承自
BitmapSource
的WriteableBitmap
类即可。那里有很多样品,你可以参考
参考资料:
BitmapSource
的WriteableBitmap
类即可。那里有很多样品,你可以参考
参考资料:
BitmapSource
的WriteableBitmap
类即可。那里有很多样品,你可以参考
参考资料:
BitmapSource
的WriteableBitmap
类即可。那里有很多样品,你可以参考
参考资料: