Posts
Showing posts from 2014
Taking Screenshots in WPF
- Get link
- X
- Other Apps
Its Very Easy. Look Below: public static byte[] GetPNGImage(UIElement source, double scale, int quality) { double actualHeight = source.RenderSize.Height; double actualWidth = source.RenderSize.Width; double renderHeight = actualHeight*scale; double renderWidth = actualWidth*scale; var renderTarget = new RenderTargetBitmap((int) renderWidth, (int) renderHeight, 96, 96, PixelFormats.Pbgra32); VisualBrush sourceBrush = new VisualBrush(source); DrawingVisual drawingVisual = new DrawingVisual(); DrawingContext drawingContext = drawingVisual.RenderOpen(); using (drawingContext)...