'capture'에 해당되는 글 2건

  1. 2016.04.05 [wpf] Object Capture 컨트롤 캡쳐
  2. 2011.03.25 [wp7] 윈도우 폰 캡쳐 프로그램
wpf2016. 4. 5. 18:16
Usercontrol등 Element등을 캡쳐 할수 있도록 만들었다.

용도는 캠 이미지위에 배경및 각종 clip art들을 얹혀서 캡쳐 하기위한 용도~


public static string SaveCamCapture(string filePath, FrameworkElement targetControl)
{
targetControl.UpdateLayout();
// Get the size of the Visual and its descendants.
Rect rect = VisualTreeHelper.GetDescendantBounds(targetControl);
// Make a DrawingVisual to make a screen
// representation of the control.
DrawingVisual dv = new DrawingVisual();
// Fill a rectangle the same size as the control
// with a brush containing images of the control.
using (DrawingContext ctx = dv.RenderOpen())
{
VisualBrush brush = new VisualBrush(targetControl);
ctx.DrawRectangle(brush, null, new Rect(rect.Size));
}
RenderTargetBitmap targetBitmap = new RenderTargetBitmap((int)(targetControl.ActualWidth), (int)(targetControl.ActualHeight), 96, 96, PixelFormats.Pbgra32);
targetBitmap.Render(dv);
var bitmapEncoder = new PngBitmapEncoder();
bitmapEncoder.Frames.Add(BitmapFrame.Create(targetBitmap));
if (filePath != null)
{
using (var filestream = new FileStream(filePath, FileMode.Create))
{
bitmapEncoder.Save(filestream);
}
}
return filePath;
}





Posted by 동동(이재동)
Windows Phone 72011. 3. 25. 17:23

 

다운 받을수 있는 url

http://www.innovativetechguy.com/?p=13

 

 

image

 

이렇게 생겼는데 2가지 모드를 지원한다. 마켓 플레이스 모드로 찍으면 마켓플레이스에 올릴 480 680

 

으로 짤라서 찍고 other로 하면 에뮬레이터 자체를 찍는다.

 

유용한듯?

Posted by 동동(이재동)