Urgent Help to fit the image on any mobile.......

i write an application in which i obtained the image fron the unternet and i want to fit that that to the display screen of any mobile forn how can i write the code?how can i get the height an dwidth of mobile display screen where the image is display.image size islarger
thaks in advance

I have had the same issue, but the wheel "comes back" after 5min. I also sent it back for repair, and they "found" nothing wrong. I am about to send it back again and explain further the problem. Sorry cant help - just agree that others have the same problem

Similar Messages

  • Fit the image to window width, window height and  the window size

    hi all
    here we wrote the code for "fit the image to window width, window height and the window size". we are facing some problems in it. and all these operations have to perform even after zooming operations are done.if the below code doesnt satisfy kindly provide appropriate code .
    thanks .
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.io.File;
    import javax.swing.filechooser.FileFilter;
    import java.awt.geom.*;
    public class DP extends JFrame implements ActionListener,
                                               MouseListener,
                                               MouseMotionListener {
        private final int PEN_OP = 1;
        private final int CLEAR_OP = 2;
        private int radius;
        private int radius1;
        private int mousex = 0;
        private int mousey = 0;
        private int prevx = 0;
        private int prevy = 0;
        private boolean initialFreeHand = true;
        private boolean initialLine = true;
        private boolean initialEraser = true;
        private int Orx = 0;
        private int Ory = 0;
        private int OrWidth = 0;
        private int OrHeight = 0;
        private int drawX = 0;
        private int drawY = 0;
        private int polyX = 0;
        private int polyY = 0;
        private int eraserLength = 5;
        private int udefRedValue = 255;
        private int udefGreenValue = 255;
        private int udefBlueValue = 255;
        private int opStatus = PEN_OP;
        private int colorStatus = 1;
        private double zoomPercentage=10;
        private Color mainColor = new Color(0, 0, 0);
        private Color xorColor = new Color(255, 255, 255);
        private Color userDefinedColor =
            new Color(udefRedValue, udefGreenValue,udefBlueValue);
        private JButton openButton = new JButton("open");
        private JButton closeButton = new JButton("close");
         private JButton zoominButton = new JButton("ZoomIn");
         private JButton zoomoutButton = new JButton("ZoomOut");
         private JButton zoomto100Button = new JButton("ZoomTo100");
         private JButton fwwButton = new JButton("Fit window width");
         private JButton fwhButton = new JButton("Fit window height");
         private JButton fwButton = new JButton("Fit the window");
        private JButton clearButton = new JButton("Clear");
        private JTextField colorStatusBar = new JTextField(20);
        private JTextField opStatusBar = new JTextField(20);
        private JTextField mouseStatusBar = new JTextField(10);
        private JPanel controlPanel = new JPanel(new GridLayout(18, 1, 0, 0));
        JToolBar jToolbar = new JToolBar();
        private Container container;
        private JScrollBar horizantalSlide=new JScrollBar();
        public BufferedImage image;
        BufferedImage bgImage;
    //    public ImageIcon icon=null;
        JFileChooser fileChooser;
        DrawPanel drawPanel = new DrawPanel(bgImage,zoomPercentage);
        public DP() {
            super("WhiteBoard");
            fileChooser = new JFileChooser(".");
            container = getContentPane();
            container.setBackground(Color.white);
            container.setLayout(new BorderLayout());
            container.add(jToolbar,BorderLayout.NORTH);
            container.add(horizantalSlide);
            jToolbar.add(openButton);
            jToolbar.add(closeButton);
              jToolbar.add(zoominButton);
              jToolbar.add(zoomoutButton);
              jToolbar.add(zoomto100Button);
              jToolbar.add(fwwButton);
              jToolbar.add(fwhButton);
              jToolbar.add(fwButton);
            jToolbar.add(clearButton);
            colorStatusBar.setEditable(false);
            opStatusBar.setEditable(false);
            mouseStatusBar.setEditable(false);
            controlPanel.setBackground(Color.white);
            drawPanel.setBackground(Color.white);
            container.add(controlPanel, "West");
            container.add(drawPanel, "Center");
            openButton.addActionListener(this);
            closeButton.addActionListener(this);
              zoominButton.addActionListener(this);
              zoomoutButton.addActionListener(this);
              zoomto100Button.addActionListener(this);
              fwwButton.addActionListener(this);
              fwhButton.addActionListener(this);
              fwButton.addActionListener(this);
            clearButton.addActionListener(this);
            drawPanel.addMouseMotionListener(this);
            drawPanel.addMouseListener(this);
            addMouseListener(this);
            addMouseMotionListener(this);
            opStatusBar.setText("FreeHand");
            colorStatusBar.setText("Black");
        public void actionPerformed(ActionEvent e) {
            if(e.getActionCommand().equals("open"))
                showDialog();
            if(e.getActionCommand().equals("close"))
                closeDialog();
              if(e.getActionCommand().equals("ZoomIn"))
                   drawPanel.zoom(1);
              if(e.getActionCommand().equals("ZoomOut"))
                   drawPanel.zoom(-1);
              if(e.getActionCommand().equals("ZoomTo100"))
                   drawPanel.zoom(+10);
              if(e.getActionCommand().equals("Fit window width"))
                   drawPanel.fitwindowwidth();
              if(e.getActionCommand().equals("Fit window height"))
                   drawPanel.fitwindowheight();
              if(e.getActionCommand().equals("Fit the window"))
                   drawPanel.fitthewindow();
            if (e.getActionCommand() == "Clear")
                opStatus = CLEAR_OP;
            switch (opStatus) {
                case CLEAR_OP:
                    clearPanel();
        private void showDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    bgImage = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("IO error: " + e.getMessage());
                clearPanel();
        private void closeDialog() {
            drawPanel.setVisible(false);
            drawPanel.repaint();
        public void clearPanel() {
            opStatusBar.setText("Clear");
            Graphics g = image.getGraphics();
            g.setColor(drawPanel.getBackground());
            g.fillRect(0, 0, drawPanel.getBounds().width, drawPanel.getBounds().height);
            if(bgImage != null)
                g.drawImage(bgImage, 0, 0, this);
            g.dispose();
            drawPanel.repaint();
        public boolean mouseHasMoved(MouseEvent e) {
            return (mousex != e.getX() || mousey != e.getY());
        public void setActualBoundry() {
            if (mousex < Orx || mousey < Ory) {
                if (mousex < Orx) {
                    OrWidth = Orx - mousex;
                    drawX = Orx - OrWidth;
                } else {
                    drawX = Orx;
                    OrWidth = mousex - Orx;
                if (mousey < Ory) {
                    OrHeight = Ory - mousey;
                    drawY = Ory - OrHeight;
                } else {
                    drawY = Ory;
                    OrHeight = mousey - Ory;
            } else {
                drawX = Orx;
                drawY = Ory;
                OrWidth = mousex - Orx;
                OrHeight = mousey - Ory;
        public void setGraphicalDefaults(MouseEvent e) {
            mousex = e.getX();
            mousey = e.getY();
            prevx = e.getX();
            prevy = e.getY();
            Orx = e.getX();
            Ory = e.getY();
            drawX = e.getX();
            drawY = e.getY();
            OrWidth = 0;
            OrHeight = 0;
        public void mouseDragged(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseReleased(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseEntered(MouseEvent e) {
            updateMouseCoordinates(e);
        public void updateMouseCoordinates(MouseEvent e) {
            String xCoor = "";
            String yCoor = "";
            if (e.getX() < 0)
                xCoor = "0";
            else {
                xCoor = String.valueOf(e.getX());
            if (e.getY() < 0)
                xCoor = "0";
            else {
                yCoor = String.valueOf(e.getY());
            mouseStatusBar.setText("x:" + xCoor + " y:" + yCoor);
        public void mouseClicked(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseExited(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseMoved(MouseEvent e) { updateMouseCoordinates(e); }
        public void mousePressed(MouseEvent e) { updateMouseCoordinates(e); }
        public static void main(String[] args) {
            DP wb = new DP();
            wb.setDefaultCloseOperation(EXIT_ON_CLOSE);
            wb.setSize(1024,740);
            wb.setVisible(true);
        private class DrawPanel extends JPanel {
            private double m_zoom = 1.0;
            private double m_zoomPercentage;
            private BufferedImage m_image;
            double theta = 0;
            double thetaInc = Math.PI/2;
            public DrawPanel(BufferedImage imageb,double zoomPercentage) {
                m_image = imageb;
                m_zoomPercentage = zoomPercentage / 100;
            protected void paintComponent(Graphics g) {
                Graphics2D g2d=(Graphics2D)g;
                if(image == null)
                    initImage();
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                     RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                double x = (1.0 - m_zoom)*getWidth()/2.0;
                double y = (1.0 - m_zoom)*getHeight()/2.0;
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                at.rotate(theta,m_zoom*getWidth()/2,m_zoom*getHeight()/2);
                at.scale(m_zoom, m_zoom);
                g2d.drawRenderedImage(image, at);
      public void zoom(int inc) {
            m_zoom += inc * m_zoomPercentage;
            repaint();
              public void fitwindowwidth()
                int w1=drawPanel.getWidth();
                int h1=drawPanel.getHeight();
                BufferedImage image2=image.getScaledInstance(w1,h1,Image.SCALE_DEFAULT);
                drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
               drawPanel.repaint();
              public void fitwindowheight()
           BufferedImage image2=image.getScaledInstance(500,680,1); 
           drawPanel.setImage(iicon);
           drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
           drawPanel.repaint();
              public void fitthewindow()
           BufferedImage image2=image.getScaledInstance(1000,680,1);
           drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
           drawPanel.repaint();
            private void initImage() {
                int w = getWidth();
                int h = getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(getBackground());
                g2.fillRect(0,0,w,h);
                g2.dispose();
    }

    thank you for giving reply.
    your code is very helpful to us.but i couldn't integrate it in my code.here's my code.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.io.File;
    import javax.swing.filechooser.FileFilter;
    import java.awt.geom.*;
    public class IS extends JFrame implements ActionListener,
                                               MouseListener,
                                               MouseMotionListener {
        private final int PEN_OP = 1;
        private final int CLEAR_OP = 2;
         private     final int DISTORT = 3;
        private final int SCALE   = 4;
        private final int FIT     = 5;
        private final int FILL    = 6;
        int scaleMode = SCALE;
        private int radius;
        private int radius1;
        private int mousex = 0;
        private int mousey = 0;
        private int prevx = 0;
        private int prevy = 0;
        private boolean initialFreeHand = true;
        private boolean initialLine = true;
        private boolean initialEraser = true;
        private int Orx = 0;
        private int Ory = 0;
        private int OrWidth = 0;
        private int OrHeight = 0;
        private int drawX = 0;
        private int drawY = 0;
        private int polyX = 0;
        private int polyY = 0;
        private int eraserLength = 5;
        private int udefRedValue = 255;
        private int udefGreenValue = 255;
        private int udefBlueValue = 255;
        private int opStatus = PEN_OP;
        private int colorStatus = 1;
        private double zoomPercentage=10;
        private Color mainColor = new Color(0, 0, 0);
        private Color xorColor = new Color(255, 255, 255);
        private Color userDefinedColor =
            new Color(udefRedValue, udefGreenValue,udefBlueValue);
        private JButton openButton = new JButton("open");
        private JButton closeButton = new JButton("close");
         private JButton zoominButton = new JButton("ZoomIn");
         private JButton zoomoutButton = new JButton("ZoomOut");
         private JButton zoomto100Button = new JButton("ZoomTo100");
         private JButton fwwButton = new JButton("Fit window width");
         private JButton fwhButton = new JButton("Fit window height");
         private JButton fwButton = new JButton("Fit the window");
        private JButton clearButton = new JButton("Clear");
        private JTextField colorStatusBar = new JTextField(20);
        private JTextField opStatusBar = new JTextField(20);
        private JTextField mouseStatusBar = new JTextField(10);
        private JPanel controlPanel = new JPanel(new GridLayout(18, 1, 0, 0));
        JToolBar jToolbar = new JToolBar();
        private Container container;
        private JScrollBar horizantalSlide=new JScrollBar();
        public BufferedImage image;
        BufferedImage bgImage;
    //    public ImageIcon icon=null;
        JFileChooser fileChooser;
        DrawPanel drawPanel = new DrawPanel(bgImage,zoomPercentage);
        public IS() {
            super("WhiteBoard");
            fileChooser = new JFileChooser(".");
            container = getContentPane();
            container.setBackground(Color.white);
            container.setLayout(new BorderLayout());
            container.add(jToolbar,BorderLayout.NORTH);
            container.add(horizantalSlide);
            jToolbar.add(openButton);
            jToolbar.add(closeButton);
              jToolbar.add(zoominButton);
              jToolbar.add(zoomoutButton);
              jToolbar.add(zoomto100Button);
              jToolbar.add(fwwButton);
              jToolbar.add(fwhButton);
              jToolbar.add(fwButton);
            jToolbar.add(clearButton);
            colorStatusBar.setEditable(false);
            opStatusBar.setEditable(false);
            mouseStatusBar.setEditable(false);
            controlPanel.setBackground(Color.white);
            drawPanel.setBackground(Color.white);
            container.add(controlPanel, "West");
            container.add(drawPanel, "Center");
            openButton.addActionListener(this);
            closeButton.addActionListener(this);
              zoominButton.addActionListener(this);
              zoomoutButton.addActionListener(this);
              zoomto100Button.addActionListener(this);
              fwwButton.addActionListener(this);
              fwhButton.addActionListener(this);
              fwButton.addActionListener(this);
            clearButton.addActionListener(this);
            drawPanel.addMouseMotionListener(this);
            drawPanel.addMouseListener(this);
            addMouseListener(this);
            addMouseMotionListener(this);
            opStatusBar.setText("FreeHand");
            colorStatusBar.setText("Black");
        public void actionPerformed(ActionEvent e) {
            if(e.getActionCommand().equals("open"))
                showDialog();
            if(e.getActionCommand().equals("close"))
                closeDialog();
              if(e.getActionCommand().equals("ZoomIn"))
                   drawPanel.zoom(1);
              if(e.getActionCommand().equals("ZoomOut"))
                   drawPanel.zoom(-1);
              if(e.getActionCommand().equals("ZoomTo100"))
                   drawPanel.zoom(+10);
              if(e.getActionCommand().equals("Fit window width"))
                   //drawPanel.fitwindowwidth();
              drawPanel.scaleImage(0,0,0,0);
              if(e.getActionCommand().equals("Fit window height"))
              drawPanel.scaleImage(0,0,0,0);
              if(e.getActionCommand().equals("Fit the window"))
              drawPanel.scaleImage(0,0,0,0);
            if (e.getActionCommand() == "Clear")
                opStatus = CLEAR_OP;
            switch (opStatus) {
                case CLEAR_OP:
                    clearPanel();
        private void showDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    bgImage = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("IO error: " + e.getMessage());
                clearPanel();
        private void closeDialog() {
            drawPanel.setVisible(false);
            drawPanel.repaint();
        public void clearPanel() {
            opStatusBar.setText("Clear");
              int w = image.getWidth();
            int h = image.getHeight();
            Graphics g = image.getGraphics();
            g.setColor(drawPanel.getBackground());
            g.fillRect(0, 0, w, h);
            if(bgImage != null) {
                int x = (w - bgImage.getWidth())/2;
                int y = (h - bgImage.getHeight())/2;
                g.drawImage(bgImage, x, y, this);
            g.dispose();
            drawPanel.repaint();
        public boolean mouseHasMoved(MouseEvent e) {
            return (mousex != e.getX() || mousey != e.getY());
        public void setActualBoundry() {
            if (mousex < Orx || mousey < Ory) {
                if (mousex < Orx) {
                    OrWidth = Orx - mousex;
                    drawX = Orx - OrWidth;
                } else {
                    drawX = Orx;
                    OrWidth = mousex - Orx;
                if (mousey < Ory) {
                    OrHeight = Ory - mousey;
                    drawY = Ory - OrHeight;
                } else {
                    drawY = Ory;
                    OrHeight = mousey - Ory;
            } else {
                drawX = Orx;
                drawY = Ory;
                OrWidth = mousex - Orx;
                OrHeight = mousey - Ory;
        public void setGraphicalDefaults(MouseEvent e) {
            mousex = e.getX();
            mousey = e.getY();
            prevx = e.getX();
            prevy = e.getY();
            Orx = e.getX();
            Ory = e.getY();
            drawX = e.getX();
            drawY = e.getY();
            OrWidth = 0;
            OrHeight = 0;
        public void mouseDragged(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {
        public void mouseReleased(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseEntered(MouseEvent e) {
            updateMouseCoordinates(e);
        public void updateMouseCoordinates(MouseEvent e) {
            String xCoor = "";
            String yCoor = "";
            if (e.getX() < 0)
                xCoor = "0";
            else {
                xCoor = String.valueOf(e.getX());
            if (e.getY() < 0)
                xCoor = "0";
            else {
                yCoor = String.valueOf(e.getY());
            mouseStatusBar.setText("x:" + xCoor + " y:" + yCoor);
        public void mouseClicked(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseExited(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseMoved(MouseEvent e) { updateMouseCoordinates(e); }
        public void mousePressed(MouseEvent e) { updateMouseCoordinates(e); }
        public static void main(String[] args) {
            IS wb = new IS();
            wb.setDefaultCloseOperation(EXIT_ON_CLOSE);
            wb.setSize(1024,740);
            wb.setVisible(true);
        private class DrawPanel extends JPanel {
            private double m_zoom = 1.0;
            private double m_zoomPercentage;
            private BufferedImage m_image;
            double theta = 0;
            double thetaInc = Math.PI/2;
            public DrawPanel(BufferedImage imageb,double zoomPercentage) {
                m_image = imageb;
                m_zoomPercentage = zoomPercentage / 100;
            protected void paintComponent(Graphics g) {
                   super.paintComponent(g);
                Graphics2D g2d=(Graphics2D)g;
                if(image == null)
                    initImage();
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                     RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                              int w = getWidth();
                    int h = getHeight();
                  int iw = image.getWidth();
                  int ih = image.getHeight();
                  if(scaleMode == SCALE) {
                double x = (w - m_zoom*iw)/2;
                double y = (h - m_zoom*ih)/2;
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                at.rotate(theta,m_zoom*getWidth()/2,m_zoom*getHeight()/2);
                at.scale(m_zoom, m_zoom);
                g2d.drawRenderedImage(image, at);
                   else {
                scaleImage(w, h, iw, ih);
              private void scaleImage( int w, int h, int iw, int ih) {
                             Graphics2D g2d = image.createGraphics();
            double xScale = (double)w/iw;
            double yScale = (double)h/ih;
            AffineTransform at = new AffineTransform();
            if(scaleMode == DISTORT) {
                double x = (w - xScale*iw)/2;
                double y = (h - yScale*ih)/2;
                at.setToTranslation(x, y);
                at.scale(xScale, yScale);
            } else {
                double scale = (scaleMode == FIT) ? Math.min(xScale, yScale)
                                                  : Math.max(xScale, yScale);
                double x = (w - scale*iw)/2;
                double y = (h - scale*ih)/2;
                at.setToTranslation(x, y);
                at.scale(scale, scale);
            g2d.drawRenderedImage(image, at);
      public void zoom(int inc) {
            m_zoom += inc * m_zoomPercentage;
            repaint();
            private void initImage() {
                int w = getWidth();
                int h = getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(getBackground());
                g2.fillRect(0,0,w,h);
                g2.dispose();
    }

  • When I try to print an jpeg or png from Photoshop all it does is convert the image to a PDF & plop it on my desktop- it won't print the image. Any suggestions as to how to fix this?

    When I try to print an jpeg or png from Photoshop all it does is convert the image to a PDF & plop it on my desktop- it won't print the image. Any suggestions as to how to fix this?

    Yes, the printer is on, it’s selected in Printer Set-Up & I’ve never had this problem before. It’s definitely a Photoshop issue as every other type of file prints fine. I’ve uninstalled Pshop & am now reinstalling. Hope that will do the trick.

  • Can't get my audio clip to work in Keynote except in edit mode. I've followed Help instructions to the letter. Any suggestions?

    Can't get my audio clip to work in Keynote except in edit mode. I've followed Help instructions to the letter. Any suggestions?

    Hi Gary - thanks so much for your help. I'd already done that, but finally stumbled across the answer for my situation. I'm new to iMac and this is the first time I used Keynote, so maybe this info will help someone else along the way - I still haven't found this in any of the Keynote documentation or forums I've read.
    My slides were all set up with at least one text box in which the text was animated. The sound was the last thing I added to each slide, exactly following the info in Keynote Help re: adding audio. The audio would work when I tested it in Inspector mode, and also if I switched to soundtrack instead. But not if sound was added to each individual slide. Hmmm. After I submitted the question above, I was running through the (auto) slide show one final time to check text, animation, etc. when I noticed that on just one single slide the sound effect came through, but at the very tail end of the slide. Hmm again. Why?
    Through trial & error, the answer was in the animation section - not very intuitive re: audio. The steps to correct the issue were: 1) click on the sound icon embedded in each slide, 2) click on the animation tab in Inspector. 3) There's a drop-down menu there that allows you to reposition the audio clip to the #1 spot (if it was added after other "animation"). This allows the sound to begin before the text animation begins on each slide. Before doing this, I guess the sound was in there but the slides were transitioning before it had a chance to play.
    Since this is the first time I've used Keynote and it's the most recent version, I'm not sure if this is a new feature to allow users to choose where within a slide to play a sound effect, but I'm guessing that might be why was unable to find any info on how to solve it. Hopefully this will help others who get stumped.
    Thanks again for jumping in to help! I really appreciate it.

  • Working Backwards - is the image in any Indesign Documents?

    Hi guys
    Here at my place of work IT are continually trying to keep the amount of data on our network as low as possible.
    To do this they produce a large files report and a duplicate files report.
    Using indesign and packaging files as we do, we are quite often culprits of the large files or more often than not duplicate files.
    Because it isn't just us that has access to our images etc we feel we have to package our documents because of the risk of a file being moved or deleted and therefore losing its link to indesign.
    My question is this:  If we have an image, a jpg for example, is there a way of seeing any indesign files that that is linked to?  This way, if we have a large image file, we can see if it is connected to any of our indesign files and then if not, reduce / delete it without the fear of affecting any documents.
    Thanks
    Si

    The other way around, yes, you can find links to InDesign files through
    Bridge. This way, no.
    Bob
    SimonLaughton <mailto:[email protected]>
    Thursday, December 13, 2012 10:44 AM
    >
          Working Backwards - is the image in any Indesign Documents?
    created by SimonLaughton
    <http://forums.adobe.com/people/SimonLaughton> in /InDesign/ - View
    the full discussion <http://forums.adobe.com/message/4918461#4918461

  • Make the panel fit the image so MouseListener only invoke when click  image

    I want to add MouseListener to only the image itself. So I draw the image onto a image panel, add that panel onto the main panel, then add the main panel onto the frame. However, my problem is that the size of my image panel is too large, it take up almost the entire frame. So my mouselistener response not only when I click onto the image, but also anywhere in my image panel. I try to resize the image panel to fit the size of my image, but no luck. Is there a solution for this. I feel like, it got something to do with the layout. Here is my code, if you mind read it. Thank you very much
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Toolkit;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import javax.swing.*;
    public class ImageRotate
         private static final String LABEL = "MIDI PROTOCOL";
         private JPanel mainPanel = new JPanel();
         private JPanel labelPanel = new JPanel();
         public ImageRotate()
              mainPanel.setOpaque(true);
              mainPanel.setBackground(Color.YELLOW);
              mainPanel.setLayout(new BorderLayout());
              Font labelFont = new Font("serif", Font.BOLD, 30);
              createLabelPanel(LABEL, labelFont);
              labelPanel.setOpaque(false);
              mainPanel.add(labelPanel, BorderLayout.NORTH);
              Drawing d = new Drawing();
              d.setOpaque(true);
              d.addMouseListener(new MouseAdapter(){
                   public void mousePressed(MouseEvent e)
                        System.out.println("Pressing on the image");
              d.addMouseMotionListener(new MouseAdapter(){
                   public void mouseDragged(MouseEvent e)
                        System.out.println("Dragging the image");
                   public void mouseMoved(MouseEvent e)
              mainPanel.add(d, BorderLayout.CENTER);
         private void createLabelPanel(String str, Font font)
              JLabel label = new JLabel(str);
              label.setFont(font);
              label.setForeground(Color.RED);
              labelPanel.add(label);
         public JPanel getPanel()
              return mainPanel;
         public static void main(String args[])
              JFrame frame = new JFrame();
              frame.getContentPane().add(new ImageRotate().getPanel());
              frame.setSize(new Dimension(300, 300));
              frame.setVisible(true);
    class Drawing extends JPanel
         Image img;
         public Drawing()
              setSize(new Dimension(100,100));     //Try to make the panel fit the image...NO LUCK
              setBackground(Color.GREEN);     
              img = Toolkit.getDefaultToolkit().createImage("images/nob.gif");
         public void paintComponent(Graphics g)
              super.paintComponent(g);
              Graphics2D g2D = (Graphics2D)g;
              g2D.drawImage(img, 40, 40, this);
    }

    yunaeyes wrote:
    In class Drawing extends JPanel, I did try to to set the panel to the image size but no luck there,
    both setSize(new Dimension(100,100)), setPreferredSize(new Dimension(100,100)) does not make the panel smallerIt can be made to work. I find it hard to comment on unseen code.
    >
    BigDaddyLoveHandles wrote:
    I think a better approach is to handle the mouse click properly -- see if the click is over the image or not.Can you elaborate on this?The mousePressed method you posted assumes you are over the image. Check the mouse coordinates! If the component is bigger than the image this may not be so.

  • Whenever I play youtube videos on my apple tv the youtube logo and menus are superimposed on the image.  Any suggestions how to see just the video?

    I am unable to figure out how to view a youtube video without the youtube logo and the menus superimposed over the image.  Any suggestions?

    Found the answer on my own; restart apple TV and menus no longer appear over videos and while playing music.  However, viewing streaming video on airplay is not ideal.  Sometimes the image freezes on the TV while it continues on my macbook.  Also, sometimes the sound comes from the tv speakers; other times it comes only from the computer.  Never know what will happen when I watch a streaming video. 

  • Need help to fit the records of a table into a particular region

    Hi All,
    Need help in getting the records of table to be fitted into a particular region provided for it. But in my case as the records increases the textbox below are moving down accordingly into next page that i dont want.  
    As shown in the below image i have to fit 22 no. of records in that given area only not disturbing the below textbox alignments.
    Thank in advance...
    Sreekanth Note: Please vote/mark the post as answered if it answers your question/helps to solve your problem.*****

    Hello,
    In SSRS, Report items within a report can be
    kept together on a single page implicitly or explicitly by setting the keep with group or keep together properties.
    In your case, you can try to specify the "KeepTogether" property to True on the Table properties windows.
    If there are other report items  under or above the Table and you want keep all items on the single page, you can try to add a Rectangle and put all items into the Rectangle.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • How to fit the images within textframe in indesign using javascript?

    Hi,
    We are using the update script for updating the values in table.
    If i am using images within textframe, the table is not fitting after updating it. Without using images the table is fitting.
    First i have dragged the table in Indesign document. Then i have altered the image size and updated the table using Update script.
    Finally i want to fit the table with the resized images.
    Note: I can get the updated values in table . but i cannot get the resized images.( Now i can get the original image after updating the table)
    Please help me if anyone has idea regarding this issue.
    Thanks,
    Vimala L

    Hi,
    Please find below the Update Script,
    var myDocument = app.activeDocument;
    var updateOption = app.scriptArgs.get("updateOption");
    main();
    function main()
    if(updateOption=="UPDATE")
      UpdateLink();
    function UpdateLink()
    myDoc = app.activeDocument;
    myLinks = myDoc.links;
    for (j = myLinks.length - 1; j >= 0; j--)
    myName = myLinks[j].filePath;
      var ext =  myName.substring(myName.length-3,myName.length) ;
    if (myLinks[j].status == LinkStatus.linkOutOfDate)
    myLinks[j].update();
    After running this script i cannot get the image in table.
    While running the Fitting script followed by Update script i am getting the Original size of the image. But i want the re-sized image in table.
    Fitting Script:
    var textFitoption= app.scriptArgs.get("textFitOption");
    var imageFitoption= app.scriptArgs.get("imageFitOption");
    var tableFitoption= app.scriptArgs.get("tableFitOption");
    main();
    function main()
      IterateDocument();
    function IterateDocument()
      for(myCounter = 0; myCounter < app.activeDocument.activeLayer.textFrames.length; myCounter++)
      myStory = app.activeDocument.activeLayer.textFrames.item(myCounter);
      FitPageItem (myStory);
    function FitPageItem (mySel)
      if(mySel.associatedXMLElement!=null)
    if (mySel.constructor.name == "TextFrame")
      if(mySel.associatedXMLElement.xmlAttributes.itemByName("IMAGE_FILE")==null)
    mySel.parentStory.clearOverrides();
      mySel.parentStory.appliedCharacterStyle = app.activeDocument.characterStyles.add()
      mySel.parentStory.appliedCharacterStyle.remove();
    //Fit all inline Items
      graphicItems = mySel.allGraphics;             // I cannot get the graphicItems.
      for(g=0;g<graphicItems.length;g++)
      if(imageFitoption=="Fit Frame To Content")
      graphicItems[g].fit(FitOptions.frameToContent);
      else if(imageFitoption=="Fit Content Proportionally")
      graphicItems[g].fit(FitOptions.proportionally);
      }//for
      }//Has image_file attr
      }//is text frame
       if(mySel.associatedXMLElement.markupTag.name=="products")
      if(IsImageEmbeddedInTable(mySel)==true)
      xmlElem = mySel.associatedXMLElement;
      mySel.placeXML(xmlElem);
      }//if products
    function IsImageEmbeddedInTable(mySel)
      for( var j = 0; j< mySel.tables.length ; j++ )
      table = mySel.tables[j];
      for( var i = 0 ; i< table.cells.length ;i++ )
      cell= table.cells[i];
      cellElement = cell.associatedXMLElement;
      if(cellElement !=null)
      if(cellElement.xmlElements!=null)
      if(cellElement.xmlElements.count()>0)
      if(cellElement.xmlElements[0].xmlAttributes.itemByName("href")!=null)
      return true;
    Thanks,
    Vimala L

  • Need urgent help ..save BMP image

    I have a BMP image .I m extracting its pixels (using PixelGrabber)and formatting those values as per requirements.
    Now,I have to create an image using this pixels array again.
    Image img;
    img = createImage(new MemoryImageSource(iw,ih,pixels,0,iw)) ;This is creating an[b] image "img" of type Image.
    Now,I have to save this image as BMP.
    for this I am using
    ImageIO.write(img,"BMP",new File("a.bmp"));The problem is this[b] write method require an image of type Buffered Image.
    I am not able to typecast an object of type Image into BufferedImage.
    BufferedImage is subclass of Image class..
    I just hope i m making sense..
    Please help me..
    Is there any other way too to save an BMP image created by createImage()

    Thnx a lot for help I used a method u told me ...
    here is the code i hve:
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.imageio.*;
    import java.awt.image.*;
    import java.awt.image.PixelGrabber;
    import javax.imageio.ImageIO;
    public class RecreateImage2
            public static void main(String args[])
                    ImageFrame frame = new ImageFrame();
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    frame.setVisible(true);
    class ImageFrame extends JFrame
            public ImageFrame()
                 Toolkit kit=Toolkit.getDefaultToolkit();
              Dimension screenSize=kit.getScreenSize();
              int screenHeight=screenSize.height;
              int screenWidth=screenSize.width;
              setSize(screenWidth/2,screenHeight/2);
              setLocation(screenWidth/4,screenHeight/4);
              setTitle("Centered Frame");
              ImagePanel1 panel=new ImagePanel1();
                 add(panel);                                     
    class ImagePanel1 extends JPanel
            Image img;
            public ImagePanel1()
                    try
                   Image image;
                   Dimension d;
                   int iw,ih;
                            image = ImageIO.read(new File("bug_apple.bmp"));
                   iw = image.getWidth(null);
                   ih = image.getHeight(null);
                            int pixels[] = new int[ih*iw];
                   PixelGrabber pg = new    PixelGrabber(image,0,0,iw,ih,pixels,0,iw);
                            pg.grabPixels();
                            img = createImage(new MemoryImageSource(iw,ih,pixels,0,iw));      
                   BufferedImage bi = new BufferedImage(iw,ih,BufferedImage.TYPE_INT_ARGB)
                   Graphics2D g2d = bi.createGraphics();
                      g2d.drawImage(img, 0, 0, null);
                      g2d.dispose();
                   img=bi;
                   ImageIO.write(img,"BMP",new File("a.bmp")) ;          
                    catch(InterruptedException e)
                    catch(IOException e)
                            e.printStackTrace();
    }Its giving error ...saying
    cannot find method write(java.awt.Image,java.lang.String,java.io.File)But If i use Method
    ImageIO.write((BufferedImage)img,"BMP",new File("a.bmp")) ;It saves the Image as "a.bmp" but preview of image is not available...
    Please help me..I really dono whr the proplem is..
    richa_sharma

  • How to download all the images of any website?

    I am developing an application in which a URL needs to specified for downloading all images of that website..
    Please help me out which java classes will be used for this purpose and how to proceed initially??.
    Thanks..

    rav_ahj wrote:
    I need to extract all the images from that website without clicking the links and saving every file manually...Is this possible using Urlconnection class??..Yes. URLConenction can download any URL you provide, or at least try to. How you get that URL, e.g. by searching for IMG tags, that's for you to solve.

  • Help! Urgent help required for adjusting image

    Hi - hoping someone can help.
    I sent the attached PDF -  http://www.sensecreative.co.uk/custUploads/SENSE-36-7977-95928/77317/SENSE-36-7977-95928-7 7317-2440.zip - to print with Sense Creative. The cards were printed and they've turned out quite visibly green on the reverse (where it should be white).
    I've printed the artwork on several printers I have access to and it looks as it should, however SC are saying that the issue is with the artwork
    "The green tinge you see on the reverse of these cards is prevalent in the artwork. The makeup of the background is approximately c-15 m-11 y-15 k-0. the predominant levels of the yellow and cyan will give you the green tint. Upping the levels of the artwork in or substituting the cyan, magenta and yellow levels with more black in Photoshop will likely give you the result you require. We are satisfied that in both instances, the artwork has printed correctly and the colours are well within tolerance given the nature of the artwork."
    So, I'm in a bit of a pickle as the cards are needed for an event next week.
    How do I change the image levels? Or are they talking nonsense and trying to pass the buck?
    Help!

    station_two,
    Acrobat View> Tools> Print Production> Output Preview: Object Inspector will call out the objects' profiles if you click on each one individually (in this case all appeaar to be "Device CMYK" or Untagged CMYK)
    untagged CMYK has the same pitfalls as untagged RGB... if one applys or assumes the wrong SOURCE PROFILE it doesn't CONVERT colors to Monitor RGB or Print Space correctly

  • Firefox is not displaying all the images on any of the websites that I access. I upgraded to 4.0 and it worked correctly for about a day and then reverted back to the problem.

    When I open a website using Firefox it displays the text but none of the graphics. I upgarded to 4.0 and it was temporarily corrected. Now it has reverted to no graphics,

    Hi there,
    I have the same issue: FireFox is not showing all images on the page.
    Noticed this in FireFox 5.0. Now I installed FireFox 5.0.1 and still have the same issue.
    The missing images do not even appear in Tools > Page Info > Media.
    The images are usually accessed using DIV tag with a CSS class which contains background-image style. Often, when page opens, the DIV is initially hidden, and JavaScript displays it. Sometimes, jQuery.html() adds such DIV tags, and images rarely appear. Sometimes they do, but more often they do not.
    If I install FireBug and use Inspect Element to find such a DIV, it is there, it contains the CSS class, the definition of the CSS class contains background-image style. If I click the icon to disable this style, and then click it again to enable it, the image immediately shows up.
    Seems to be caused by some optimization which does not detect images like these.
    Hope this helps you reproduce it.

  • Urgent help needed.....any help appreciated....

    q, Design and implement a java class called statistics that computes the mean, median, standard deviation. Design and implement a java application called statisticsDriver that generates a list of 50 integers (generated randomly) and prints the statistical measures which are calculated using the Statistis Class. Assume there will be no more then 50 input values. Compute all statical values as floating values.
    The above was the question, and below is what i have done so far for the mean part, but it seems to have errors, any help???
    p.s I am also confused what it means by driver class, and do i have to do individual classes for the different statistical measures....please helppppp !!!!!!!!!!, any help would be appreciated...thanks.
    The class say Mean contains the following method:
    public static double mean(double[] data)
    double sum=0.0;
    for (int index=0; index sum=sum+data[index];
    sum=sum/data.length;
    return sum;
    The driver for this class:
    public static void main(java.lang.String[] args) {
    double[] myData={2,5,4,6,7,13};
    System.out.println("The mean of myData");
    System.out.println(Mena.mean(myData));

    This is my method to work out the mean,median and mode of a set of numbers.
    But what i need to do is find the mean, median and mode from a driver class, which generates a list of random numbers, no more then 50. I don't know where to fit this in my method...please help!!!!!!
    main:
    public static void main(String[] args) {
    int[] mainArray = {2,3,6,6,6};
    //outputArray( "Original Array: ",mainArray );
    System.out.println("average is " + mean( mainArray ));
    System.out.println("median is " + median( mainArray ));
    System.out.println("mode is " + mode( mainArray ));
    //mean
    public static double mean(int[] mainArray) {
    int sum = 0;
    for (int i = 0; i < mainArray.length; i++) {
    sum = sum + mainArray;
    double average = sum / mainArray.length;
    return average;
    //median
    public static int median(int[] mainArray) {
    //double sortList = sort(mainArray);
    final int EVEN_NUMBER_OF_ELEMENTS = 0;
    int result = mainArray.length % 2;
    int median = 0;
    // Definition: Median is the Middle number in an odd number of entries array
    // Median is the avg of the two number in the center of an even number array
    if (result == EVEN_NUMBER_OF_ELEMENTS) {
    int rightNumber = mainArray.length / 2;
    int leftNumber = rightNumber - 1;
    median = (mainArray[rightNumber] + mainArray[leftNumber]) / 2;
    else { // Odd number of items, choose the center one
    int rightNumber = mainArray.length / 2;
    median = mainArray[rightNumber];
    return median;
    //mode
    public static double mode(int[] mainArray)
    int mode = 0;
    int elements = 0;
    int tempMode = mainArray[0];
    int temp = 1;
    int x;
    for( x = 1; x < mainArray.length; x++)
    if(mainArray[x-1] == mainArray[x])
    temp++;
    else
    if(temp > elements)
    tempMode = mainArray[x-1];
    elements = temp;
    temp = 1;
    else
    temp = 1;
    if (temp> elements)
         tempMode = mainArray[x-1];
    mode = tempMode;
    return mode;
    any help appreciated..

  • Need Urgent help in downloading the pkg from Sunfreeware

    Hi all,
    I am trying to down load few pkgs from Sunfreeware.
    On the site I see 2 sets of pkgs for the same pkg.
    one which ends with local.gz & the other one with .gz ( which is a source code)
    Which one do I download & how do I add it using the pkgadd command.
    I know the cmd but don't know which one to download & how to proceed.
    PLEASE HELP ME , I HAVE SPENT A LOT OF TIME ON THIS BUT NO RESULTS.
    Thanks in advance

    Also, I'd recommend you try compiling some of these packages yourself (especially if you haven't done any earlier) --- it really goes a long way to help build some tools/software that aren't in the System V pkg format. : )

Maybe you are looking for