Re: How to create a byte[] from a MemoryImageSource?
From: ak (spam_at_imagero.com)
Date: 06/02/04
- Next message: ak: "Re: Drag&Drop Components"
- Previous message: Roedy Green: "Re: Questionare: Which IDE you think is good one for writing Java Applet?"
- In reply to: Greg Dameron: "How to create a byte[] from a MemoryImageSource?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 2 Jun 2004 21:45:14 +0200
> I need to output a byte[] buffer from a class that has access to a
> MemoryImageSource and/or a BufferedImage. I need to be able to
> somehow convert that to a byte array to pass on to another class.
> Does anyone have an elegant way to convert from a bufferedimage (or
> MIS) to a byte array?
MemoryImageSource takes byte or int array as argument
1) if it was byte array - nothing to convert
2) convert int array to byte array is easy work
If you have BufferedImage:
3) if you have BufferedImage than use getRGB() to get int array (see p. 2)
-- http://uio.dev.java.net http://reader.imagero.com
- Next message: ak: "Re: Drag&Drop Components"
- Previous message: Roedy Green: "Re: Questionare: Which IDE you think is good one for writing Java Applet?"
- In reply to: Greg Dameron: "How to create a byte[] from a MemoryImageSource?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|