Posts

Showing posts from 2014

Custom DataTemplate Id not visible

Image

Taking Screenshots in WPF

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)...