How do i display the full image that is larger in size than the device display's size?
Printable View
How do i display the full image that is larger in size than the device display's size?
[QUOTE=fecxelmin;728171]How do i display the full image that is larger in size than the device display's size?[/QUOTE]
You can scroll that on the key events!!!
Or you can scale down the image so that it fits the screen resolution.
You can refer to the below link.
[url]http://wiki.forum.nokia.com/index.php/CS001269_-_Scaling_bitmaps_in_Java_ME[/url]
Place it on a Form, as an ImageItem, and you can see it scrolling thu.
or scale down - resize the image to match yiur screen size and display full.
[php]
private Image createThumbnail(Image image) {
int sourceWidth = image.getWidth();
int sourceHeight = image.getHeight();
int thumbWidth = 64; // put the target screen width
int thumbHeight = -1;
if (thumbHeight == -1)
thumbHeight = thumbWidth * sourceHeight / sourceWidth;
Image thumb = Image.createImage(thumbWidth, thumbHeight);
Graphics g = thumb.getGraphics();
for (int y = 0; y < thumbHeight; y++) {
for (int x = 0; x < thumbWidth; x++) {
g.setClip(x, y, 1, 1);
int dx = x * sourceWidth / thumbWidth;
int dy = y * sourceHeight / thumbHeight;
g.drawImage(image, x - dx, y - dy, Graphics.LEFT | Graphics.TOP);
}
}
[/php]
thanks,
~Amitabh