Image Control to Bitmap
hi,
i trying system.drawing.bitmap out of system.windows.controls.image. not see simple way in .net, and i assume i missing something.
does know how this?
c# code samples appreciated
thanks,
wasabi fan
wasabifan
... example (for bitmapimages):
bitmap bmpout = null; using (memorystream ms = new memorystream()) { pngbitmapencoder encoder = new pngbitmapencoder(); encoder.frames.add(bitmapframe.create((bitmapsource)this.usercontrol11.image1.source)); encoder.save(ms); using (bitmap bmp = new bitmap(ms)) { bmpout = new bitmap(bmp); } }
... this.usercontrol11.image1 wpf-image-control (tested in elementhost)
regards,
thorsten
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment