Copy BufferedImage and transparency

In my applet, Toolkit.getImage() returns a BufferedImage of type TYPE_INT_ARGB, which I'm successfully using with transparency.
However, running as an application, ImageIO.read() returns a BufferedImage of type TYPE_BYTE_BINARY, which doesn't support transparency.
I've found that creating a new BufferedImage of type TYPE_INT_ARGB and copying into it doesn't work. The two types appear to be incompatible for copying.
Any suggestions as to a "correct" way to read a GIF file in a java application and retain the transparency (mask) layer? I don't need blending, just a 1-bit stencil mask.
Thanks,
Chuck Bueche

This is discussed alot on javagaming.org. But what you want to do is use Toolkit.getImage, in almost all cases it will be the best solution as it will hardware accelerate your image if it a) has no transparency or b) has 1 bit of transparency. If you have 255 levels of transparency in the image (most do for the nice smooth look) you will end up with an image that cannot be hardware accelerated (yet).
ImageIO.read helps to make things easier to use/load, but right now none of the ImageIO functions produce hw acclerated images.

Similar Messages

  • Copying BufferedImage to clipboard fails

    The clipboard is giving me some trouble... If I copy an image selection with transparency data and then create a BufferedImage from the clipboard contents (paste), then everything works fine everywhere. However if I have a BufferedImage with transparency data that I want to SET to the clipboard (copy) then I observe two different behaviors between Ubuntu and Windows XP -- both incorrect.
    On Ubuntu:
    getTransferDataFlavors of my Transferable is called once. isDataFlavorSupported and getTransferData are never called. The clipboard is unaltered. No exception is thrown -- nothing. It just silently fails to do anything. Calling Toolkit.getDefaultToolkit().getSystemClipboard().getAvailableDataFlavors() shows me that DataFlavor.imageFlavor is indeed present.
    On Windows:
    My getTransferData is indeed called and the clipboard is modified. However, the image is set on a BLACK background -- the transparency data is lost.
    Relevant code portions look like:
    btnCopy.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){
                        CopyableImage img = new CopyableImage(frame.getImage());
                        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(img, null);
              });Where frame.getImage is a BufferedImage of type ARGB, with a transparent background
    private static class CopyableImage implements Transferable {
            private BufferedImage image;
            public CopyableImage(BufferedImage image) {
                this.image = image;
            // Returns supported flavors
            public DataFlavor[] getTransferDataFlavors() {
                return new DataFlavor[]{DataFlavor.imageFlavor};
            // Returns true if flavor is supported
            public boolean isDataFlavorSupported(DataFlavor flavor) {
                return DataFlavor.imageFlavor.equals(DataFlavor.imageFlavor);
            // Returns image
            public BufferedImage getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
                if (!DataFlavor.imageFlavor.equals(flavor)) {
                    throw new UnsupportedFlavorException(flavor);
                return image;
        }Any ideas...?
    Additional Notes:
    I'm am running Java 1.6
    My paste destination is in GIMP, on a new image with transparent background.
    Edited by: MichaelDGagnon on Dec 14, 2008 11:18 AM

    A fully self contained example which continues to replicate the problems observed for me is as follows. Paste works (slowly) and copy fails
    import java.io.IOException;
    import java.net.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.imageio.*;
    import java.awt.datatransfer.*;
    public class CopyTest extends JPanel{
         public static void main(String args[]) throws Exception{
              final CopyTest copyTest = new CopyTest();
              JFrame f = new JFrame();
              f.addWindowListener(new WindowListener(){
                   public void windowClosed(WindowEvent e){}
                   public void windowClosing(WindowEvent e){ System.exit(0); }
                   public void windowIconified(WindowEvent e){}
                   public void windowDeiconified(WindowEvent e){}
                   public void windowActivated(WindowEvent e){}
                   public void windowDeactivated(WindowEvent e){}
                   public void windowOpened(WindowEvent e){}
              f.setLayout(new BorderLayout());
              JButton btnCopy = new JButton("Copy");
              JButton btnPaste = new JButton("Paste");
              JPanel southPanel = new JPanel();
              southPanel.add(btnCopy);
              southPanel.add(btnPaste);
              f.add(copyTest, BorderLayout.CENTER);
              f.add(southPanel, BorderLayout.SOUTH);
              btnCopy.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){ copyTest.copy(); }
              btnPaste.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent e){ copyTest.paste(); }
              f.setSize(320, 240);
              f.setVisible(true);
         private static final int SQUARE_SIZE=6;
         private BufferedImage image;
         // Constructor
         public CopyTest() throws Exception{
              this.image = ImageIO.read(new URL("http://forums.sun.com/im/duke.gif"));
         // Copy
         public void copy(){
              Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
                        new Transferable(){
                             public DataFlavor[] getTransferDataFlavors() { return new DataFlavor[]{DataFlavor.imageFlavor}; }
                             public boolean isDataFlavorSupported(DataFlavor flavor) { return DataFlavor.imageFlavor.equals(DataFlavor.imageFlavor); }
                             public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
                               if(!DataFlavor.imageFlavor.equals(flavor)){ throw new UnsupportedFlavorException(flavor); }
                               return image;
                        , null);
         // Paste
         public void paste(){
              // Get the contents
              BufferedImage clipboard = null;
              Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
              try {
                if (t != null && t.isDataFlavorSupported(DataFlavor.imageFlavor)) {
                     clipboard = (BufferedImage)t.getTransferData(DataFlavor.imageFlavor);
            } catch (Exception e) { e.printStackTrace(); }
            // Use the contents
            if(clipboard != null){
                   image = clipboard;
                   repaint();
         // Paint
         public void paint(Graphics g){
              // Paint squares in the background to accent transparency
              g.setColor(Color.LIGHT_GRAY);
              g.fillRect(0, 0, getWidth(), getHeight());
              g.setColor(Color.DARK_GRAY);
              for(int x=0; x<(getWidth()/SQUARE_SIZE)+1; x=x+1){
                   for(int y=0; y<(getHeight()/SQUARE_SIZE)+1; y=y+1){
                        if(x%2 == y%2){ g.fillRect(x*SQUARE_SIZE, y*SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE); }
              // Paint the image
              g.drawImage(image, 0, 0, this);
    }

  • How to make a BufferedImage background transparent?

    I try to draw an image from a BufferedImage to a JPanel, which the original image background is transparent, but when I draw on the JPanel, its background becomes black color. How can I make it transparent?
    My code is something like this:
    img = Toolkit.getDefaultToolkit().getImage("tiger.gif");
    try {
    MediaTracker tracker = new MediaTracker(this);
    tracker.addImage(img, 0);
    tracker.waitForID(0);
    } catch (Exception e) {}
    int width = img.getWidth(this);
    int height = img.getHeight(this);
    bImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    bImageG2D= bImage.createGraphics();
    bImageG2D.drawImage(img, 0, 0, null);
    public void paintComponent(Graphics g) {
    Graphics2D g2 = (Graphics2D)g;
    g2.drawImage(bImage, 0, 0, null);
    Thanks for the help!

    Nekot,
    It would be a great help if you can share your code of 'transparent bufferedimage' with me. I have been trying to create a transparent gif since long. Now I think I can create a transparent bufferedimage and display it.
    Thanks,
    Riddhi.

  • How to copy data from transparent table to our own ceated z table?

    How to copy data from transparent table to our own ceated z table?
    Plz tell me different methods and which one is best?
    Is get data from sflight into table z* is correct?

    Hi Ajay,
    let us consider you have to copy EKKO table to ZEKKO table
    1. In ABAP program define internal table based on EKKO
    <b>     eg: i_ekko</b>
    2. Select the data from EKKO to i_ekko
    <b>     eg: select * from ekko into table i_ekko.</b>
    3. insert into Z-TABLE from the internal table
    <b>     eg: INSERT EKKO FROM TABLE I_EKKO.
               COMMIT WORK.</b>
    <u>To insert in internal table you can use the following:</u>
    1. INSERT [wa INTO|INITIAL LINE INTO] itab [INDEX idx].
    2. INSERT [wa INTO|INITIAL LINE INTO] TABLE itab.
    3. INSERT LINES OF itab1 [FROM idx1] [TO idx2] INTO itab2 [INDEX idx3].
    4. INSERT LINES OF itab1 [FROM idx1] [TO idx2] INTO TABLE itab2.
    <u>To inert in database table, use the following:</u>
    1. INSERT INTO <dbtabname> [CLIENT SPECIFIED] VALUES wa.
    2. INSERT <dbtabname> [CLIENT SPECIFIED] FROM TABLE itab.
    3. INSERT <dbtab> [CLIENT SPECIFIED]. oder
    4. INSERT <dbtabname> [CLIENT SPECIFIED] ... .
    <b>Reward points.. if helpful.
    Cheers !
    Moqeeth.</b>

  • Graphics.copyArea() and transparent pixels

    Hi,
    I have a problem with a JLayeredPane.
    I have to paint a scrolling sampled signal on top of a grid. To do this I used a JLayeredPane where on the bottom layer there's a panel (let's call it GridPane) with the grid, and then some layers up I put another JPanel with setOpaque(false) that paints the signal (PaintPane). This way I have to paint the grid only one time, or so I thought.
    Now when I try to scroll the signal I use the copyArea() function to scroll one pixel to the left then paint the next line of the trace.
    The problem is that the copyArea() function ignores the transparent pixels and copies the grid that is behind them even when I'm using the PaintPane Graphics. This way is like i'm shifting the grid but I want it to be fixed.
    So do all the components in the JLayeredPane share the same graphics? that would explain the behaviour of the copyArea() func.
    Is there a way to tell the copyArea() func to copy also the transparent pixels, ignoring what stands behind them?
    Thank you.

    Nothing.
    Apparently there's no way to just repaint that portion of graphics without repainting everything.
    I now understand more on how transparent pixels are treated.
    So, when I overwrite one of the pixels in the background in a way or another I have lost it forever. and it's my function that has to take care of repainting it.(usually repainting everything).
    I hoped to improve performance with this method but, well, have to turn back on the old one.
    Thanks again.

  • Write to bufferedimage and compatibleimages

    hey
    you maybe remember that I made a breakout game, i use compatibleimages in fullscreen and draw them alot of times..300+
    someone told me to use a bufferedImage and draw the image to this bufferedImage first then just blit the bufferedImage.
    is this correct?will that result in 1 blit instead of 300? and is if faster? the game has 70 fps now.

    hmm, the answer can be either yes or no.
    edit ESSAY ALERT :D
    if hardware acceleration is supported, your current way of doing it will be quicker.
    If hardware acceleration is not supported, reducing the number of blits may well increase speed.
    heres an outline of what the processes involve :-
    When hardware acceleration is supported
    A) Blitting each block seperately
    1) the framebuffer (back & front buffers) are both stored in vram.
    2) each blocks image is stored in main memory, and cached in vram.
    3) any blit operations are vram->vram, hence have near zero execution cost.
    B) Blitting each block to an intermediary image (when a change occurs), then blitting this intermediary image to the frame buffer.
    1) the frame buffer (back & front buffers) are both stored in vram.
    2) each blocks image is stored in main memory, and cached in vram. (though the vram cached version will never be used)
    3) the intermediary image is stored in main memory, and cached in vram.
    4) the regular blit operation will be
    intermediary image->frame buffer
    since both of these are in vram, the cost is near zero.
    5) when the intermediary image changes, the blit operation is
    blocks image->intermediary image
    since both these images have their original image stored in main memory,
    this blit is a main mem.->main mem. hence, will incur a speed cost.
    6) ALSO, when the intermediary image changes, the version cached in vram
    becomes invalid, and the image needs to be re-cached.
    This is a main mem.->vram copy, which also incurs a cost.
    If the intermediary image changes often, this will result in a drop in framerate each time a change occurs.
    (inconsistant framerates are VERY bad from a human perception POV)
    C) use a VolatileImage object for the intermediary image
    This is the best solution, as it removes all main mem->vram blits, and also reduces the vram->vram blits to an absolute minimum.
    However,
    the real speed difference between 300 vram blits
    and 1vram blit(+1 vram blit each time a change occurs)
    is absolutely minimal.
    (infact, because this isnt your bottleneck the speed difference will be zero)
    When hardware acceleration is NOT supported
    A) Blitting each block seperately
    1) the back buffer is in main mem. the front buffer is in vram.
    2) each blocks image is stored in main memory.
    3) each block blit is main mem.->main mem. (costly)
    PLUS the back buffer has to be blitted onto the front buffer, this is a main mem.->vram blit.
    B) Blitting each block to an intermediary image (when a change occurs), then blitting this intermediary image to the frame buffer.
    1) the back buffer is in main mem. the front buffer is in vram.
    2) each blocks image is stored in main memory.
    3) the intermediary image is stored in main mem.
    4) the regular blit operation will be
    intermediary image->back buffer
    this is a single main mem.->main mem. blit.
    5) also, each time the intermediary image changes,
    you will get an extra main mem->main mem blit.
    6) you also have the obligatory back buffer->front buffer blit
    Comparing the 2 methods when there is no hardware acceleration available
    you will see that the 2nd technique does indeed require fewer blits.
    (instead of 300 every frame, your doing 1+[1 each time a change occurs])
    So, now your left with the question, 'which do I use?'
    well, its totally down to whether you expect hardware acceleration to be available or not :S
    The ideal solution is to write 2 versions,
    not very 'Java', but its the way the world is :[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Need help: BufferedImage and zooming

    please help me understand what i am doing wrong. i am having a hard time understanding the concept behind BufferedImage and zooming. the applet code loads an image as its background. after loading, you can draw line segments on it. but when i try to zoom in, the image in the background remains the same in terms of size, line segments are the only ones that are being zoomed, and the mouse coordinates are confusing.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.imageio.*;
    import java.io.*;
    import java.util.ArrayList;
    import java.io.IOException;
    import java.net.URL;
    import java.awt.image.*;
    public class Testing extends JApplet {
         private String url;
         private Map map;
         public void init() {
         public void start()
              url = "http://localhost/image.gif";
                  map = new Map(url);
                 getContentPane().add(map, "Center");
                 validate();
                 map.validate();
    class Map extends JPanel implements MouseListener, MouseMotionListener{
         private Image image;
         private ArrayList<Point2D> points;
         private ArrayList<Line2D> lineSegment;
         private Point2D startingPoint;
         private int mouseX;
         private int mouseY;
         private BufferedImage bimg;
         private AffineTransform xform;
         private AffineTransform inverse;
         private double zoomFactor = 1;
         public Map(String url)
                         super();
              //this.image = image;
              try
                   image = ImageIO.read(new URL(url));
              catch(Exception e)
              Insets insets = getInsets();
              xform = AffineTransform.getTranslateInstance(insets.left, insets.top);
              xform.scale(zoomFactor,zoomFactor);
              try {
                   inverse = xform.createInverse();
              } catch (NoninvertibleTransformException e) {
                   System.out.println(e);
              points = new ArrayList();
              startingPoint = new Point();
              bimg = new BufferedImage(this.image.getWidth(this), this.image.getHeight(this), BufferedImage.TYPE_INT_ARGB);
              repaintBImg();
              addMouseListener(this);
              addMouseMotionListener(this);
         public void paintComponent(Graphics g)
            Graphics2D g2d = (Graphics2D)g;
              g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));
              g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_RENDERING , RenderingHints.VALUE_RENDER_QUALITY ));
            bimg = (BufferedImage)image;
            g2d.drawRenderedImage(bimg, xform);
            if(!points.isEmpty())
                 for(int i=0; i<points.size(); i++)
                      if(i > 0)
                           drawLineSegment(g2d,points.get(i-1),points.get(i));
                      drawPoint(g2d, points.get(i));
            if(startingPoint != null)
                drawTempLine(startingPoint, g2d);
            else
                mouseX = 0;
                mouseY = 0;
         private void repaintBImg()
              bimg.flush();
              Graphics2D g2d = bimg.createGraphics();
              g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));
              g2d.addRenderingHints(new RenderingHints(RenderingHints.KEY_RENDERING , RenderingHints.VALUE_RENDER_QUALITY ));
            g2d.drawRenderedImage(bimg, xform);
            g2d.dispose();
         private void drawPoint(Graphics2D g2d, Point2D p)
            int x = (int)(p.getX() * zoomFactor);
            int y = (int)(p.getY() * zoomFactor);
            int w = (int)(13 * zoomFactor);
            int h = (int)(13 * zoomFactor);
              g2d.setColor(Color.ORANGE);
              g2d.setStroke(new BasicStroke(1.0F));
            g2d.fillOval(x - w / 2, y - h / 2, w, h);
            g2d.setColor(Color.BLACK);
            g2d.drawOval(x - w / 2, y - h / 2, w - 1, h - 1);
         private void drawLineSegment(Graphics2D g2d, Point2D p1, Point2D p2)
              double x1 = p1.getX() * zoomFactor;
                 double y1 = p1.getY() * zoomFactor;
                 double x2 = p2.getX() * zoomFactor;
                 double y2 = p2.getY() * zoomFactor;
                 g2d.setColor(Color.RED);
                 g2d.setStroke(new BasicStroke(3.0F));
                 g2d.draw(new java.awt.geom.Line2D.Double(x1, y1, x2, y2));
             private void drawTempLine(Point2D p, Graphics2D g2d)
                 int startX = (int)(p.getX() * zoomFactor);
                 int startY = (int)(p.getY() * zoomFactor);
                 if(mouseX != 0 && mouseY != 0)
                         g2d.setColor(Color.RED);
                          g2d.setStroke(new BasicStroke(2.0F));
                          g2d.drawLine(startX, startY, mouseX, mouseY);
         public void mouseClicked(MouseEvent e)
         public void mouseDragged(MouseEvent e)
              mouseX = (int)(e.getX()*zoomFactor);
              mouseY = (int)(e.getY()*zoomFactor);
              repaint();
         public void mousePressed(MouseEvent e)
              if(e.getButton() == 1)
                   points.add(inverse.transform(e.getPoint(), null));
                   if(points.size() > 0)
                        startingPoint = points.get(points.size()-1);
                        mouseX = mouseY = 0;
                   repaint();
              else if(e.getButton() == 2)
                   zoomFactor = zoomFactor + .05;
                   repaintBImg();
              else if(e.getButton() == 3)
                   zoomFactor = zoomFactor - .05;
                   repaintBImg();
         public void mouseReleased(MouseEvent e)
              if(e.getButton() == 1)
                   points.add(inverse.transform(e.getPoint(), null));
              repaint();
         public void mouseEntered(MouseEvent mouseevent)
         public void mouseExited(MouseEvent mouseevent)
         public void mouseMoved(MouseEvent mouseevent)
    }Message was edited by:
    hardc0d3r

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.BufferedImage;
    import java.awt.geom.*;
    import java.io.*;
    import java.net.URL;
    import java.util.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class ZoomTesting extends JApplet {
        public void init() {
            //String dir = "file:/" + System.getProperty("user.dir");
            //System.out.printf("dir = %s%n", dir);
            String url = "http://localhost/image.gif";
                         //dir + "/images/cougar.jpg";
            MapPanel map = new MapPanel(url);
            getContentPane().add(map, "Center");
        public static void main(String[] args) {
            JApplet applet = new ZoomTesting();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(applet);
            f.setSize(400,400);
            f.setLocation(200,200);
            applet.init();
            f.setVisible(true);
    class MapPanel extends JPanel implements MouseListener, MouseMotionListener {
        private BufferedImage image;
        private ArrayList<Point2D> points;
        private Point2D startingPoint;
        private int mouseX;
        private int mouseY;
        private AffineTransform xform;
        private AffineTransform inverse;
        RenderingHints hints;
        private double zoomFactor = 1;
        public MapPanel(String url) {
            super();
            try {
                image = ImageIO.read(new URL(url));
            } catch(Exception e) {
                System.out.println(e.getClass().getName() +
                                   " = " + e.getMessage());
            Map<RenderingHints.Key, Object> map =
                        new HashMap<RenderingHints.Key, Object>();
            map.put(RenderingHints.KEY_ANTIALIASING,
                    RenderingHints.VALUE_ANTIALIAS_ON);
            map.put(RenderingHints.KEY_RENDERING,
                    RenderingHints.VALUE_RENDER_QUALITY);
            hints = new RenderingHints(map);
            setTransforms();
            points = new ArrayList<Point2D>();
            startingPoint = new Point();
            addMouseListener(this);
            addMouseMotionListener(this);
        private void setTransforms() {
            Insets insets = getInsets();
            xform = AffineTransform.getTranslateInstance(insets.left, insets.top);
            xform.scale(zoomFactor,zoomFactor);
            try {
                inverse = xform.createInverse();
            } catch (NoninvertibleTransformException e) {
                System.out.println(e);
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2d = (Graphics2D)g;
            g2d.setRenderingHints(hints);
            g2d.drawRenderedImage(image, xform);
            if(!points.isEmpty()) {
                for(int i=0; i<points.size(); i++) {
                    if(i > 0)
                        drawLineSegment(g2d,points.get(i-1),points.get(i));
                    drawPoint(g2d, points.get(i));
            if(startingPoint != null) {
                drawTempLine(startingPoint, g2d);
            } else {
                mouseX = 0;
                mouseY = 0;
        private void drawPoint(Graphics2D g2d, Point2D p) {
            int x = (int)(p.getX() * zoomFactor);
            int y = (int)(p.getY() * zoomFactor);
            int w = (int)(13 * zoomFactor);
            int h = (int)(13 * zoomFactor);
            g2d.setColor(Color.ORANGE);
            g2d.setStroke(new BasicStroke(1.0F));
            g2d.fillOval(x - w / 2, y - h / 2, w, h);
            g2d.setColor(Color.BLACK);
            g2d.drawOval(x - w / 2, y - h / 2, w - 1, h - 1);
        private void drawLineSegment(Graphics2D g2d, Point2D p1, Point2D p2) {
            double x1 = p1.getX() * zoomFactor;
            double y1 = p1.getY() * zoomFactor;
            double x2 = p2.getX() * zoomFactor;
            double y2 = p2.getY() * zoomFactor;
            g2d.setColor(Color.RED);
            g2d.setStroke(new BasicStroke(3.0F));
            g2d.draw(new java.awt.geom.Line2D.Double(x1, y1, x2, y2));
        private void drawTempLine(Point2D p, Graphics2D g2d) {
            int startX = (int)(p.getX() * zoomFactor);
            int startY = (int)(p.getY() * zoomFactor);
            if(mouseX != 0 && mouseY != 0) {
                g2d.setColor(Color.RED);
                g2d.setStroke(new BasicStroke(2.0F));
                g2d.drawLine(startX, startY, mouseX, mouseY);
        public void mouseClicked(MouseEvent e) {}
        public void mouseDragged(MouseEvent e) {
            mouseX = (int)(e.getX()*zoomFactor);
            mouseY = (int)(e.getY()*zoomFactor);
            repaint();
        public void mousePressed(MouseEvent e) {
            if(e.getButton() == 1) {
                points.add(inverse.transform(e.getPoint(), null));
                if(points.size() > 0) {
                    startingPoint = points.get(points.size()-1);
                    mouseX = mouseY = 0;
            } else if(e.getButton() == 2) {
                zoomFactor = zoomFactor + .05;
                setTransforms();
            } else if(e.getButton() == 3) {
                zoomFactor = zoomFactor - .05;
                setTransforms();
            repaint();
        public void mouseReleased(MouseEvent e) {
            if(e.getButton() == 1) {
                points.add(inverse.transform(e.getPoint(), null));
            repaint();
        public void mouseEntered(MouseEvent mouseevent) {}
        public void mouseExited(MouseEvent mouseevent) {}
        public void mouseMoved(MouseEvent mouseevent) {}
    }

  • Error 7 occurred at Copy in ABAPI Dist New VI Library.vi​- ABAPI Dist Chk for Destinatio​ns.vi- ABA​PI Copy Files and Apply Settings.v​i- EBEP_In​voke_Build​_Engine.vi​- EBUIP_Bu​ild_Invoke​.vi- EBUIP​_Build_Inv​oke.vi.Pro​xyCaller

    When I try to build executables in LabView 8.01 I get message:
    Error 7 occurred at Copy in ABAPI Dist New VI Library.vi->ABAPI Dist Chk for Destinations.vi->ABAPI Copy Files and Apply Settings.vi->EBEP_Invoke_Build_Engine.vi->EBUIP_Bu​ild_Invoke.vi->EBUIP_Build_Invoke.vi.ProxyCaller
    Best Regards

    I got the same error as I tried to build my application, the reason was the string I set for the 'Build specification name' property of my build.
    I changed from '3DC - Dlog Data Compacter ' to '3DC' and it worked afterwards..quite strange behaviour..

  • How do I reinstall the edit button on my Firefox 4 toolbar; cut, copy, paste, and print?

    I recently have been having problems with my Firefox 4 tool bars. Right now, the Edit icons are no longer on the tool bar, specifically Cut, Copy, Paste, and Print. If there were other Edit icons, they too are gone. All the other icons have remained.
    I would appreciate it if you could advise me how to reinstall those specific icons.
    Also recently, ALL my tool bars, and task and status bar disappeared. This was only in Firefox 4.0; IE 8 was not affected. Clicking F11 did not work. I could not function without them. Then, a short time later, they "automatically" reappeared. I have not idea of why the disappeared or reappeared.
    Thank you for any help you can provide.
    Sanford A. Berman

    You can find the Copy, Paste, and Cut buttons next to Firefox > Edit (and in its sub menu) and in the regular Edit menu on the menu bar (press F10 if the menu bar is hidden).
    The buttons next to Firefox > Edit are enabled if there is something to do with them, just like with the toolbar buttons.
    You can find the Copy, Paste, and Cut toolbar buttons in the toolbar palette in the Customize window and drag them on a toolbar.
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
    *http://kb.mozillazine.org/Toolbar_customization
    *https://support.mozilla.com/kb/Back+and+forward+or+other+toolbar+items+are+missing

  • How do i copy, cut and paste on firefox

    How can I copy cut and paste on firefox? I have windows 8! Please Help !!!!!!

    You should just be able to perform these functions as you do in any application by doing one of the following:
    * Select some content, right-click your selection and select 'Copy' or 'Cut' from the menu. To paste, right-click in a text area or input field and select 'Paste'.
    * Select some content and press Ctrl+C to copy or Ctrl+X to cut. To paste, click in an input field or text area and press Ctrl+V.
    In webpages you cannot cut content that is not in a text area or input field, and you cannot paste to somewhere other than a text area or input field. Some sites also use preventative measures to stop (or at least hinder - there is usually some way around it) copying (often to prevent plagiarism).

  • How do I copy music and video from my iPod to a new PC?

    My itunes PC no longer works.  How can I copy music and video from my iPod to a new PC?

    You can't transfer music from an iPod to a PC.  Apple do not provide that facility.  It can be done with third party software though.  There are a variety of these available though so search google for 'ipod to itunes'.

  • Does anyone know how I can copy photo and video files from the Photo's app on my Macbook, to a USB stick or other external back-up?

    I've updated the software on my Macbook to the most recent version; regretting it now; and iPhoto has now become the Photo's app.
    The problem is I can no longer back up my photo and video files taken on my phone, saved to my mac, by copying them and saving them on a USB stick or other external hard drive.
    I could easily do this with iPhoto, but now Photos app does not let me copy the files when I select them.
    Does anyone know if there's a way to save, copy or back-up my photo's and video files: prefreably one that doesn't involve iCloud, as I don't feel like paying for more storage; there must be some way to access those photos/videos from my iPhone to save on another source?

    The problem is I can no longer back up my photo and video files taken on my phone, saved to my mac, by copying them and saving them on a USB stick or other external hard drive.
    Select the photos and videos in Photos and use the command "File > Export"  and select a folder on your USB stick to save the photos to.

  • Material exchane ,copy pricing and conditions from main item to sub item.

    Hi All,
    We are using parts exchange/interchangeability in the transaction ME22N,
    While using ME22N we are exchanging  main item with interchangeable part and while doing so we want to copy pricing and conditions from main item to sub item.
    But its not happening.
    As per sap help its possible, details describe below.
    http://help.sap.com/erp2005_ehp_04/helpdata/en/c2/0a5288b77d11d3bcce00105ab03aee/content.htm
    Price Determination by Copying from Main Item
    In the case of price determination by copying from the main item, the net price of the originally ordered part is still used for the superseding part in a part exchange.
    The system copies all conditions from the main item to all sub-items and takes into account the order quantity for the main item when calculating scale prices. It does not take into account the conditions and scale prices that exist for the interchangeable part.
    You cannot change the conditions, which have been copied from the main item, at sub-item level. It is possible, however, to define additional conditions for each sub-item.
    Prerequisites
    A calculation schema, which can be altered on an individual basis in Customizing, has been supplied for the price determination.
    In the vendor master record, you have set the schema group 09 (interchangeable material).
    But in customizing I didnu2019t find value 09 for schema group .
    Can any buddy through some light on missing pieces which need to be set?
    Thanks
    Regards
    Ritesh

    Hi,
    Can you check few more things and tell me?
    - In this exit, does XVBPA and XVBAP contains all the line items. ( main and sub items ).
    - In Sales order creation time, do these table have VBELN populated when this exit triggers.
    - If you modify XVBPA or XVBAP in this exit, do they get overwritten after that.
    Try this code. See if it works.  Let me know if you still have a problem.
    DATA: wa_hvbpa LIKE vbpa,
          wa_xvbpa like vbpa.
    CLEAR: wa_hvbpa, wa_xvbpa.
    * check if HVBAP and VBAP line items are not same
    IF vbap-posnr <> hvbap-posnr.
    * read the ****-to partner from main-item
      READ TABLE xvbpa INTO wa_hvbpa WITH KEY posnr = hvbap-posnr
                                              parvw = 'WE'.
      IF sy-subrc = 0.
    *   read the line item data for sub-item based on main item
        READ TABLE xvbap WITH KEY posnr = vbap-posnr
                                  uepos = hvbap-posnr.
    * See if current line is the child of that BoM parent
        IF sy-subrc = 0.
          MOVE wa_xvbpa-kunnr TO xvbpa-kunnr.
          MOVE xvbap-vbeln TO wa_xvbpa-vbeln.
          MOVE xvbap-posnr TO wa_xvbpa-posnr.
          MOVE 'WE' TO wa_xvbpa-parvw.
          MODIFY vbpa FROM wa_xvbpa.
        ENDIF.
      ENDIF.
    ENDIF.
    Regards,
    RS

  • What are the major differences b/w live copy blueprint and Language copy of CQ ?

    We are in process of creating a different Language Versions of a Website and trying to figure out the best/recommended approach.
    what are the major differences b/w live copy blueprint and Language copy of CQ ? which one is recommended in which ? any pointers on this would be appreciated.

    The language copy tool is a one-shot tool to create pages under a certain structure. It has a nice UI for it. But that's it.
    The MSM blueprint/livecopy concept is much more powerfull, because it has live connections between the blueprint and the livecopy. It does not only allow you to easily create livecopies, but supports you also in maintaining the relationshop between these. So you can easily detect, that the blueprint page has been updated and needs to be rolled out again. Or that there are conflicts, because both blueprint and livecopy have been updated independently. And so on.
    From my perspective the language copy tool should not be used, because with creation of language pages the "fun" has just started and the real work is just ahead.
    Jörg

  • Difference between copied requisiton and a normal requisition

    Hi
    Is there any way we can find out if a requisition has been created using copy to cart functionality i mean whether it has been copied from old requisition in iProcurement. I want to know the way to distinguish a copied requisition and a normal requisition.
    Please let me know
    Thanks

    possibly burkepm is correct. however you may have a look at parameter old_req_line_id in POR_CUSTOM_PKG. if this were to be the id of line being copied from, then you could flag some attribute column from POR_CUSTOM_PKG
    Thanks
    Anil Passi

Maybe you are looking for

  • Snow Leopard: iCal doesn't show private appointments of as booked !

    Hi Apple-Dev-Team, one HUGE issue with the new Exchange iCal implementation: I cannot see if a collegue has an appointment at a given time because it won't display private entrys!! that's an absolute no-go for any workgroup/team or enterprise using m

  • Trouble opening photos

    I have just made a page on my website for historic weather photos & my weather station info & pics. But when I load the page on my computer, the photos only half open then turn grey. A friend informed me the page is loading fine on their non-mac comp

  • How to unlock my sprint iphone5 with the code provided

    I have this iphone5 given by a friend. Sprint has offered an unlocking code supposedly allows me to use it internationally. But i found nowhere to input such code, and the phone still doesn't recognize my chinese sim card. Could anyone help with this

  • How to publish news without iWeb

    Hello, I would like to know if we can add news directly from the site without using iWeb, like a comment ??

  • DVD's started having wavy moments in them, looks like the water in some scenes are moving,

    The first few DVD's I made of slideshows I created were fine, then one started to have what looked like movement in the water, then if a person was wearing a striped shirt it began to move, then almost every straight line looks like its moving. What'