[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.newcomer] SWT Image
|
- From: luke2000@xxxxxx (Ludwig Moser)
- Date: Wed, 18 Mar 2009 14:53:28 +0000 (UTC)
- Newsgroups: eclipse.newcomer
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
hello ng,
i am trying to modify an image and print it on my canvas after doing this.
so what i got now is simple copy of content from image 'originalImage' to
image 'manipulatedImage',
then draw image 'manipulatedImage' to canvas
private Image originalImage;
private Image manipulatedImage;
in my paintControl i am doing this:
// create array to fit all pixels
int[] pixels = new int[width*height];
// read content of the originalImage into pixels[]
originalImage.getImageData().getPixels(0, 0, pixels.length, pixels, 0);
// write content of pixels[] to the manipulatedImage
manipulatedImage.getImageData().setPixels(0, 0, pixels.length, pixels, 0);
// draw the manipulatedImage
e.gc.drawImage(manipulatedImage, 0, 0);
all fine till this ^^ as the image does not get drawed
note: if i write
e.gc.drawImage(originalImage, 0, 0);
the original image is drawn correct!
any ideas what i am doing wrong?
thanks in advance