Clear BufferedImage

I have a background and foreground buffered image, both of which are modified through graphics objects, via getGraphics. The problem is, when I paint the two BufferedImages, the second one covers up the first. How do I make the second buffered image be completely transparent where there are no objects drawn, like an overlay. I must keep it as a bufferedimage, though, so using swing components won't help. I also don't know what's being drawn on the second buffered image, so I can't just draw the stuff directly onto the first buffer. Right now when draw both images, it draws the first buffered image, then covers it in grey and shows whatever's in the second buffered image, as if I had set the background to grey. Any help is much wanted, and thanks in advance for replies.

Any answers at all are appreciated.

Similar Messages

  • Help really needed in rotating a bufferedImage

    Its so silly, but i've been trying to get this for more than a week now and i cant get it to work.
    I have a gravity simulator and i want to rotate an image of a small ship. Just to mention it.. i have one thread that does the physics. I want to do two things: move and rotate (i always get the move method working, but not the rotate one)
    I have a class Nave (ship in spanish) and Graficador (the jpanel that paints everything). I want to say that ive tried really ALOT of things (yes, ive read google, the forums... i just like to ask for help when i really need it).
    So: here's what i've tried:
    -Ive tried to have a general affineTransform in Nave, then, when i call for example rotate, i just modify the AffineTransform and then use it to paint in the Jpanel. Something like this:
    In Nave
    public void rotarDer(){
            this.at.rotate(Math.PI/2,this.info.getPosX()+5,this.info.getPosY()+5);
        }And in the Jpanel:
    if(this.nave.at!=null){
                g2.drawImage(this.nave.imagen,this.nave.at,null);
            }Ive also tried to use drawRenderedImage with the AffineTransform, but the result are the same: the coordinate system changes (i think because of the AffineTransform) so the gravity takes the ship to the right instead of making it fall down. Ive tried to "store" the affineTransform before any change, and then reapply it after drawing the image, but doesnt seem to work either.
    Also, with this approach, ive tried to create a "buffer" in Nave, then paint the image in the buffer with the affineTransform, and finally paint this buffer in the jpanel, but it gets messed up anyway.
    Ive tried many approaches, but i think i will just mention this one, and see if with your help i get this one to work... i just need to make the coordinates "right" after drawing the image in the jpanel so the gravity works well...

    It wasn't clear how you were trying to use AffineTransform other than rotation in a
    gravitational field. To avoid altering the coordinate system orientation try making a
    transform for each rendering of an image by moving the image to the location where you
    want to show it and then rotatng the image about the specific point in/on the image that
    will give the desired final location/orientation. This sounds vague because there are
    multiple ways to see/do this. Here's an example of one way:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    public class RotationExample extends JPanel {
        BufferedImage image;
        Point[] points;
        RotationExample() {
            makeImage();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            if(points == null) initPoints();
            markPointGrid(g2);
            // Center image over points[0] and rotate 45 degrees.
            int cx = image.getWidth()/2;
            int cy = image.getHeight()/2;
            double theta = Math.PI/4;
            double x = points[0].x - cx;
            double y = points[0].y - cy;
            AffineTransform at = AffineTransform.getTranslateInstance(x, y);
            at.rotate(theta, cx, cy);
            g2.drawRenderedImage(image, at);
            // Center image over points[1] and rotate 135 degrees.
            x = points[1].x - cx;
            y = points[1].y - cy;
            theta = Math.PI*3/4;
            at.setToTranslation(x, y);
            at.rotate(theta, cx, cy);
            g2.drawRenderedImage(image, at);
            // Move tail over points[2] and rotate 180 degrees.
            x = points[2].x;
            y = points[2].y - cy;
            theta = Math.PI;
            at.setToTranslation(x, y);
            at.rotate(theta, 0, cy);
            g2.drawRenderedImage(image, at);
            // Mark points.
            g2.setPaint(Color.cyan);
            for(int j = 0; j < points.length; j++)
                g2.fillOval(points[j].x-2, points[j].y-2, 4, 4);
        private void markPointGrid(Graphics2D g2) {
            int w = getWidth(), h = getHeight();
            g2.setPaint(new Color(220, 230, 240));
            for(int j = 0; j < points.length; j++) {
                g2.drawLine(points[j].x, 0, points[j].x, h);
                g2.drawLine(0, points[j].y, w, points[j].y);
        private void makeImage() {
            int w = 75, h = 45, type = BufferedImage.TYPE_INT_RGB;
            image = new BufferedImage(w, h, type);
            Graphics2D g2 = image.createGraphics();
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setStroke(new BasicStroke(4f));
            g2.setBackground(getBackground());
            g2.clearRect(0,0,w,h);
            g2.setPaint(Color.red);
            g2.drawLine(w, h/2, w-30, 0);
            g2.drawLine(w, h/2, w-30, h);
            g2.setPaint(Color.blue);
            g2.drawLine(0, h/2, w, h/2);
            g2.dispose();
        private void initPoints() {
            int w = getWidth();
            int h = getHeight();
            points = new Point[3];
            for(int j = 0; j < points.length; j++) {
                points[j] = new Point((j+1)*w/4, (j+1)*h/4);
        public static void main(String[] args) {
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new RotationExample());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    }

  • BufferedImage from PNG : Alpha Channel disregaurded

    I'm trying to load a PNG with an alpha channel into a BufferedImage, and
    then sample the BufferedImage at various pixels for some operations.
    However, the alpha channel seems to get lost upon creation of the BufferedImage.
    For example, I'm using a PNG that is 100% transparent, and when I
    load it into a BufferedImage and display it on a panel all I see is the panel's background color.
    So far so good. Now, the problem. When I try to sample a pixel, the alpha is always 255 or 100% opaque
    which is clearly not right. Also, when I print out the BufferedImage's type, I get 0 which means the image
    type is "Custom". Care to shed any light as to how I can accurately sample an image with an alpha channel?
    import javax.swing.*;
    import java.awt.*;
    import java.io.*;
    import javax.imageio.*;
    import java.awt.image.*;
    public class PNGTest extends JFrame {
        public PNGTest() {
            setLocation(500,500);
            BufferedImage img = new BufferedImage(640,480,BufferedImage.TYPE_INT_RGB);
            try {
                img = ImageIO.read(new File("C:/folder/folder/myPNG.png"));
            } catch (Exception e) {
            setSize(img.getWidth(), img.getHeight());
            getContentPane().setBackground(Color.white);
            getContentPane().add(new JLabel(new ImageIcon(img)));
            setVisible(true);
            //Sample top left pixel of image and pass it to a new color
            Color color = new Color(img.getRGB(0,0));
            //print the alpha of the color
            System.out.println(color.getAlpha());
            //print the type of the bufferedimage
            System.out.println(img.getType());
        public static void main(String[] args) {
            new PNGTest();
    }Edited by: robbie.26 on May 20, 2010 4:26 PM
    Edited by: robbie.26 on May 20, 2010 4:26 PM
    Edited by: robbie.26 on May 20, 2010 4:29 PM

    Here ya go robbie, ti seems to work for the rest of the world, but not for you:
    import java.awt.*;
    import java.awt.image.*;
    import java.net.URL;
    import javax.swing.*;
    import javax.imageio.*;
    public class JTransPix{
      JTransPix(){
        JFrame f = new JFrame("Forum Junk");
        JPanel p = new MyJPanel();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.add(p);
        f.pack();
        f.setVisible(true);
      public static void main(String[] args) {
        new JTransPix();
      class MyJPanel extends JPanel{
        BufferedImage bi = null;
        MyJPanel(){
          try{
            bi = ImageIO.read(new URL("http://upload.wikimedia.org/wikipedia/commons/archive/4/47/20100130232511!PNG_transparency_demonstration_1.png"));  //here ya go--one liner
            this.setPreferredSize(new Dimension(bi.getWidth(), bi.getHeight()));
          }catch(java.io.IOException e){
            System.out.println(e.toString());
        public void paintComponent(Graphics g){
          super.paintComponent(g);
          g.setColor(Color.BLUE);
          g.fillRect(0, 0, bi.getWidth(), bi.getHeight());
          g.drawImage(bi,0, 0, this);
    }Please notice how the BufferedImage is declared and set to NULL, then allow ImageIO to set the type--Just as I said before. If you have any question about the PNG producing an ARGB image with ImageIO, then change the color painted onto the backgroun din the paintComponent to what ever you want and you'll see it show through.
    BTW: even in the short nobrainers--you still need to have VALID CATCH BLOCKS.
    To get what you are looking for, you can mask off the Alpha component by dividing each getRGB by 16777216 (256^3) or do a binary shift right 24 places.

  • Obtaining BufferedImage from Graphics

    hello
    I want to send an image I have in Graphics object over a socket. To do that I need to have BufferedImage but I do not know how to create one having only Graphics object.
    Can any one tall me how to do that ?
    lary

    I'm writing a chat where users can send text and images to each other. I've already dealed with sending text and now I have to deal with sending pictures.
    This is a part of the class for drawing and sending pictures:
    public class WhiteBoard extends javax.swing.JDialog {
        Point p;
        int offx, offy;
        Graphics2D G;
        BufferedImage bi;
        Client cli;
        /** Creates new form WhiteBoard */
        public WhiteBoard(java.awt.Frame parent, boolean modal) {
            super(parent, modal);
            initComponents();
            setSize(400, 500);
            bi = new BufferedImage(400, 400,
                    BufferedImage.TYPE_3BYTE_BGR);
            G = bi.createGraphics();
            G.setColor(Color.BLACK);
        //invoked when mouse pressed
        private void jPanel1MousePressed(java.awt.event.MouseEvent evt) {                                    
            p = evt.getPoint();
       //this one is invoked when mouse is dragged
        private void jPanel1MouseDragged(java.awt.event.MouseEvent evt) {                                    
            Point p0 = evt.getPoint();
            G.drawLine(p0.x, p0.y, p.x, p.y);
            jPanel1.getGraphics().drawLine(p0.x, p0.y, p.x, p.y);
            p = p0;
        //invoked when button "send" is clicked
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            cli.sendPicture(bi);
        //invoked when button "clear" is clicked
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            bi = new BufferedImage(400, 400,
                    BufferedImage.TYPE_3BYTE_BGR);
            G = bi.createGraphics();
            G.setColor(Color.BLACK);
            repaint();
        }                         

  • Clearing Buffered Canvas

    Hi,
    I've searched in google, on this forum and on JavaRanch Big Moose Saloon for the answer to this question but as of yet I can't find an answer.
    I'm attempting to clear a JPanel canvas. Repaint() simply doesn't work so I've tried this,
    public void clearImage()
    Rectangle d = canvas.getBounds();                               //get canvas dimension
    BufferedImage bi = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_RGB);  //create new buffered image of canvas
    Graphics2D g = bi.createGraphics();  //get canvas objects
    g.setColor(Color.white);  //set colour to white
    g.drawRect(10, 160, 210, 70);   //draw rectangle over buffered image.
    }Although the code compiles fine, when I run this method, nothing happens. There are no errors throw. Simply nothing happens. I've also attempted the following code;
    public void clearImage()
    g = jPanel1.getGraphics();
    g.setColor(Color.white);
    g.fillRect(10, 160, 210, 70);
    }which although it does cover the canvas with a white rectangle, once I click in the rectangle again, it removes it, and shows what was previously drawn in it.
    If i try g = canvas.getGraphics(); on the top line, nothing happens again.
    Any step in the right direction or an explanation of why the top method wont work would be appreciated greatly.
    Thanks
    N

    Thankyou very much for the replies, they have helped out in understanding why the methods won't work.
    However, I am still stuck on this. I thought that g.drawImage(bi, 0, 0, this); would draw the buffered image, yet nothing happens again.
    At this point I'm getting really confused with images and graphics g and buffered images.
    Here is my code so you can see how wrong I am going....
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    public class DrawPad extends JFrame implements ActionListener {
       private OutputScreen canvas;
       private javax.swing.JTextField barcode;
       private javax.swing.JButton exit;
       private javax.swing.JButton clearBarcode;
       private javax.swing.JButton clearCanvas;
       private javax.swing.JLabel jLabel1;
       private javax.swing.JLabel jLabel2;
       private javax.swing.JLabel jLabel3;
       private javax.swing.JPanel jPanel1;
       private javax.swing.JButton save;
       public DrawPad() {
         jPanel1 = new javax.swing.JPanel();
            barcode = new javax.swing.JTextField();
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            exit = new javax.swing.JButton();
         canvas = new OutputScreen(Color.black);
         clearCanvas = new javax.swing.JButton();
         clearCanvas.addActionListener(new java.awt.event.ActionListener()
            public void actionPerformed(java.awt.event.ActionEvent e)
                clearImage();
         clearBarcode = new javax.swing.JButton();
         clearBarcode.addActionListener(new java.awt.event.ActionListener()
            public void actionPerformed(java.awt.event.ActionEvent e)
                 barcode.setText("");
            setDefaultCloseOperation(EXIT_ON_CLOSE);
         jPanel1.setLayout(null);
         getContentPane().add(jPanel1);
         canvas.setLayout(null);
         canvas.setBackground(new java.awt.Color(255, 255, 255));
            canvas.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0)));
            jPanel1.add(canvas);
            canvas.setBounds(10, 160, 210, 70);
            jPanel1.add(barcode);
            barcode.setBounds(20, 70, 180, 50);
            jLabel1.setText("Scan Package");
            jPanel1.add(jLabel1);
            jLabel1.setBounds(20, 40, 180, 20);
            jLabel2.setText("Sign Here Please");
            jPanel1.add(jLabel2);
            jLabel2.setBounds(10, 140, 210, 20);
            save.setText("Save");
            jPanel1.add(save);
            save.setBounds(70, 240, 59, 25);
                exit.setIcon(new javax.swing.ImageIcon("windows\\start menu\\programs\\CrE-ME\\images\\redbutton.gif"));
            exit.setBorder(null);
            exit.setOpaque(false);
            jPanel1.add(exit);
            exit.setBounds(160, 10, 25, 25);
         clearBarcode.setText("Clear");
         jPanel1.add(clearBarcode);
         clearBarcode.setBounds(160, 120, 59, 25);
         clearCanvas.setText("Clear");
         jPanel1.add(clearCanvas);
         clearCanvas.setBounds(150, 230, 59, 25);
            //jPanel1.add(jLabel3);
            //jLabel3.setBounds(0, -5, 240, 280);
            getContentPane().add(jPanel1);
            jPanel1.setBounds(0, 0, 277, 344);
         addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowClosing(java.awt.event.WindowEvent evt) {
                    //exitForm(evt);
         this.setSize(new Dimension(240, 300));
         setVisible(true);
       ///////Method I am having problems with ////////////////////////////////////
       public void clearImage()
                   Rectangle d = canvas.getBounds();                              
                   BufferedImage bi = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_RGB); 
                   Graphics g = bi.createGraphics();
                   g.setColor(Color.white); 
                   g.drawRect(10, 160, 210, 70); 
                   g.drawImage(bi, 0, 0, this);
         public void actionPerformed(ActionEvent e) {
          String s = e.getActionCommand();
       public static void main(String[] args) {
          new DrawPad().setVisible(true);
    class OutputScreen extends JPanel {
       private BufferedImage buf;
       private Color currentColor;
       private Graphics2D g2;
       private Point lastPoint;
       public OutputScreen(Color initialColor) {
          setPreferredSize(new Dimension(240, 300));
          buf = new BufferedImage(240, 300, BufferedImage.TYPE_INT_RGB);
          g2 = buf.createGraphics();
          g2.setColor(Color.white);
          g2.fillRect(0, 0, 240, 300);
          g2.setColor(initialColor); 
          addMouseListener(new MouseAdapter()
    public void mousePressed(MouseEvent e) {
                moveto(e.getPoint());  // Move to click position
                requestFocus();        // Take keyboard focus
          addMouseMotionListener(new MouseMotionAdapter() {
             public void mouseDragged(MouseEvent e) {
                Point p = e.getPoint();
                lineto(p); // Draw to mouse position
                moveto(p);
       public void setColor(Color c){
          g2.setColor(c);
       public void paintComponent(Graphics g){
          super.paintComponent(g);
          g.drawImage(buf, 0, 0,this);
       private void moveto(Point pt){
          lastPoint = pt;
       private void lineto(Point pt){
          g2.drawLine(lastPoint.x, lastPoint.y, pt.x, pt.y);
          repaint();
    }Again thankyou for the replies you have already given, I really appreciate them.
    Wishing everyone a Happy New Year!
    N

  • Trying to Load a BufferedImage from a PNG through JNI

    Yes I realize that I can load it directly through Java and not go through JNI, but I need this to test correctly as my C code will aquire images without saving to Disk and I want Java code to manipulate the images without saving to disk. The image Im trying to load is a 800x600 PNG image.
    So I have the code
    import java.io.ByteArrayInputStream;
    import java.io.File;
    import java.io.IOException;
    import java.io.InputStream;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import com.sun.media.jai.widget.DisplayJAI;
    class ImageLoader{
         static{
              System.loadLibrary("LoadImage");
         private static native byte[] loadImage();
         public static void main(String[] args){
    byte[] f = loadImage();
              InputStream s= new ByteArrayInputStream(f);
              BufferedImage bi;
              try {
                   bi = ImageIO.read(s);
                   displayBufferedImage(bi, "test");
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
          * Utility method for display a BufferedImage.<br>
          * @param  image input image
          * @param  title window title string
         public static void displayBufferedImage(BufferedImage image, String title)
              JFrame frame = new JFrame();
             frame.setTitle(title);
             //frame.getContentPane().add(new DisplayTwoSynchronizedImages(sourceImgBI, resultImgGray));
             frame.getContentPane().add(new JScrollPane(new DisplayJAI(image)));
             //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             //frame.pack();
             frame.setSize(300,300);
             frame.setLocationRelativeTo( null );
             frame.setVisible(true); // show the frame.
         }and I have the JNI c code as
    char* result;
    JNIEXPORT jbyteArray JNICALL Java_ImageLoader_loadImage
      (JNIEnv * env, jclass jclassj){
                   int fd = open("test.png",  O_RDWR, S_IRUSR|S_IWUSR );
                   int size = (800*600*4);
                   result = (char*)malloc(size);
                   read(fd, result, size);
                   jbyteArray return_result;
                   return_result = env->NewByteArray(800*600);
                   env->SetByteArrayRegion(return_result, 0, 800*600, (jbyte*)result);
                   //free(result);
                   return return_result;
         }but when I try to run the code I get the following error
    javax.imageio.IIOException: Error reading PNG image data
         at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1287)
         at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1552)
         at javax.imageio.ImageIO.read(ImageIO.java:1438)
         at javax.imageio.ImageIO.read(ImageIO.java:1342)
         at ImageLoader.main(ImageLoader.java:31)
    Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
         at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
         at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
         at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
         at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
         at java.io.DataInputStream.readFully(DataInputStream.java:195)
         at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1084)
         at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1188)
         at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1280)
         ... 4 moreI think that Im on the right track because Java is recognizing that this is a PNG image, but Im not sure whats wrong. I don't know much about the formats, so I know nothing about PNG's, maybe someone else can help me here.
    Note: I ran the code
                   BufferedImage bi2 = ImageIO.read(new File("test.png"));
                   displayBufferedImage(bi2, "test2");and the image loads fine, so there is no issue with the image itself.

                   int fd = open("test.png", O_RDWR, S_IRUSR|S_IWUSR );Why are you opening the image file read/write? Why not read-only?
                   int size = (800*600*4);Here you're assuming the image is 800*600. Are you sure that's the case? Also you should write sizeof int here instead of 4.
                   result = (char*)malloc(size);Here you aren't checking for the possibility that result is null.
                   read(fd, result, size);Here you are ignoring the result returned by read(), so you are ignoring the possibilty that it was 0 or less than 'size'. Either are possible.
                   jbyteArray return_result;
                   return_result = env->NewByteArray(800*600);Here again you aren't testing for return_result == null.
                   env->SetByteArrayRegion(return_result, 0, 800*600, (jbyte*)result);Here you should be checking for Java exceptions. Also you shouldn't be repeating the 800*600 here, make it a constant or a variable somewhere.
                   //free(result);You need that free, otherwise you have a memory leak. If the image really is a constant 800*600 in size I would allocate 'result' on the stack so you don't need to housekeep it.
    Also you are never closing the input file!
    Caused by: java.io.EOFException: Unexpected end of ZLIB input streamSo clearly you didn't read all the image. That could be due to guessing wrong about 800*600 or getting a short read when reading the file.
    I think that Im on the right track because Java is recognizing that this is a PNG imageI agree. It starts like a PNG image, so you read something, but it doesn't end like one, so you didn't read it all.> and the image loads fine, so there is no issue with the image itself.
    Good test. Note that your Java code makes no assumption about the size of the image.

  • Convert BufferedImage to FormFile or BinaryContent

    To convert formfile data into buffered image,i have used the followimg,
    private BufferedImage bufferedImage;
         public BufferedImage getBufferedImage(FormFile image) throws IOException {
         if ((image != null) && (bufferedImage == null)) {
         // load file from disk using Sun's JPEGIMageDecoder
         InputStream in = image.getInputStream();
         JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(in);
         bufferedImage = decoder.decodeAsBufferedImage();
         in.close();
         return bufferedImage;
    The above code is used to pass a BuuferedImage parameter to a method which is used to resize an image to thumb size.
    To convert this data again into FormFile or into Binary Contentdata what should be done?

    To be quite clear....
    You are attempting to create java code which will then be run in a database, via a database VM, as a stored procedure.
    1. Get the code to run in a regular VM first.
    2. Determine, without using the image code, what happens to exceptions for java stored procedures.
    3. Modify your code so it does not eat exceptions.
    4. Without using your image code determine how to return an image blob using a java stored proc to something (java probably) and determine that the correct image is returned.
    Notice in the above that there are serveral places where you will NOT being using the image code that you want finally. You are doing that to learn the correct way to do each.
    Finally after everything works combine them with your actual image code.

  • Create a clear button that will clear a jpanel

    so i have two classes. One being a frame, and the other being a panel.
    On the panel, i can draw various shapes with various colours etc. The frame contains the panel, and also a north panel containing various buttons to achieve this.
    What i would i need to do is create a clear button that will clear the panel.
    I know i can go and set it so it's draws a rectangle the same colour as the background but that would be cheating.
    I will post a section of the paint just so you get an idea.
        public void paintComponent(Graphics gPanel) {
            if (this.buffer == null) {
                Dimension d = getSize();
                this.buffer = new BufferedImage(d.width, d.height,
                        BufferedImage.TYPE_INT_ARGB_PRE);
                myLineColour = new Color(0, 255, 0);     // initial colour for drawing
                this.g2Buffer = (Graphics2D) this.buffer.getGraphics();
                this.g2Buffer.setColor(Color.white);
                this.g2Buffer.fillRect(0, 0, d.width, d.height);
                // This time we'll draw with a broad pen 
            g2Buffer.setStroke(new BasicStroke(myLineWidth));
            if (myShapeFlag == 1){{
                this.g2Buffer.setColor(Color.white);
                g2Buffer.setXORMode(myLineColour); //go into the overwrite mode
                g2Buffer.drawLine(xStart, yStart, xOld, yOld); // undraw last
                g2Buffer.drawLine(xStart, yStart, xEnd, yEnd);     // draw new
                g2Buffer.setPaintMode();          // out of XOR overwrite mode
                xOld = xEnd;                    // store last end point
                yOld = yEnd;
            if(mouseReleased) {          // final time through
                g2Buffer.setColor(myLineColour);
                g2Buffer.drawLine(xStart, yStart, xEnd, yEnd);     // draw final
                mouseReleased = false;
            gPanel.drawImage(this.buffer, 0, 0, this); }Any help on this would be much appreciated

    no idea how to do this.. sorry...
    for the jbutton action listenener i'm not sure.
    I think i'm on the right tracks with a method
        public void clearPanel(Graphics gPanel){
                g2Buffer.fillRect(100,100,100,100);     // draw final
                gPanel.drawImage(this.buffer, 0, 0, this);
    }but again i think i'm way off the mark..

  • Scaling up and down BufferedImages by percent?

    Hi, I have a BufferedImage and I would like to know the exact syntax to scale up and down an image by percentage. Basically I want to scale the BufferedImage by a specific percentage like scale down to 50% or scale up to 150%. Anyone know any methods to do so? If I can use a specific library then which library can I use and how to use it(clear syntax like: profileImage.scale(50);)
    I read an image using the following:
    BufferedImage profileImage = ImageIO.read (new File ("Image.bmp"));And I would appreciate if the libraries imported are posted too. Thanks
    Edited by: Taufiq on Feb 26, 2008 2:54 PM

    Demo:
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class ImageResizingExample {
        public static void main(String[] args) throws IOException {
            URL url = new URL("http://blogs.sun.com/jag/resource/JagHeadshot-small.jpg");
            BufferedImage image = ImageIO.read(url);
            if (image == null) throw new NullPointerException();
            Image smaller = scaledInstance(image, 0.5);
            BufferedImage blurry = rescaled(image, AffineTransformOp.TYPE_NEAREST_NEIGHBOR, 1.5);
            BufferedImage better = rescaled(image, AffineTransformOp.TYPE_BICUBIC, 1.5);
            display(image, smaller, blurry, better);
        static Image scaledInstance(BufferedImage im, double factor) {
            int w = (int) (im.getWidth() * factor);
            int h = (int) (im.getHeight() * factor);
            return im.getScaledInstance(w, h, Image.SCALE_AREA_AVERAGING);
        static BufferedImage rescaled(BufferedImage im, int hint, double factor) {
            AffineTransform xform =  AffineTransform.getScaleInstance(factor, factor);
            return new AffineTransformOp(xform, hint).filter(im, null);
        static void display(final Image... images) {
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    JPanel cp = new JPanel(new GridLayout(0,2, 5, 5));
                    for(Image image : images) {
                        cp.add(new JLabel(new ImageIcon(image)));
                    JFrame f = new JFrame("ImageResizingExample");
                    f.setContentPane(cp);
                    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    f.pack();
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }

  • Re-editing a BufferedImage

    Hello,
    I am creating a program that uses buffered images with part of the image transparent and part of it solid.
    What I need to do, is define an image with solid and transparent areas and then later, re-edit the image so that I can define new transparent and solid areas.
    Here is what I am trying to do.
    BufferedImage bi = new BufferedImage(100,100,BufferedImage.TYPE_INT_ARGB);
    Graphics g = bufferedImage.getGraphics();
    g.setColor(Color.white);
    g.fillRect(0,0,100,100); // Trying to set the image blank
    g.setColor(new Color(1f,0f,0f,0f)); // Transparent Color
    g.fillRect(0,0,100,100);When I attempt to clear the image by painting a white rectangle followed by a drawing another rectangle using the transparent color,
    the solid color is still shown.
    How do I completly clear the image?
    Thanks
    Andrew

    Hi there,
    As regards getting the image as a component, I haven't
    had much success - so am trying another route.Define "much success" - can't you use the library to display PDFs ?
    BufferedImage out = new BufferedImage(250, 250,
    BufferedImage.TYPE_INT_RGB);
    Graphics g2d = out.getGraphics();
    g2d.drawBytes(bytes, 0, 0, 250, 250);...
    Does this image gets black ? To be quite honest, the code does not makes too much sense for me. It seems you're getting the bytes from the PDF file (which are coded in PDF) and dumping them on the buffered image (which expects RGB triplets, I guess). How/where is the conversion/rendering code ?
    Rafael

  • Drawing transparent pixels into BufferedImage?

    Hi,
    I'm trying to do this:
    1) Create a BufferedImage
    2) Paint its background to black
    3) Paint a rectangle using a fully-transparent color
    4) Output this BufferedImage in the form of a PNG file using ImageIO
    My expectation is for step 3 to paint in "transparent" but what seems to be happening is that Graphics interprets my paint command as "draw nothing, it won't change the image anyway". Or maybe the PNG writer in JDK 1.5 does not actually output transparent pixels? Either way, I'm not getting the results I want. Any ideas?
    Thanks,
    Gili

    one should use Graphics.clearRect() for clearing a regionI'm not so sure about that. The API for clearRect states:
    ...the background color of offscreen images may be system dependent. Applications should use setColor
    followed by fillRect to ensure that an offscreen image is cleared to a specific color.
    So I tried to do as this suggests:
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    public class Test0 {
        public static void main(String[] args) throws IOException {
            int W = 100, H = 100;
            BufferedImage bi = new BufferedImage(W, H, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g = bi.createGraphics();
            g.setColor(Color.BLACK);
            g.fillRect(0, 0, W, H);
            g.setColor(new Color(0,0,0,0));
            g.fillRect(W/4, H/4, W/2, H/2);
            g.dispose();
            ImageIO.write(bi, "png", new File("temp.png"));
    }...and it doesn't work?! I'm thinking this is a bug. What to do? Can't get enough of that Porter-Duff:
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class Test {
        public static void main(String[] args) throws IOException {
            int W = 100, H = 100;
            BufferedImage bi = new BufferedImage(W, H, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g = bi.createGraphics();
            g.setColor(Color.BLACK);
            g.fillRect(0, 0, W, H);
            g.setComposite(AlphaComposite.Clear); //<<---- magic pixie dust
            g.fillRect(W/4, H/4, W/2, H/2);
            g.dispose();
            ImageIO.write(bi, "png", new File("temp.png"));
            JLabel lbl = new JLabel(new ImageIcon(bi));
            lbl.setOpaque(true);
            lbl.setBackground(Color.GREEN);
            JFrame f = new JFrame("Test");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(lbl);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }

  • Problems with AlphaComposite.Src/Clear

    Hi,
    I have problems to fill panel with transparent color( Color(0,0,0,0)). It seems like that AlphaComposite.Src won't overwrite destination. What I'm trying to do is to clear panel before I write text again to the panel.
    I don't know what's wrong in there. I have tried also with AlphaComposite.Clear(), but no difference.
    BufferedImage offscreen = new BufferedImage(getWidth(), getHeight(),
                        BufferedImage.TYPE_INT_ARGB);
    Then on render method I try to clear my panel with:
    Graphics2D g2 = (Graphics2D) offscreen.createGraphics();
    g2.setComposite(AlphaComposite.Src);
    g2.setColor(new Color(0, 0, 0, 0));
    g2.fillRect(0, 0, getWidth(), getHeight());
    And then some text rendering.
    while (measurer.getPosition() < fStyledText.length()) {
                   TextLayout layout = measurer.nextLayout(getWidth());
                   pen.y += (layout.getAscent());
                   float dx = layout.isLeftToRight() ? 0 : (getWidth() - layout
                             .getAdvance());
                   layout.draw(g2, pen.x + dx, pen.y);
                   pen.y += layout.getDescent() + layout.getLeading();
    g2.dispose();
    g.drawImage(offscreen, 0, 0, this);

    Hi Miguel,
    It sounds like your Clear package is set as an Admin Package. To make it accessible to your users, you'll need to go into Manage Data -> Manage Packages (organize list), then choose the package and select the "Modify Package" option. Then uncheck the "Admin Package" box and make sure that the "User Package" box is checked.
    Please note: I believe that if you have both boxes checked it will be only an Admin Package, but my recollection of that is not completely clear, so you should test it out yourself.
    Ethan

  • BufferedImage Refresh

    Im doing a part of a team project that involves drawing animals moving over a terrain. The animals and terrain are in seperate BufferedImages. The Terrain is generated first, then the animals are drawn in a 'World' bufferedimage. In the paint method, the world is set to the terrain buffer. Then an iterator runs through the animals in the world and draws each one to the world.
    The problem is that their old picture is not removed, surely this should happen when we reset the World image to the Terrain on each redraw? Am I missing something massive about bufferedimages?
    Here is the problem section of code: class simPlane extends JPanel
              public simPlane()
                   super();     
                   addMouseMotionListener(new posTracker());
                   addMouseListener(new clickHandler());
                   Dimension Size= new Dimension(800,600);
                   setPreferredSize(Size); // Sets size to W by H
                   setMaximumSize(Size);
              public void updateWorldImage()
                   Graphics2D Brush= WholeWorld.createGraphics();
                   WholeWorld = TerrainScape;
                   //Brush.setColor(new Color(127,0,0,20));
                   //Brush.fill(backGround);
                   // Copy Terrain into the WholeWorld Buffer
                   // Paints all LifeForms in World
                   for (Iterator I = World.getIterator();I.hasNext();)
                        LifeForm L = (LifeForm)I.next();
                        L.drawScreenRep(Brush,FOV);
              public void paintComponent(Graphics B)
                   super.paintComponent(B); //Clear Screen
                   updateWorldImage();     
                   Graphics2D Brush = (Graphics2D)B;
                   VisibleWorld = WholeWorld.getSubimage(hPos,vPos,800,600);
                   Brush.drawImage(VisibleWorld,null,0,0);
                   Brush.drawString("(" + String.valueOf(xPos)+", "+String.valueOf(yPos) + ") @ height: " + String.valueOf(Tpanel.getHeight(xPos, yPos)),640,590);
                   try{
                        Thread.sleep(300);
                        System.out.println("sleeping");
                        } catch (InterruptedException e){
                             System.out.println("oopS");
         }// simPlaneI know that if i uncomment the lines that fills the background (simply a rectangle defined earlier) then the old images are removed, however so is the Terrain!
    Is it possible to fix this? I've searched the forums, but only found occasions where people want to make the background a solid colour, no another BufferedImage... any ideas??
    Thanks
    pete :D

    Nevermind I managed to solve it myself! Found this thread -> http://forum.java.sun.com/thread.jspa?forumID=20&threadID=179252
    so changed WholeWorld=Terrain to Brush.drawImage(TerrainScape,0,0,this);easy when you know how!
    Also I took out the thread.sleep, and yes i do know that it was stupidly long! was just to make the point in testing!
    thanks anyway guys!
    pete :D

  • Resizing a rotated BufferedImage

    Hi everybody,
    I am currently developing a graphical figure editor. Users can drop several 'objects' on a JPanel.
    These objects are represented on screen by BufferedImages. The objects are resizable, rotatable
    and movable.
    Rotating is implemented using AffineTransform. This works fine.
    However, imagine one of the objects that has been rotated 90 degrees. Its north face will be facing east in
    the viewport. When a user resizes the object by grabbing the east-side (i.e. the north handle before rotation)
    resize-handle and dragging it to the east it is essentially resizing the object in a northwise direction.
    This means that the height of the object is increased and that its origin (top left point) is decreased. However,
    this will be drawn on screen exactly as stated: the height is increased and the origin is decreased and afterwards
    the image is rotated. All this results in an object with the correct size, but drawn at the wrong location (I draw the
    BufferedImage at the origin-point which was just decreased).
    Might be a long and akward story, so here I will post a small example application which illustrates the behaviour
    of my program. The program shows a BufferedImage. On this image a rectangle is drawn, along with an ellipse that
    indicates the north face of the rectangle. Pressing 'R' results in a rotation of 90 degrees, whereas pressing any
    of the four arrow-keys results in a 5-pixel increase in size. Just pressing R once and then an arrow key will
    illustrate my problem.
    My question is simple: how should I go about resizing (not rescaling, I really want to increase the
    number of paintable pixels for my BufferedImage!) a BufferedImage that's been rotated using AffineTransform.
    Any suggestions are greatly appreciated!
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.image.BufferedImage;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    * Creates a BufferedImage that displays a simple image.
    * This Image will can be rotated 1/2 PI degrees by pressing 'R'.
    * By pressing any of the arrow-keys, the image is resized as if stretching
    * the top of the image. (i.e. in the original, non-rotated, image it
    * simply moves the origin of the image and increases the height).
    public class ImageTest extends JPanel implements KeyListener
       double theta = 0.0; // rotation angle
       Point origin = new Point(50,50); // origin of the image
       Dimension size = new Dimension(100,100); // size of the image
       public static void main(String[] args)
          JFrame mainFrame = new JFrame("Image Tester");
          ImageTest imageTest = new ImageTest();
          mainFrame.getContentPane().add(imageTest);
          mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          mainFrame.setSize(400,400);
          mainFrame.show();
          mainFrame.addKeyListener(imageTest);
       // draw the image on the JPanel
       public void paintComponent(Graphics g)
          super.paintComponent(g);
          // create a BufferedImage and draw something on it (a rectangle)
          BufferedImage image =
             new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
          Graphics g2 = image.createGraphics();
          g2.drawRect(0, 0, size.width - 1, size.height - 1);
          g2.fillOval(size.width / 2, 0, 3, 3); // draw a little 'north' indicator
          g2.dispose();
          // now rotate g
          Graphics2D g2d = (Graphics2D)g;
          g2d.rotate(theta,
                     origin.x + size.width / 2.0,
                     origin.y + size.height / 2.0);
          // and draw the image on the specified origin
          g2d.drawImage(image, origin.x, origin.y, null);
        * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent)
       public void keyPressed(KeyEvent arg0)
          switch(arg0.getKeyCode())
             case (KeyEvent.VK_R):
                // rotate! add 1 / 2 PI degrees of rotation
                theta += Math.PI / 2;
                repaint();
                break;
             case (KeyEvent.VK_LEFT):
             case (KeyEvent.VK_RIGHT):
             case (KeyEvent.VK_DOWN):
             case (KeyEvent.VK_UP):
                // make the image 5 pixels larger
                origin.y = origin.y - 5;
                size.height += 5;
                repaint();
                break;
        * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
       public void keyReleased(KeyEvent arg0)
        * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
       public void keyTyped(KeyEvent arg0)
    }

    Thanks Olek for your suggestion.
    I took your advice (kind-of) and tried something.
    Now I create a BufferedImage on which I draw a rectangle. The resulting Image is transformed to a rotated version of
    this image. To do so, a new BufferedImage is created based on an AffineTransformOp.
    This resulting (rotated) image is then shown on screen.
    However, it still does not work correctly.
    I have to state that this is a very simplified version of my problem. The original program features 8 resize handles, along with one rotation handle above
    the object. When no rotation has been applied everything works fine (i.e. the object can be resized using the handles). However, if someone uses
    the rotation handle to rotate the object 90 degrees (for example), resizing does no longer work correctly.
    This sample program that I provided intends to mimic the case in which a user is stretching a rectangle to the north (without rotation) and to the
    east (with 90 degrees of rotation). As you can see, if you press the UP-arrow if the object is not rotated, it does exactly what it needs to do:
    stretch to the north (i.e. update the origin and increase the height). If you press R once and then try the UP-arrow again, you see that it still does what it needs to do. However, since I update the origin, the BufferedImage is moving up.
    This all is very logical and the program does exactly what I ask it to do. However, it is not what I want it to do and I do not know how to implement what I really want.
    Maybe someone can sketch some solution to this problem:
    1 - Display a buffered image of size 30 x 30 (with some north-indicator)
    2 - Stretch this image to the north a few pixels
    3 - Rotate the buffered image 90 degrees clockwise around its center (north indicator is pointing east)
    4 - Stretch this image to the east a few pixels (which, I think, corresponds to the operation in 2, but it clearly does not!)
    This might be the little kick I need to set me off in the right direction again. I think I might have been thinking about this too long to see the solution
    myself.
    Listed here is my own updated version of the sample I provided in my first post. Clockwise rotation is still key R, counter clockwise rotation is E,
    stretching the image to the north is UP-arrow and decreasing the image from the north is down (i.e. up and down mimic the case in which a user uses
    the northern resize-handle to resize the image; in case of rotation this northern resize-handle is obviously displayed east or whatever).
    Any help is appreciated as always!
    package test;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Point;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.geom.AffineTransform;
    import java.awt.image.AffineTransformOp;
    import java.awt.image.BufferedImage;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    * Creates a BufferedImage that displays a simple image.
    * This Image will can be rotated 1/2 PI degrees by pressing 'R'.
    * By pressing any of the arrow-keys, the image is resized as if stretching
    * the top of the image. (i.e. in the original, non-rotated, image it
    * simply moves the origin of the image and increases the height).
    public class ImageTest extends JPanel implements KeyListener
       double theta = 0.0; // rotation angle
       Point origin = new Point(50,50); // origin of the image drawing
       Dimension size = new Dimension(100,100); // size of the image
       public static void main(String[] args)
          JFrame mainFrame = new JFrame("Image Tester");
          ImageTest imageTest = new ImageTest();
          mainFrame.getContentPane().add(imageTest);
          mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          mainFrame.setSize(400,400);
          mainFrame.show();
          mainFrame.addKeyListener(imageTest);
       public void paintComponent(Graphics g)
          super.paintComponent(g);
          // get the BufferedImage in its rotated version;
          BufferedImage image = getImage();
          // display the image
          g.drawImage(image, origin.x, origin.y, null);
       private BufferedImage getImage()
          BufferedImage result =
             new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
          // draw a nice rectangle
          Graphics g = result.createGraphics();
          g.fillRect(0, 0, size.width, size.height);
          // and a north indicator
          g.setColor(Color.BLACK);
          g.fillOval(size.width / 2 - 3, 0, 6, 6);
          return applyRotation(result);
       private BufferedImage applyRotation(BufferedImage source)
          // create the rotation
          AffineTransform transform =
             AffineTransform.getRotateInstance(
                      theta,
                      source.getWidth() / 2,
                      source.getHeight() / 2);
          // make an Operation to create the new buffered image
          AffineTransformOp transformOp =
             new AffineTransformOp(transform, AffineTransformOp.TYPE_BILINEAR);
          // create dest image
          BufferedImage dest =
             transformOp.createCompatibleDestImage(source, source.getColorModel());
          // apply the filter
          transformOp.filter(source, dest);
          return dest;     
        * @see java.awt.event.KeyListener#keyPressed(java.awt.event.KeyEvent)
       public void keyPressed(KeyEvent arg0)
          int key = arg0.getKeyCode();
          switch(key)
             case KeyEvent.VK_R:
                // rotate clockwise
                theta += Math.PI / 2;
                break;
             case KeyEvent.VK_E:
                // rotate counter-clockwise
                theta -= Math.PI / 2;
                break;
             case KeyEvent.VK_UP:
                // scale up
                origin.y -= 5;
                size.height += 5;
                break;
             case KeyEvent.VK_DOWN:
                // scale down
                origin.y += 5;
                size.height -= 5;
                break;
          repaint();
        * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
       public void keyReleased(KeyEvent arg0)
        * @see java.awt.event.KeyListener#keyTyped(java.awt.event.KeyEvent)
       public void keyTyped(KeyEvent arg0)
    }

  • Clearing graphics

    Hi everyone !
    I'm using the Java Graphics2D API to create a Game Engine, I know how to draw sprites etc but I have a problem.
    To refresh the screen, I'm using graphic buffers ( BufferedImage's ) and I have to clear them before redrawing the screen.
    The engine is composed of 5 layers ( drawn one above an other ), so when I clear them I want to keep the alpha property of each one.
    The method I wrote is here :
    protected final void clear(Graphics2D g)
         Composite c = g.getComposite();          
         g.clearRect(0, 0, Tests.WIDTH, Tests.HEIGHT);
         g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_IN, 1f));
         g.setColor(new Color(0, 0, 0, 0));
         g.fillRect(0, 0, Tests.WIDTH, Tests.HEIGHT);
         g.setComposite(c);
    }This is the only way I have found, but it is very slowly for a game engine.
    Do you have a better idea to resolve this problem ?
    Thanks in advance.

    >
    Are you using compatible images? If not, using them will probably lead to a nice performance boost, especially if you're blitting lots of BufferedImages to the screen per frame.
    BufferedImage img = canvas.getGraphicsConfiguration().createCompatibleImage(int width, int height, int transparency) ;Besides that little bit of advice, I'm still a little confused as to what you're trying to do, so an SSCCE would probably be best.
    >
    No I wasn't and I'm not using the Canvas class.
    Nevertheless I have tried to create an image with the 'getGraphicsConfiguration' method of the JPanel I use to render the game, but a NullPointerException was thrown.
    I so wrote a method with GraphicsEnvironement and GraphicsDevice class to get a GraphicsConfiguration and finally create a compatible image but the result
    was not very conclusive.
    The thing I'm trying to do is just to clear a BufferedImage without losing its alpha property. In fact, my engine ( a tile engine ) wroks with layers.
    So if a layer background becomes opaque, the things that are under this layer ( another layer ) would not be visible.
    But this method :
    >
    I'm pretty sure that the code you posted is equivalent to
    Composite orig = g.getComposite();
    g.setComposite(AlphaComposite.Clear);
    g.fillRect(0, 0, Tests.WIDTH, Tests.HEIGHT);
    g.setComposite(orig);
    This wouldn't require the clearRect(). In fact the code you currently have doesn't require the clearRect(). Also, the CLEAR rule doesn't require any calculations like the SRC_IN rule.
    >
    made my engine take twice less time to execute for each frame. ( 47ms instead of 94 before )
    Thank you

Maybe you are looking for

  • Drivers won't load for core center or core cell?

    When I log on as a powers user I get these pop up windows that say the drivers for the digi cell and digi core were not installed. I also get another pop up about this mother board not supported. But when I log on as administrator they all load no pr

  • TV white noise after starting from standby

    Hi, Recently I have installed ShowShifter. It's a great program and very stable. Everything works as it should from excellent TV picture and sound, recording, showshifting, playback, etc  . Except one thing is not working correctly: the recording fro

  • Hi,how can i change language in new lion?i need from english,to the czech know anyone?thanks

    hi,how can i change language in new lion?i need from english,to the czech know anyone?thanks

  • Chinese language option

    Hi my e61i was purchased in India and does not have a Chinese language option. Would appreciate any advice as to where and how this can be added to my phone. Many tks in advance.

  • Where are these movie files at?

    For some reason I had 60 gigs of movies saved onto my computer.  I use my GOPRO alot and make videos for youtube with it.  So I have deleted everything I can find under the files .mov, .mpeg, .mp4...etc.  But there is still 40 gigs of movies on my co