Creating small images from set of images - problem with tran
2 posters
Page 1 of 1
Creating small images from set of images - problem with tran
I have method like this:
Code:
public Image getClip(int x, int y) {
Image resultImage = Image.createImage(13, 13);
Image items = MIDlet.createImage("/items.png");
resultImage.getGraphics().drawImage(items, x, y, Graphics.TOP | Graphics.LEFT);
return resultImage;
}
and transparency of background in items.png is set correctly, but when I try to create an image for example like this:
Code:
Image item1 = getClip(0, 0);
Image item2 = getClip(-15, 0);
background is white and not transparent. Can you help me? Or maybe there is no possibility to create images with transparent background from set of images and I will have to create sprites and set proper frame?
Code:
public Image getClip(int x, int y) {
Image resultImage = Image.createImage(13, 13);
Image items = MIDlet.createImage("/items.png");
resultImage.getGraphics().drawImage(items, x, y, Graphics.TOP | Graphics.LEFT);
return resultImage;
}
and transparency of background in items.png is set correctly, but when I try to create an image for example like this:
Code:
Image item1 = getClip(0, 0);
Image item2 = getClip(-15, 0);
background is white and not transparent. Can you help me? Or maybe there is no possibility to create images with transparent background from set of images and I will have to create sprites and set proper frame?
javafan- Posts : 11
Join date : 2007-09-11
Re: Creating small images from set of images - problem with tran
javafan wrote:I have method like this:
Code:
public Image getClip(int x, int y) {
Image resultImage = Image.createImage(13, 13);
Image items = MIDlet.createImage("/items.png");
resultImage.getGraphics().drawImage(items, x, y, Graphics.TOP | Graphics.LEFT);
return resultImage;
}
and transparency of background in items.png is set correctly, but when I try to create an image for example like this:
Code:
Image item1 = getClip(0, 0);
Image item2 = getClip(-15, 0);
background is white and not transparent. Can you help me? Or maybe there is no possibility to create images with transparent background from set of images and I will have to create sprites and set proper frame?
Hi friend,
As per my knowledge we cannot create a transparent image using method Image.createImage becoz in this case the graphics object is always white. Try using Image.createRGBImage as i think it work for you.
Feel free to contact me for further queries.
thanks
Nishtha.
Similar topics
» Connection problem with Motorola
» N75 problem in file accessing
» Samsung c100 KeyRelease() problem
» Loading multiple images.
» Installation problem of J2me application on iDen i730
» N75 problem in file accessing
» Samsung c100 KeyRelease() problem
» Loading multiple images.
» Installation problem of J2me application on iDen i730
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|