Open GoogleCodeExporter opened 9 years ago
Dear Pedro et al.,
I have made a terrible mistake in my experiments. I was comparing jMu on scale
2.0 vs jPod on scale 4.0. I am so sorry for the fuzz. I'll decided to wait time
and follow you project with great interest. If you will decide on SWT here is
the code to create a SWT image, more or less the same as for Swing:
// in PagePixelsImpl
PageRect bb = getOptions().getBoundBox();
PaletteData palette = new PaletteData(0xFF0000, 0x00FF00, 0x0000FF);
ImageData imageData = new ImageData(bb.getWidth(),bb.getHeight(),24,palette);
// byte buf
imageData.setPixels(0, 0, bb.getWidth()*bb.getHeight(),(byte[]) pixels, 0);
// int buf
imageData.setPixels(0, 0, bb.getWidth()*bb.getHeight(),(int[]) pixels, 0);
image = new Image(Display.getDefault(), imageData);
Shit happens :-)
Best, Peter
Original comment by morling....@gmail.com
on 8 May 2014 at 6:54
You code have a small error. If the pixels data are an array of bytes, then the
image data depth must be set to 8 at the maximum. The code will be:
<pre>
if (pixels instanceof byte[]) {
imageData = new ImageData(bb.getWidth(),bb.getHeight(),8,palette);
} else if (pixels instanceof int[]) {{
imageData = new ImageData(bb.getWidth(),bb.getHeight(),24,palette);
}
</pre>
Original comment by bibi.mul...@gmail.com
on 24 Oct 2014 at 6:58
Original issue reported on code.google.com by
morling....@gmail.com
on 7 May 2014 at 4:29