Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Buffer to SWT image?
Buffer to SWT image? [message #531958] Thu, 06 May 2010 15:08 Go to next message
Eclipse UserFriend
Originally posted by:

I would like to grab frames of a webcam by pressing a button. The frame
is saved in a buffer and than converted to an image. In the following
example I have to convert the buffer to an awt image first and than
convert it to an swt image to be able to display the image on a swt
canvas. Is it possible to create the swt image from buffer directly?

button2.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
FrameGrabbingControl fgc = (FrameGrabbingControl)
player.getControl(" ");

Buffer buffer = fgc.grabFrame();

BufferToImage bufferToImage = new

java.awt.Image image = bufferToImage.createImage(buffer);

imageData = convertAWTImageToSWT(image);


The convertAWTImageToSWT method can be found here ufferedimagetoSWTImageData.htm

Thomas B
Re: Buffer to SWT image? [message #532154 is a reply to message #531958] Fri, 07 May 2010 11:13 Go to previous message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
May be this snippet for showing animated gif will help you pse.swt.snippets/src/org/eclipse/swt/snippets/Snippet141.jav a

why, mr. Anderson, why, why do you persist?
Because I Choose To.
Previous Topic:Proxy type in swt.Browser
Next Topic:Fasted way to display images?
Goto Forum:

Current Time: Sun Oct 04 21:18:10 GMT 2015

Powered by FUDForum. Page generated in 0.02346 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software