Windows Vista Forums

Convert BitmapImage to Bitmap?
  1. #1


    Rhinpoche@star-sw.com Guest

    Convert BitmapImage to Bitmap?

    How I can convert from System.Windows.Media.Imaging.BitmapImage(Avalon
    bitmap) to System.Drawing.Bitmap (.net Bitmap)?




      My System SpecsSystem Spec

  2. #2


    robertwl@nospam.microsoft.com Guest

    re: Convert BitmapImage to Bitmap?

    Just curious, why are you trying to do that? Perhaps there are WPF classes that can do what you're looking for?

    In any case, WPF doe not have a way to natively convert BitmapSources to Bitmaps. You need to manually do this by calling CopyPixels, and creating a Bitmap with the image bits.

    -----Original Message-----
    From: Rhinpoche@star-sw.com
    Posted At: Wednesday, May 17, 2006 6:43 AM
    Posted To: microsoft.public.windows.developer.winfx.avalon
    Conversation: Convert BitmapImage to Bitmap?
    Subject: Convert BitmapImage to Bitmap?


    How I can convert from System.Windows.Media.Imaging.BitmapImage(Avalon
    bitmap) to System.Drawing.Bitmap (.net Bitmap)?

      My System SpecsSystem Spec

  3. #3


    Rhinpoche@star-sw.com Guest

    Re: Convert BitmapImage to Bitmap?

    several reasons

    1.relatively large library of very specific image transformations,
    implemented on Bitmap
    2.Hard deadline
    3.cherish hopes for some backward compatibilty )


      My System SpecsSystem Spec

  4. #4



    Newbie
    Join Date : Jan 2009
    Posts : 1
    32bit
    Local Time: 01:38 AM


     

    Re: Convert BitmapImage to Bitmap?

    ImageSource to Bitmap

    MemoryStream mse = newMemoryStream();
    System.Windows.Media.Imaging.
    BmpBitmapEncoder e = newBmpBitmapEncoder();
    e.Frames.Add(
    BitmapFrame.Create(imageSource_bitmapSource));
    e.Save(mse);

    WIC Rocks!

      My System SpecsSystem Spec

Convert BitmapImage to Bitmap? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Init BitmapImage from Project resource JT Avalon 0 15 Aug 2007
Creating an BitmapImage from an ImageBrush? scott.browse@gmail.com Avalon 0 13 Aug 2007
BitmapImage and Bitmap (second shot)) Rhinpoche@star-sw.com Avalon 2 18 May 2006
Convert BitmapImage to Bitmap? Rhinpoche@star-sw.com Avalon 0 17 May 2006
relative filepath for BitmapImage UriSource in Feb CTP bonk Avalon 1 15 Mar 2006