Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ide-dev] Question about SWT image

Title: Samsung Enterprise Portal mySingle

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

 

 


Back to the top