Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] most performant way to paint a (platform-specific) pixel-array

Hi Christoph,

That approach is generally the recommended way to paint images in SWT. Painting of a pre-created Image should be as fast as the OS allows.
Have you measured the times involved? Which phase do you need to speed up:
  1. creating ImageData,
  2. creating Image from ImageData, or
  3. painting Image?
If 1, see if you can directly manipulate the ImageData’s data, or using setPixels.
If 2, check which image format you’re using — it may not map directly to the native display, and thus be expensive to convert.
If 3, I’d be surprised, but it would be good to know details and the times for 1,2,3.

Best, Nick
On Apr 19, 2021, 5:20 AM -0400, Christoph Läubrich <laeubi@xxxxxxxxxxxxxx>, wrote:
I have a pixel-buffer and like it o be painted in the most performant
way onto a SWT Canvas.

Current approach is to convert this into an ImageData, create an image
and then paint it inside PaintListener to the GC.

Is there a way to avoid this intermediate steps? I won't mind if I need
to provide platform-specific implementations if it is possible to gain
performance here.
platform-dev mailing list
To unsubscribe from this list, visit

Back to the top