We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › how to display a bufferedimage?
Page Index Toggle Pages: 1
how to display a bufferedimage?? (Read 597 times)
how to display a bufferedimage??
Jul 8th, 2008, 3:18pm
 
hi, im a newbie, im having thids silly problem...
how do i put to the screen a bufferedimage??
thankz
Re: how to display a bufferedimage??
Reply #1 - Jul 8th, 2008, 9:04pm
 
is this what you mean

PImage yourpic;
yourpic = loadImage("image.jpg");
image(yourpic, 0, 0);

Re: how to display a bufferedimage??
Reply #2 - Jul 8th, 2008, 9:13pm
 
not what im asking.
i have a bytearray of jpg data (jfif data) and i've mane a bufferedImage with it. but i want to transform it to pimage so i can display my transformations

Re: how to display a bufferedimage??
Reply #3 - Jul 8th, 2008, 9:35pm
 
all I can think of is to write out the array using saveBytes() to 'image.jpg' - and then load that back into your PImage.
Re: how to display a bufferedimage??
Reply #4 - Jul 8th, 2008, 9:46pm
 
Developer's reference :
PImage(java.awt.Image img)
Construct a new PImage from a java.awt.Image.


since java.awt.BufferedImage extends java.awt.Image, you may try something like this, assuming bimg is your java.awt.BufferedImage :

Code:
PImage img = new PImage( (java.awt.Image)bimg ); 

Re: how to display a bufferedimage??
Reply #5 - Jul 9th, 2008, 12:00am
 
thank, that was exactly what i was looking for!
Page Index Toggle Pages: 1