Package org.eclipse.swt.graphics

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


                dx = w * dy / h;
                destWidth += dx;
            }
        } else {
            for( int t = 0; !isCurrentTransitionCanceled && t <= h; t += (int)(dy) ) {
                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 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 * t / h;
                for (y1 = h; y1 >= 0; y1 -= dy1) {
                    try {
                        y2 = h - y1;
                        imgc.drawImage(from, 0, (int)y1, w, (int)dy1
                                , (int)x1, (int)(y1 * heightRatio1)
                                , (int)(w - 2.0 * x1), (int) dy1);
                        imgc.drawImage(to, 0, (int)y2, w, (int)dy2
                                , (int)x2, (h-t) + (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, (int)(y1 * heightRatio1)
                                , (int)(w - 2.0 * x1), (int) dy1);
                        imgc.drawImage(to, 0, (int)y2, w, (int)dy2
                                , (int)x2, (h-t) + (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

        for( t = 0; !isCurrentTransitionCanceled && t <= alpha; t+=20 ) {
            gcBuffer.setAlpha(alpha);
            gcBuffer.fillRectangle(0, 0, w, h);
            if( null != backgroundImage ) {
                ImageData imgData = backgroundImage.getImageData();
                gcBuffer.drawImage(backgroundImage, 0, 0, imgData.width, imgData.height, 0, 0, w, h);
            }
            gcBuffer.setAlpha((int)(f));
            gcBuffer.drawImage(from, 0, 0);
            gc.drawImage(imgBuffer, 0, 0);
            f = alpha + 0.5 * a * t * t;
 
View Full Code Here

            if( null != backgroundImage ) {
                ImageData imgData = backgroundImage.getImageData();
                gcBuffer.drawImage(backgroundImage, 0, 0, imgData.width, imgData.height, 0, 0, w, h);
            }
            gcBuffer.setAlpha((int)(f));
            gcBuffer.drawImage(from, 0, 0);
            gc.drawImage(imgBuffer, 0, 0);
            f = alpha + 0.5 * a * t * t;
            doEvents();
        }
        double f0 = f;
View Full Code Here

        for( t = 0; !isCurrentTransitionCanceled && t <= alpha; t+=20 ) {
            gcBuffer.setAlpha(alpha);
            gcBuffer.fillRectangle(0, 0, w, h);
            if( null != backgroundImage ) {
                ImageData imgData = backgroundImage.getImageData();
                gcBuffer.drawImage(backgroundImage, 0, 0, imgData.width, imgData.height, 0, 0, w, h);
            }
            gcBuffer.setAlpha((int)(f));
            gcBuffer.drawImage(to, 0, 0);
            gc.drawImage(imgBuffer, 0, 0);
            f = f0 + 0.5 * a * t * t;
 
View Full Code Here

            if( null != backgroundImage ) {
                ImageData imgData = backgroundImage.getImageData();
                gcBuffer.drawImage(backgroundImage, 0, 0, imgData.width, imgData.height, 0, 0, w, h);
            }
            gcBuffer.setAlpha((int)(f));
            gcBuffer.drawImage(to, 0, 0);
            gc.drawImage(imgBuffer, 0, 0);
            f = f0 + 0.5 * a * t * t;
            doEvents();
        }
       
View Full Code Here

            // |icon| setting name (gill sans)
            // +----+ (count icons: image/text)
           
            // draw the icon
            Image icon = ImageLoader.getImage(this.getClass(), IApplicationConstants.CAMPAIGN_IMAGE_DEFAULT); // TODO: get the campaign's icon
            gc.drawImage(icon, 0, 0, icon.getBounds().width, icon.getBounds().height, event.x, event.y, cellHeight, cellHeight);
           
            // draw the campaign name
            logger.debug("draw campaign name: " + campaign.getName());
            gc.setFont(campaignNameFont);
            gc.drawString(campaign.getName(), event.x + cellHeight, event.y + campaignNameY, true);
View Full Code Here

                        yorg += (canvasArea.height - height) / 2;
                    }
                    GC newGC = new GC(buffer);
                    newGC.setBackground(canvas.getBackground());
                    newGC.fillRectangle(canvasArea);
                    newGC.drawImage(image, imageBounds.x, imageBounds.y, imageBounds.width, imageBounds.height,
                            xorg, yorg, width, height);
                    pe.gc.drawImage(buffer, 0, 0);
                    buffer.dispose();
                    newGC.dispose();
                }
View Full Code Here

        GC newGC = new GC(combinedImage);
        //Clear button to background color
        newGC.setBackground(buttonBackground);
        newGC.fillRectangle(0, 0, newWidth, height);
        //Draw supplied image on the left
        newGC.drawImage(image, 0, 0);
        //Draw arrow image on the right
        newGC.drawImage(downArrowImage, arrowPosX + IMAGE_SEPARATION, arrowPosY);
        newGC.dispose();
        return combinedImage;
    }
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.