bitmap conversion problem

R

raar

Hello,
I am using .net cf version 2.0 and i have a strange problem with
converting bitmaps.
Loading of bitmaps in various formats (bmp, jpg, png) works perfectly
but when i try to save them in any format other than .Bmp (like jpg or
png), the program compiles but when i execute it i get an error: "Not
supported". Because i am uploading a bitmap to a server, i would like
to use the png format since bitmaps in png are smaller in size and
thus upload faster. Even jpg would do.
My code is simpel:
bitmap = new Bitmap(dlg.FileName);
MemoryStream bitmapStream = new System.IO.MemoryStream();
bitmap.Save(bitmapStream, System.Drawing.Imaging.ImageFormat.Png);
It works when i make a desktop program but not when i make it for
pocketpc.

Help or hints much appreciated
 
G

Guest

I don't believe the png format is supported in the CF. I would try jpg.

Rick D.
Contractor
 
G

Guest

It's because there's a decompressor but not a compressor in the imaging
library. You might just compress the BMP and ship it, then have the server
convert it if necessary.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top