[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

dw

1/6/2005 6:49:00 PM

Hello....

Is there a way to convert an existing image - JPG, GIF, BMP - to a
black-and-white PCX formatted image?

thanks
-wd

4 Answers

Bob Powell

1/6/2005 11:54:00 PM

0

Not wihout writing the PCX encoder yourself. Remember though that PCX is in
fact the same format as the image in memory so it shouldn't be too hard/

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"dw" <dw@discussions.microsoft.com> wrote in message
news:59481D1A-631D-4556-BAE5-A67DDABA6348@microsoft.com...
> Hello....
>
> Is there a way to convert an existing image - JPG, GIF, BMP - to a
> black-and-white PCX formatted image?
>
> thanks
> -wd
>


dw

1/7/2005 12:19:00 AM

0

Thanks for the reply, but I am confused. When you say that the image in
memory is the same format as PCX....would I just be able to take what I have
streamed into memory (what was once a JPG file) and then simply write that
out to a file with an extension of .PCX ? That sounds too good to be true.
And...when you write "PCX encoder" are you referring to the process of having
to convert the color image to black-and-white?

thanks and sorry if I missed something....but graphics and drawing are not
an area I normally work in.
.... dw

"Bob Powell [MVP]" wrote:

> Not wihout writing the PCX encoder yourself. Remember though that PCX is in
> fact the same format as the image in memory so it shouldn't be too hard/
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tips...
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/f...
>
> All new articles provide code in C# and VB.NET.
> Subscribe to the RSS feeds provided and never miss a new article.
>
>
>
>
>
> "dw" <dw@discussions.microsoft.com> wrote in message
> news:59481D1A-631D-4556-BAE5-A67DDABA6348@microsoft.com...
> > Hello....
> >
> > Is there a way to convert an existing image - JPG, GIF, BMP - to a
> > black-and-white PCX formatted image?
> >
> > thanks
> > -wd
> >
>
>
>

Lau Lei Cheong

1/7/2005 2:44:00 AM

0

I think what Bob means is that all kind of bitmap type images are just same
pixel information in memory. So if you can find or develop a encoder to code
the information in that format you can just pass the image to the encoder.

There's plenty of graphics books in the age of DOS that describes how to
encode it(some even carries example code) because Windows 3.X version of
paintbrush uses it. As far as I remember after the header if there's some
consecutive bytes of the same color, it is combined to 2 bytes with the
first byte specifying number of bytes that is the same plus a number(so it
won't got mixed with non-compressed data) In the fashion I think the
transformation will be easy.

"dw" <dw@discussions.microsoft.com> ¦b¶l¥ó
news:B76FE6DF-EE1D-4A7E-BCD6-D1F840F04170@microsoft.com ¤¤¼¶¼g...
> Thanks for the reply, but I am confused. When you say that the image in
> memory is the same format as PCX....would I just be able to take what I
have
> streamed into memory (what was once a JPG file) and then simply write that
> out to a file with an extension of .PCX ? That sounds too good to be
true.
> And...when you write "PCX encoder" are you referring to the process of
having
> to convert the color image to black-and-white?
>
> thanks and sorry if I missed something....but graphics and drawing are not
> an area I normally work in.
> ... dw
>
> "Bob Powell [MVP]" wrote:
>
> > Not wihout writing the PCX encoder yourself. Remember though that PCX is
in
> > fact the same format as the image in memory so it shouldn't be too hard/
> >
> > --
> > Bob Powell [MVP]
> > Visual C#, System.Drawing
> >
> > Find great Windows Forms articles in Windows Forms Tips and Tricks
> > http://www.bobpowell.net/tips...
> >
> > Answer those GDI+ questions with the GDI+ FAQ
> > http://www.bobpowell.net/f...
> >
> > All new articles provide code in C# and VB.NET.
> > Subscribe to the RSS feeds provided and never miss a new article.
> >
> >
> >
> >
> >
> > "dw" <dw@discussions.microsoft.com> wrote in message
> > news:59481D1A-631D-4556-BAE5-A67DDABA6348@microsoft.com...
> > > Hello....
> > >
> > > Is there a way to convert an existing image - JPG, GIF, BMP - to a
> > > black-and-white PCX formatted image?
> > >
> > > thanks
> > > -wd
> > >
> >
> >
> >


Bob Powell

1/7/2005 12:10:00 PM

0

PCX is an image format that mimics the layout of the physical memory space
from an old video card. There are lots of examples of how to write PCX files
out.

Check out the following page.

http://www.dcs.ed.ac.uk/home/mxr/gfx/...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"dw" <dw@discussions.microsoft.com> wrote in message
news:B76FE6DF-EE1D-4A7E-BCD6-D1F840F04170@microsoft.com...
> Thanks for the reply, but I am confused. When you say that the image in
> memory is the same format as PCX....would I just be able to take what I
> have
> streamed into memory (what was once a JPG file) and then simply write that
> out to a file with an extension of .PCX ? That sounds too good to be
> true.
> And...when you write "PCX encoder" are you referring to the process of
> having
> to convert the color image to black-and-white?
>
> thanks and sorry if I missed something....but graphics and drawing are not
> an area I normally work in.
> ... dw
>
> "Bob Powell [MVP]" wrote:
>
>> Not wihout writing the PCX encoder yourself. Remember though that PCX is
>> in
>> fact the same format as the image in memory so it shouldn't be too hard/
>>
>> --
>> Bob Powell [MVP]
>> Visual C#, System.Drawing
>>
>> Find great Windows Forms articles in Windows Forms Tips and Tricks
>> http://www.bobpowell.net/tips...
>>
>> Answer those GDI+ questions with the GDI+ FAQ
>> http://www.bobpowell.net/f...
>>
>> All new articles provide code in C# and VB.NET.
>> Subscribe to the RSS feeds provided and never miss a new article.
>>
>>
>>
>>
>>
>> "dw" <dw@discussions.microsoft.com> wrote in message
>> news:59481D1A-631D-4556-BAE5-A67DDABA6348@microsoft.com...
>> > Hello....
>> >
>> > Is there a way to convert an existing image - JPG, GIF, BMP - to a
>> > black-and-white PCX formatted image?
>> >
>> > thanks
>> > -wd
>> >
>>
>>
>>