JSwiff
flash movies the java way
JSwiff Forum
  Search   Recent Topics     Member Listing    Back to home page 
Register / 
Login 
How to get JPEG encoding table and compressed image?  
Forum Index -> How Do I...
Author Message
lcgerke


Joined: May 2, 2006
Messages: 1
Offline

First let me apologize if this is the wrong place for this message. I've been using jswiff for a couple days now, and it's wonderful, but I'm new to this whole game. My issue is that i'm trying to draw a jpeg to the screen. In order to do that, I think I need to call DefineBitsJPEG2, but I don't honestly know how to get the byte array that represents the jpeg that I have on disk.

I've read the file straight into a byte array (I know, it doesn't sound right), and it works MOST of the time, but sometimes I get big rendering errors.

Any thoughts?

thanks in advance.
luke
Anonymous



See my other post. Does that help? There are 4 extra bytes at the beginning of the data array. For my particular images (this may not apply in all cases) the extra bytes are FF D9 FF D8.

If you're doing more complicated stuff, take a look at the BufferedImage and ImageIcon classes. Image and Graphics might be useful, but they're more obvious.
Ralf



Joined: Jul 20, 2005
Messages: 127
Location: Germany
Offline

Now that's weird. According to the ITU spec (http://www.wotsit.org/download.asp?f=itu-1150PDF) FFD9 is "end of image" and FFD8 is "start of image".
 
  Forum Index -> How Do I...
Go to:   
Legal notes
Powered by JForum 2.1.4 © 2005 - Rafael Steil