| Reply | « Previous Thread | Next Thread » |
|
I want to get some part of the image by cutting like i have a square on the screen and i want to cut that part of the image which i think it should be done through cliping but i dnt know how can i use it for that purpose its urgent if any one provide me some sample code its really benificial for me.
Regards, Muhammad Shouab |
|
Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
Offline
Super Contributor
|
|||
|
hi Muhammad,
#1 use Image class: Quote:
#2 use Graphics.drawRegion Quote:
use GameCanvas and LayerManager, add your original image as Sprite and then simply call "setViewWindow" to restrict area of your image that are actually drawn on screen, Quote:
regards, Peter |
| peterblazejewicz |
| View Public Profile |
| Find all posts by peterblazejewicz |
|
this isuue has been resolved you can use the following function to resolve that issue.
Code:
public Image getImageRegion(Image source, int x, int y, int width, int height){
System.out.println("x="+x);
System.out.println("y="+y);
Image results = Image.createImage(width, height);
results.getGraphics().drawImage(source, -x, -y, Graphics.LEFT | Graphics.TOP);
return results;
}
Regards, Muhammad Shouab |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Showing Part of Image from ByteArray (No Native API) | vishwas_dot_h | Mobile Java Media (Graphics & Sounds) | 5 | 2009-08-27 13:17 |
| HELP: Mutable Image to Immutable Image? | rj_cybersilver | Mobile Java Media (Graphics & Sounds) | 1 | 2005-03-26 10:58 |
| I want to Display an image as part of installation | johnward1978 | General Symbian C++ | 1 | 2004-10-19 05:02 |
| Series 40 - draw only a part of the image | ionutianasi | Mobile Java Media (Graphics & Sounds) | 11 | 2003-09-08 05:25 |
| Series 40 - image resizeing and drawing black and white only a part of an image | ionutianasi | Mobile Java Media (Graphics & Sounds) | 3 | 2003-07-21 11:36 |