Skip to main content

[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


Inactive hide details for Fei Wang ---06/14/2014 02:39:35 AM---Hi,   Can anyone tell me how to get a third of the whole swt imaFei 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


    From:

Fei Wang <fei02.wang@xxxxxxxxxxx>

    To:

ide-dev@xxxxxxxxxxx,

    Date:

06/14/2014 02:39 AM

    Subject:

[ide-dev] Question about SWT image

    Sent by:

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

GIF image

GIF image

GIF image


Back to the top