Wednesday, 15 May 2013

wpf - Save Image which is inside a content control -


I have content controls on which there is an image, when im trying to save the image that is a black Getting the image is missing me

  RenderTargetBitmap rtb = New RenderTargetBitmap ((int) content1. Actual Wide, (int) content1. Realheat, 96, 96, pixel format.pbgra32); Rtb.Render (content1); PngBitmapEncoder pnge = New PngBitmapEncoder (); Pnge.frames.Add (bitmapFrame.Create (RTB)); Stream stream = file. Create (DriveName + ": /OpenCV/Images/UI/LeftEdge.png"); Pnge.Save (stream); Stream.Close ();  

It seems that when you try to render it, There is no layout on the control. / P>

Try calling Call UpdateLayout () on it.

If he does not do the trick, then try to call (), arrange (), before the first composition.


No comments:

Post a Comment