Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / April 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Per - 03 Apr 2008 08:37 GMT
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 - 03 Apr 2008 13:28 GMT
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.

> 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 ?
Per - 04 Apr 2008 15:45 GMT
I found a wrapper for FreeImage that workt perfect. It's called
dotnetFireBall http://www.codeplex.com/dotnetfireball.

Image imageToSet = null;
                   
Fireball.Drawing.FreeImage image = new FreeImage(@"c:\test.pcx");            
           

imageToSet = image.GetBitmap();

pictureBoxImage.Image = imageToSet;

> You can't do it with the framework. You'll need to use something like
> FreeImage (http://freeimage.sourceforge.net/) or Gfl Sdk
[quoted text clipped - 8 lines]
> > an
> > exception. Does anybody have an idea ?
Ignacio Machin ( .NET/ C# MVP ) - 03 Apr 2008 16:06 GMT
> 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 ?

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 :)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.