How to load pcx-images into an System.Drawing.Bitmap ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UGVy?=

    How to load pcx-images into an System.Drawing.Bitmap ?

    I'm working on a project that have to load an display pcx-images in a
    PictureBox-control. When I try to load the file with Bitmap.FromFile I get an
    exception. Does anybody have an idea ?
  • Fredo

    #2
    Re: How to load pcx-images into an System.Drawing. Bitmap ?

    You can't do it with the framework. You'll need to use something like
    FreeImage (http://freeimage.sourceforge.net/) or Gfl Sdk
    (http://pagesperso-orange.fr/pierre.g/xnview/engfl.html)

    They're both unmanaged libraries, but you can use interop to call them.
    FreeImage has 2 .NET wrappers available already, so it's probably the easier
    way to go.



    "Per" <Per@discussion s.microsoft.com wrote in message
    news:058B9808-5C1F-438F-9117-F18F3E36EA39@mi crosoft.com...
    I'm working on a project that have to load an display pcx-images in a
    PictureBox-control. When I try to load the file with Bitmap.FromFile I get
    an
    exception. Does anybody have an idea ?

    Comment

    • Ignacio Machin ( .NET/ C# MVP )

      #3
      Re: How to load pcx-images into an System.Drawing. Bitmap ?

      On Apr 3, 3:37 am, Per <P...@discussio ns.microsoft.co mwrote:
      I'm working on a project that have to load an display pcx-images in a
      PictureBox-control. When I try to load the file with Bitmap.FromFile I getan
      exception. Does anybody have an idea ?
      Hi,

      There is no support for PCX in the framework I think, in this case
      you should try to find a third party control that allows it. I would
      first stop by codeproject or some of the other code repositories to
      see if there is a managed (and free) version around.


      Ps:
      If you find one please post it back here for the posterity :)

      Comment

      • =?Utf-8?B?UGVy?=

        #4
        Re: How to load pcx-images into an System.Drawing. Bitmap ?

        I found a wrapper for FreeImage that workt perfect. It's called
        dotnetFireBall http://www.codeplex.com/dotnetfireball.

        Image imageToSet = null;

        Fireball.Drawin g.FreeImage image = new FreeImage(@"c:\ test.pcx");


        imageToSet = image.GetBitmap ();

        pictureBoxImage .Image = imageToSet;





        "Fredo" wrote:
        You can't do it with the framework. You'll need to use something like
        FreeImage (http://freeimage.sourceforge.net/) or Gfl Sdk
        (http://pagesperso-orange.fr/pierre.g/xnview/engfl.html)
        >
        They're both unmanaged libraries, but you can use interop to call them.
        FreeImage has 2 .NET wrappers available already, so it's probably the easier
        way to go.
        >
        >
        >
        "Per" <Per@discussion s.microsoft.com wrote in message
        news:058B9808-5C1F-438F-9117-F18F3E36EA39@mi crosoft.com...
        I'm working on a project that have to load an display pcx-images in a
        PictureBox-control. When I try to load the file with Bitmap.FromFile I get
        an
        exception. Does anybody have an idea ?
        >
        >
        >

        Comment

        Working...