Which image file formats does Image/Bitmap support?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Oliphant

    #1

    Which image file formats does Image/Bitmap support?

    The Image class allows loading a bitmap from a graphic file. So far I've
    gotten it to work with JPG and BMP files.

    What other graphic file formats are supported in this way? Is this fixed
    based on the .NET Framework used (e.g., the Image class defines which
    formats can be used), or can different file formats be added after-the-fact
    (end-user capability in contrast to developer implementation) ?

    Also, is it possible to save an image in BMP or JPG or etc. graphic formats
    natively (part of the language in contrast to written code or 3rd party
    stuff)?

    Thanks in advance for responses!

    [==Peter==]

  • Sheng Jiang[MVP]

    #2
    Re: Which image file formats does Image/Bitmap support?

    I am not clear which image library you are talking about. C++ does not have
    any built-in keywords for image processing.
    If you are talking about GDI+, yes, it is the same in System.Drawing.
    If you want to extend your image format support at runtime, write your own
    image processing engines as plugins.


    --
    Regards
    Sheng Jiang
    Microsoft MVP in VC++
    "Peter Oliphant" <peteroid69@hot mail.comwrote in message
    news:BAE085E5-2A75-484D-9C45-620858B16688@mi crosoft.com...
    The Image class allows loading a bitmap from a graphic file. So far I've
    gotten it to work with JPG and BMP files.
    >
    What other graphic file formats are supported in this way? Is this fixed
    based on the .NET Framework used (e.g., the Image class defines which
    formats can be used), or can different file formats be added
    after-the-fact (end-user capability in contrast to developer
    implementation) ?
    >
    Also, is it possible to save an image in BMP or JPG or etc. graphic
    formats natively (part of the language in contrast to written code or 3rd
    party stuff)?
    >
    Thanks in advance for responses!
    >
    [==Peter==]

    Comment

    • Peter Oliphant

      #3
      Re: Which image file formats does Image/Bitmap support?

      OK, sorry, I will try to be a bit clearer.

      The following code will work, and successfully loads the image stored in an
      image file into a Bitmap:

      Bitmap^ image_bm = gcnew Bitmap( "image.JPG" ) ;

      and this works as well:

      Bitmap^ image_bm = gcnew Bitmap( "image.BMP" ) ;

      but this DOESN'T work:

      Bitmap^ image_bm = gcnew Bitmap( "image.TXT" ) ;

      Thus, I know the language supports READING both JPG and BMP, and seems to do
      so on every computer, thus it appears to accept these particular image file
      formats natively (without having to install anything first).

      What I'm interested in knowing is which OTHER image formats does this work
      with? Equivalently, for which extensions .XYZ will the following also work:

      Bitmap^ image_bm = gcnew Bitmap( "image.XYZ" ) ;

      [==Peter=]


      "Sheng Jiang[MVP]" <sheng_jiang@ho tmail.com.discu sswrote in message
      news:A7B32D30-A906-4825-AE26-9D9A10DD7A0E@mi crosoft.com...
      >I am not clear which image library you are talking about. C++ does not have
      >any built-in keywords for image processing.
      If you are talking about GDI+, yes, it is the same in System.Drawing.
      If you want to extend your image format support at runtime, write your own
      image processing engines as plugins.
      >
      >
      --
      Regards
      Sheng Jiang
      Microsoft MVP in VC++
      "Peter Oliphant" <peteroid69@hot mail.comwrote in message
      news:BAE085E5-2A75-484D-9C45-620858B16688@mi crosoft.com...
      >The Image class allows loading a bitmap from a graphic file. So far I've
      >gotten it to work with JPG and BMP files.
      >>
      >What other graphic file formats are supported in this way? Is this fixed
      >based on the .NET Framework used (e.g., the Image class defines which
      >formats can be used), or can different file formats be added
      >after-the-fact (end-user capability in contrast to developer
      >implementation )?
      >>
      >Also, is it possible to save an image in BMP or JPG or etc. graphic
      >formats natively (part of the language in contrast to written code or 3rd
      >party stuff)?
      >>
      >Thanks in advance for responses!
      >>
      >[==Peter==]
      >

      Comment

      Working...