[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ide-dev] Question about SWT image
|
This might be better of posted to the SWT lists. Basically you create a GC on the Image and use 'copyarea' to grab the part you want...
Eric
Fei Wang ---06/14/2014 02:39:35 AM---Hi, Can anyone tell me how to get a third of the whole swt image on the left? Image originalImg
![]()
| ![]()
Fei Wang <fei02.wang@xxxxxxxxxxx> |
![]()
| ![]()
ide-dev@xxxxxxxxxxx, |
![]()
| ![]()
06/14/2014 02:39 AM |
![]()
| ![]()
[ide-dev] Question about SWT image |
![]()
| ![]()
ide-dev-bounces@xxxxxxxxxxx |
Hi,
Can anyone tell me how to get a third of the whole swt image on the left?
Image originalImg = ...
int x = originalImg.getBounds().x;
int y = originalImg.getBounds().y;
int w = originalImg.getBounds().width;
int h = originalImg.getBounds().height;
Image resutlImg = getAPartOfImage(originalImg, x, y, (int)(w*(1.0/3.0)), (int)(h*(1.0/3.0)) );
Image getAPartOfImage(Image originalImg, int x, int y, int newW, int newH) {
// How to do it?
// Can anyone give me some cue
}
Thanks,
wangfei
_______________________________________________
ide-dev mailing list
ide-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ide-dev


