Hi folks,

I try to save an compressed image to the vfs. I have created a surface with 320 * 320 Pixel and want to write the data to a file.

I have tried to create a new PalmPhotoHandle and write it with the callback. but this doesn�t seem to work. the api returns no error but it writes only the imagehandle and not my byte array.

now I have implemented jpglib. Loading an image is quit simple but saving won�t work. I guess this lib has a bug.
if I set "im" to a specified color it works perfect. the bug occurs only if I use a lot of colors (don�t know exactly how many).
May be it has something to do with the contrast between the colors...don�t know


You can still discern the orginal image. But it is destroyed ... please see the link
http://www.em-motion.com/palm/palm.jpg


By the way - I know that this solution is really slow...but that is not my problem

          for(y = 0; y < (UInt32)320; y++)
          {
              for(x = 0; x < (UInt32)320; x++)
              {                          add = x+y*(UInt32)320;

// Draw window ist a bitmap window WinGetPixelRGB (x, y, &rgb);
im[3 * add] = rgb.r; im[3 * add + 1] = rgb.g;
im[3 * add + 2] = rgb.b;


// rgb values are correct...I have check this
}
}
JpegLibCreateImageDescrPtr(m_jpgRefLib, &image, 320, 320, 3, im);
JpegLibCreateEncOptions(m_jpgRefLib, &eopt); // initialize options with def. values
JpegLibSetEncOptQuality(m_jpgRefLib, &eopt, 100); // 0 = worst .. 100 = best
JpegLibSetEncOptProgressive(m_jpgRefLib, &eopt, 0); // 0 or 1 JpegLibCreateDataVFS(m_jpgRefLib, &data, fileH);


          err = JpegLibWrite(m_jpgRefLib, &image, NULL, &data);






-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to