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

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

How to Share webservice object to all user

How to fix error Msg 1801, Level 16, State 3, Line 1