Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.GC.drawImage()


        imgc = new GC(tmp);
        imgc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
       
        if( toRight ) {
            for( int t = fromData.width; !isCurrentTransitionCanceled && t >= 0; t -= (int)(dx) ) {
                imgc.drawImage(im, 0, 0);
                //transformX(from, imgc, fromData.width - t, 0, t, (int)(fromData.height - destHeight), true);
                //transformX(to, imgc, 0, 0, fromData.width - t, (int)destHeight, !true);
                double x1 = 0, y1 = 0;
                double dy1 = Math.abs(destHeight) / (2.0 * w);
                double dx1 = 1;
View Full Code Here


                double dx2 = 1;
                double widthRatio2 = 1.0 * (w-t) / w;
                    for (x1 = 0; x1 <= w; x1 += dx1) {
                        try {
                            x2 = w - x1;
                            imgc.drawImage(from, (int) x1, 0, (int) dx1, h,
                                    (w-t) + (int) (x1 * widthRatio1), (int) y1, (int) dx1,
                                    (int) (h - 2.0 * y1));
                            imgc.drawImage(to, (int)x2, 0, (int)dx2, h,
                                    (int) (x2 * widthRatio2), (int) y2, (int) dx2,
                                    (int) (h - 2.0 * y2));
 
View Full Code Here

                        try {
                            x2 = w - x1;
                            imgc.drawImage(from, (int) x1, 0, (int) dx1, h,
                                    (w-t) + (int) (x1 * widthRatio1), (int) y1, (int) dx1,
                                    (int) (h - 2.0 * y1));
                            imgc.drawImage(to, (int)x2, 0, (int)dx2, h,
                                    (int) (x2 * widthRatio2), (int) y2, (int) dx2,
                                    (int) (h - 2.0 * y2));
                            y1 += dx1 * dy1 * 1.0;
                            y2 += dx2 * dy2 * 1.0;
                        } catch (Exception e) {
View Full Code Here

                dy = fromData.height * dx / fromData.width;
                destHeight += dy;
            }
        } else {
            for( int t = 0; !isCurrentTransitionCanceled && t <= fromData.width; t += (int)(dx) ) {
                imgc.drawImage(im, 0, 0);
                //transformX(from, imgc, 0, 0, fromData.width - t, (int)(fromData.height - destHeight), !true);
                //transformX(to, imgc, fromData.width - t, 0, t, (int)destHeight, true);
                double x1 = 0, y1 = 0;
                double dy1 = Math.abs(destHeight) / (2.0 * w);
                double dx1 = 1;
View Full Code Here

                double dx2 = 1;
                double widthRatio2 = 1.0 * t / w;
                for (x1 = w; x1 >= 0; x1 -= dx1) {
                    try {
                        x2 = w - x1;
                        imgc.drawImage(from, (int) x1, 0, (int) dx1, h,
                                (int) (x1 * widthRatio1), (int) y1, (int) dx1,
                                (int) (h - 2.0 * y1));
                        imgc.drawImage(to, (int) x2, 0, (int) dx2, h,
                                (w-t) + (int) (x2 * widthRatio2), (int) y2, (int) dx2,
                                (int) (h - 2.0 * y2));
 
View Full Code Here

                    try {
                        x2 = w - x1;
                        imgc.drawImage(from, (int) x1, 0, (int) dx1, h,
                                (int) (x1 * widthRatio1), (int) y1, (int) dx1,
                                (int) (h - 2.0 * y1));
                        imgc.drawImage(to, (int) x2, 0, (int) dx2, h,
                                (w-t) + (int) (x2 * widthRatio2), (int) y2, (int) dx2,
                                (int) (h - 2.0 * y2));
                        y1 += dx1 * dy1 * 1.0;
                        y2 += dx2 * dy2 * 1.0;
                    } catch(Exception e) {
View Full Code Here

        GC imgc = new GC(im);
        imgc.setBackground(backgroundColor);
        imgc.fillRectangle(0, 0, fromData.width, fromData.height);
        if( null != backgroundImage ) {
            ImageData imgData = backgroundImage.getImageData();
            imgc.drawImage(backgroundImage, 0, 0, imgData.width, imgData.height, 0, 0, w, h);
        }
        imgc.dispose();
       
        Image tmp = new Image(Display.getCurrent(), fromData.width, fromData.height);
        imgc = new GC(tmp);
View Full Code Here

        Image tmp = new Image(Display.getCurrent(), fromData.width, fromData.height);
        imgc = new GC(tmp);
       
        if( toRight ) {
            for( int t = h; !isCurrentTransitionCanceled && t >= 0; t -= (int)(dy) ) {
                imgc.drawImage(im, 0, 0);
                //transformX(from, imgc, fromData.height - t, 0, t, (int)(fromData.width - destWidth), true);
                //transformX(to, imgc, 0, 0, fromData.height - t, (int)destWidth, !true);
                double y1 = 0, x1 = 0;
                double dx1 = Math.abs(destWidth) / (2.0 * h);
                double dy1 = 1;
View Full Code Here

                double dy2 = 1;
                double heightRatio2 = 1.0 * (h-t) / h;
                    for (y1 = 0; y1 <= h; y1 += dy1) {
                        try {
                            y2 = h - y1;
                            imgc.drawImage(from, 0, (int)y1, w, (int)dy1
                                    , (int)x1, (h-t) + (int) (y1 * heightRatio1)
                                    , (int)(w - 2.0 * x1), (int)dy1);
                            imgc.drawImage(to, 0, (int)y2, w, (int)dy2
                                    , (int)x2, (int)(y2 * heightRatio2)
                                    , (int)(w - 2.0 * x2), (int)dy2);
View Full Code Here

                        try {
                            y2 = h - y1;
                            imgc.drawImage(from, 0, (int)y1, w, (int)dy1
                                    , (int)x1, (h-t) + (int) (y1 * heightRatio1)
                                    , (int)(w - 2.0 * x1), (int)dy1);
                            imgc.drawImage(to, 0, (int)y2, w, (int)dy2
                                    , (int)x2, (int)(y2 * heightRatio2)
                                    , (int)(w - 2.0 * x2), (int)dy2);
                            x1 += dy1 * dx1 * 1.0;
                            x2 += dy2 * dx2 * 1.0;
                        } catch (Exception e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.