Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to create a byte[] from a MemoryImageSource?

Reply
Thread Tools

How to create a byte[] from a MemoryImageSource?

 
 
Greg Dameron
Guest
Posts: n/a
 
      06-01-2004
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?
Thanks!
Greg
 
Reply With Quote
 
 
 
 
ak
Guest
Posts: n/a
 
      06-02-2004
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Api to create document and add,edit,delete text and t Krithika San Ruby 3 11-14-2009 09:29 PM
How can i create new users without utilizing the create user wizar prady ASP .Net 2 12-29-2007 10:46 PM
Can I create a Create .NET 1.1 project in VS2005? JB ASP .Net 1 12-14-2007 10:53 AM
How to create python script which can create csv we file with relationship Sonu Python 1 08-03-2007 01:08 PM
problem: create element in create element Iulian Ilea Javascript 4 12-17-2006 12:00 PM



Advertisments