PCX files are designed to mimic the frame-buffer format of the graphics
hardware that they display on. It was a quick and dirty way of saving images
"back in the day".
This link should help out.
http://courses.ece.uiuc.edu/ece390/books/labmanual/graphics-pcx.html
You'll need to write the information byte by byte to a file. Remember that
the image data will need to be converted from the 24bpp format to the PCX
pixel format. This will probably be easiest and quickest using LockBits to
access the byte buffer of the original image.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
[quoted text, click to view] "garyalfred" <ga@spapool.com> wrote in message
news:1115836144.674104.303320@o13g2000cwo.googlegroups.com...
>I need to write out an 8bit PCX file from an Image or Bitmap object
> i've created using a GraphicsPath. I had hoped it would be as easy as
> saving it out using an ImageFormat member, but alas there is no PCX
> ImageFormat member.
>
>>From what I can tell I am going to need to construct this file one byte
> at a time. I've really no idea on how to proceed. I've never worked
> with byte data directly so the suggestions on writing out the file
> header, image data and palette only partial makes sense to me.
>
> Can anyone give me pointers or resources that might help explain the
> process of going from Image to PCX file using the dotNET framework?
>
> Thanks in advance for any help.
>