Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsFrequent update of image
https://www.eclipse.org/forums/index.php/mv/msg/153962/484895/#msg_484895
I need to update parts of an image rather frequent. The image updates are generated with input from a 3rd party
hardware.
The update frequency might be as high as 30 times per seconds and the upate area is approx 400 x 500 pixels
We have managed to do this with native c++ code using a graphical open source lib, but we want to move this into
Eclipse.
So my question is basiclly how to do this with SWT? Separate thread for update, doing this with a native DLL etc.
// Markus]]>Markus2009-09-09T15:59:16-00:00Re: Frequent update of image
https://www.eclipse.org/forums/index.php/mv/msg/153962/485418/#msg_485418
The typical way to do this is shown in http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet275.java?view=co .
To make it a bit more applicable to your case:
- change the INTERVAL to a value like 33
- change the Canvas style from SWT.NONE to SWT.NO_BACKGROUND
- change canvas.redraw()'s bounds from extent.x, extent.y to 400, 500
This should give you a quick way to determine if this approach will be able
to keep up with your incoming image changes or not. If not then please
follow up here and I can look a bit further into alternatives. Writing some
native code could give increased performance, but I haven't heard of others
doing this before. There could be swt/OS interaction problems with this
approach since swt assumes that you aren't using its native handles for
other things behind its back.
HTH,
Grant
"Markus" <markusm@hangso.edu> wrote in message
news:h88jcl$29b$1@build.eclipse.org...
> Hi all,
>
> I need to update parts of an image rather frequent. The image updates are
generated with input from a 3rd party
> hardware.
> The update frequency might be as high as 30 times per seconds and the
upate area is approx 400 x 500 pixels
>
> We have managed to do this with native c++ code using a graphical open
source lib, but we want to move this into
> Eclipse.
> So my question is basiclly how to do this with SWT? Separate thread for
update, doing this with a native DLL etc.
>
>
> // Markus
>
>
>]]>Grant Gayed2009-09-11T16:48:59-00:00