Package com.sun.dtv.lwuit

Examples of com.sun.dtv.lwuit.RGBImage


            if(getSource().getParent() != null){
                getSource().getComponentForm().paintComponent(g);
            }
            //getSource().paintBackgrounds(g);
            paint(g, getDestination(), 0, 0);
            rgbBuffer = new RGBImage(buffer.getRGB(), buffer.getWidth(), buffer.getHeight());
           
            paint(g, getSource(), 0, 0);
            g.translate(source.getAbsoluteX(), source.getAbsoluteY());
           
        } else {
View Full Code Here


                    for(int iter = 0 ; iter < rgb.length ; iter++) {
                        if(rgb[iter] == transColor) {
                            imageRGB[iter] = 0;
                        }
                    }
                    g.drawImage(new RGBImage(imageRGB, width, height), x, y);
                } else {
                    int foreground = g.getColor();
                    if(c.hasFocus()) {
                        g.setColor(s.getBgSelectionColor());
                    } else {
                        g.setColor(s.getBgColor());
                    }

                    // Its opaque much easier job!
                    if(s.getBgTransparency() == ((byte)0xff)) {
                        g.fillRoundRect(x, y , width, height, arcWidth, arcHeight);
                    } else {
                        // if its transparent we don't need to do anything, if its
                        // translucent... well....
                        if(s.getBgTransparency() != 0) {
                            Image i = Image.createImage(width, height);
                            int[] imageRgb;
                            if(g.getColor() != 0xffffff) {
                                Graphics imageG = i.getGraphics();
                                imageG.setColor(g.getColor());
                                imageG.fillRoundRect(0, 0 , width, height, arcWidth, arcHeight);
                                imageRgb = i.getRGB();
                            } else {
                                // background color is white we need to remove a different color
                                // black is the only other "reliable" color on the device
                                Graphics imageG = i.getGraphics();
                                imageG.setColor(0);
                                imageG.fillRect(0, 0, width, height);
                                imageG.setColor(g.getColor());
                                imageG.fillRoundRect(0, 0 , width, height, arcWidth, arcHeight);
                                imageRgb = i.getRGB();
                            }
                            int removeColor = imageRgb[0];
                            int size = width * height;
                            int alphaInt = ((s.getBgTransparency() & 0xff) << 24) & 0xff000000;
                            for(int iter = 0 ; iter < size ; iter++) {
                                if(removeColor == imageRgb[iter]) {
                                        imageRgb[iter] = 0;
                                        continue;
                                }
                                if((imageRgb[iter] & 0xff000000) != 0) {
                                    imageRgb[iter] = (imageRgb[iter] & 0xffffff) | alphaInt;
                                }  
                            }
                            g.drawImage(new RGBImage(imageRgb, width, height), x, y);
                        }
                    }
                   
                    g.setColor(foreground);
                }
View Full Code Here

        int w = source.getWidth();
        int h = source.getHeight();
        int mirrorHeight = h  / 2 * w;
       
        // create an array big enough to hold the mirror data
        RGBImage rgbImg = new RGBImage(new int[w * h + mirrorHeight], w, h + h / 2);
        source.toRGB(rgbImg, 0, 0, 0, 0, w, h);
        int[] imageData = rgbImg.getRGB();
       
        for(int iter = 0 ; iter < mirrorHeight ; iter++) {
            int sourcePos = w * h - iter - 1;
            int off = iter % w;
            off = w - off + iter - off;
View Full Code Here

TOP

Related Classes of com.sun.dtv.lwuit.RGBImage

Copyright © 2018 www.massapicom. 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.