Compression, Can It Be Done?

  • Thread starter Thread starter Craig Hardcastle
  • Start date Start date
C

Craig Hardcastle

hi,

What i'm doing is grabbing the image from a picturebox, which is
getting stored into a memory stream.

The problem with getting the bitmap data this way is i can only get
16bit and 24bit images. This would be fine but i then want to send
this data over the internet to a remote pc. Which is all do-able
except the size of the bitmap data is around 57k!!! which is far far
too big!

So wot i need to do is compress the data. However i've searched around
for the examples of how to do is and i'm not too optimistic that it
can be done!

The only other info you need to know is that i'm programming in VB.Net
CF

Thanks,

Craig.
 
Hello,

the possible compression depends pretty much on the kind of the image data.
What kind of pictures you're about to send to the remote pc ? Signatures or
photos ?

If you're capturing signatures you can easily reduce the data amout. You
could for instance save the signature as monochrome bitmap (1 bit per
pixel). Before saving the image data you could also determine the smallest
rectangle which includes the whole signature.

If you need to further reduce the picture's size you could use the open
source #ZipLib compression library
(http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx). But keep
in mind that most of the common compression algorithms (like zip) are not
designed for image data compression.

Greets, Christian
 
Hi,

Thanks for all your replies.

casey i would prefer to convert it to jpeg. i posted a question about
bmp to jpeg only ast week in google and it seemed to conclude that its
not really do-able, that is unless you know something that no else
seemed to come up with?

Christian the type of image data is a picture, but i have it stored as
bytes, header and all. Is there anyway to convert this to monochrome
etc? To covert it does it mean saving the data to a file? as this would
slow down the sending process, and speed is everything as i am streaming
a live video capture from a CF camera.

Bill i have looked at the xceedsoft zip control, but its a bit pricey
and i don't really want to have to buy a 3rd party control. I they have
made one then the code must be out there somewhere to do compression. I
will look at the other one you mentioned though.

Thanks again.

Craig.
 
Back
Top