Stretch image

Do you know how to stretch an image according to the size of the screen?

What exactly do you mean? Do you mean the screen area(how many pixels wide and tall the screen is) or the component you're drawing onto?
The Graphics class has several methods that you can use to draw an image in different sizes. They are all drawImage, and take increasing numbers of properties. The first one simply takes an image, an x, a y, and draws the image at its stored size. The one with the most number of parameters draws a specific region of the image to a certain spot at any size.
The GraphicsDevice, GraphicsEnvironment, and GraphicsConfiguration classes could all be useful for determining the screen size. Unfortunately I don't have much experience in this area, so I'm not sure exactly what you should do.
Ha, ha, you can't say ass

Similar Messages

  • Image placeholder - how not to stretch images by default

    Captivate 8.0.1.242 - Windows 7
    How do I make the image placeholder to not to stretch images by default and rather when I add the image using the + symbol, it should maintain the aspect ratio of the image and resize only based on either width or height?
    Or still maintain aspect ratio of the image but crop of the excess beyond the current placeholder size.
    I want this by default as when I create my courses, my images vary in aspect ratios and sizes quite a bit. Thus investing time on each image through "edit image" in the properties isn't efficient.

    Do you have any suggestions for what I can do instead? I just don't want to spend couple of minutes for each picture which obviously gets multiplied for each of the 3 different responsive views. This is lead to hours wasted for each course work. Am I forced to find only pictures of same aspect ratio and size for the future or is there any workaround?

  • DR-5020 Stretching Image issue

    Hi All,
    I just replaced all of the rollers in my Canon DR-5020 Document scanner and now it stretches the image.  Does anyone have an idea on what could be stretching the image?
    Thanks.

    Hi garthecollc.
    Stretched images are usually caused by worn rollers.  Since you have recently replaced the rollers, this indicates that the rollers may have not been installed correctly.  It is recommended that the rollers for the imageFORMULA DR-5020C be installed by a Canon Authorized Service Technician.
    I recommend contacting our Digital Printing and Imaging Solutions telephone technical support group for further information.  Please call 1-800-OK-CANON (1-800-652-2666).
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Stretching image to snap to preestablished paths or guides.

    Hi, everyone.
    I have an important task at hand and don't know how to do it in Photoshop. I hope my explanation will make sense. Here is my situation:
    I have an existing image that I must stretch (using whatever tools are best for this) so that this image assumes the shape or contour of some pre-existing guides I will scan into Photoshop. Just imagine, for the sake of simplicity, that I have an image with 6 circles. The circles are orange inside and red outside. This image has been brought into Photoshop with a digital camera. I also have oval or elliptical contours on a printed book that I must scan and convert to a path or guides. The oval or elliptical contours are also 6 in number and laid side by side just like the circles. Here are the questions I have:
    1. What is the best way to bring these elliptical shapes into Photoshop ? How can I transform them into guides or paths so that I can stretch the circles and have them snap to the elliptical guides to match their shape ?
    2. Can an image snap to a guide located on a separate layer ? In other words, if I place the scanned elliptical shapes on a different layer, will I be able to stretch the circles so that they snap to these elliptical guides ?
    3. As I stretch the circles to transform them into ellipses I need the transition from borders between the circles (orange) and background (red) to maintain their appearance (the transition is a somewhat smooth graduation and not a harsh one. What is the best tool for this job ?
    4. I need the elliptical shapes to be connected but also individually manipulated. In other words, if necessary I need to be able to scale all elliptical shapes together so each maintains its proportion to all others. However, I also need to be able to scale individual ellipses while others adjust. In case I increase the width of ellipse 2 I need ellipse 1 and 3 to decreased their widths to accommodate this change. I hope this makes sense.
    I would appreciate it if you could share your experience and suggest what you think is the best way to address this task.
    Thank you in advance,
    Joe.

    Instead of trying to crop and use the Ken Burn's effect. Have you tried to choose the "Fit" option? Or you can try this option will might allow you to export it out as a "landscape" image which hopefully will be what you're looking for.
    Click the crop button and then click the button that says “Allow Black.” Now you can adjust the size and position of the green box to choose the new dimensions of your video.
    To finish up, choose Export movie. HD 720p (1280 x 720) will preserve the original quality as much as possible. If that works, you can try to re import the video back into iMovie and see if that solves the problem. Hopefully that works.
    Phone images can suck some times.

  • Slideshow - stretched image + low resolution

    Hi guys,
    I have a wide screen that runs at 1440x900. I have my slideshows configured not to "scale image to fit screen" as my images are in 4:3 aspect and scaling it to fit the wide screen makes everyone look fat...
    Viewing a quick slideshow from Finder or Preview works correctly, i.e. the photo fits in the screen's hight, with black down the sides.
    When I start a slide show in iPhoto (6 and 08), it switches down to 1280x800, and seems to ignore the "scale image to fit screen" setting being set to "off" - so the images are all stretched sideways.
    I suspected at first that it might be a video RAM issue, but the G4 Mini has 32MB dedicated video RAM, and the slideshow works fine (without switching to a lower resolution) in Finder and Preview.
    I found one other post, posted in the iPhoto 5 section, with no responses:
    http://discussions.apple.com/thread.jspa?messageID=5155628&#5155628
    Is anyone else seeing this? Is there a way to force iPhoto to leave the resolution alone and obey my scaling wishes?
    Thanks

    koffiejunkie:
    Welcome to the Apple Discussions. The three options I have for format are: Current display, 4:3 (iDVD, TV) and Widescreen 16:9. The 4:3 option puts black bars on either side and pins the height. The 16:9 option put black all around the image. Do either of these work for you?
    Try deleting the iPhoto preference file, com.apple.iPhoto.plist, that resides in your User/Library/Preferences folder. Launch iPhoto, reset the preferences and try again.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Is there a way to stretch images or give them any effects?

    I was temping a project in VB and the interface was real nice, however when I ported it to Java it became very dull. In VB I used the stretch property and with borderstyle it gave my aqua like background images a nice indent. However in Java I can't seem to stretch the control or apply a nice borderstyle. Either I can custom size the image very every implementation or apply another effect. Is there a tutorial with example showing effects you can apply with an image?

    You probably want to take a look at the [url http://java.sun.com/products/java-media/2D/index.jsp]Java 2D API; that will have some example usage like that found [url http://java.sun.com/developer/technicalArticles/Media/intimages/]here.

  • Stretched image MacBook Pro Retina to 720p TV

    Whenever I connect my MacBook Pro Retina to my Panasonic HD Ready tv the entire image on the tv is stretched a bit vertically.
    It's not the gravest of problems but it is pretty **** annoying when watching any kind of video. All the heads and everything is a tiny bit stretched and it just gives a generally distorted feel.
    I've tried everything there is to try under Displays, like; mirroring, changing resolutions, scaling etc. but to no avail. Sometimes I can get a reasonable result when changing aspect ratios in VLC player but that doesn't always do the trick.
    I tried connecting my MacBook to a Full HD tv once and the problem didn't seem to arise there, so I'm thinking it has to do with retina resolution clashing with 720p or something.
    Can anyone help?

    Hi.
    Try adjusting the screen aspect ratio on the tv. This may sort it fir you.
    Stuart

  • Full screen, stretched image

    I'd really like to be able to use the full screen feature during video chats, but the image gets stretched -- due, I imagine, to the fact that I have a widescreen monitor. I don't suppose there's any way to fix this?
    Also, is there any way I can turn off that pesky preview window? If I wanted to look at myself, I'd use a mirror.

    The iChat add-on Chax (http://www.ksuther.com/chax) can remove the picture in picture effect as well as adding a bunch of other really great features to iChat. And it's free.
    I'm looking for a solution to the stretched fullscreen image as well, grandma doesn't want to be wider.
    MacBook Pro   Mac OS X (10.4.5)  

  • Stretching images while retaining their aspect ratio..?

    Hello,
    I'm looking for a method that will allow me to resize an image (div background or regular img) to fit as tall and wide as the container allows, while retaining the image's native aspect ratio.
    The method I'm currently using is :
    #bg {
        height:100%;
        width:100%;
        position:fixed;
        left:0;
        right:0;
        top:0;
        bottom:0;
        padding:0;
        overflow:hidden;
        z-index:-1000;
    #bg img {
        height:100%;
    <div id="bg"><img src="/images/image0.jpg" /></div>
    However, this method only seems to work when the body is the container, and will only keep one of the two axis within view. I can specify either height:100% or width:100%, but not both because that will skew the images natural aspect ratio.
    What I'm trying to accomplish is to block off 100 pixels at the bottom for navigation, 300 pixels on the right of the viewport for a text column, and leave the rest to be filled by an image that would stretch as much as the space allows (again, while retaining its aspect ratio).
    Your suggestions are welcome!

    Hello
    First of all, you should never use dreamweaver option to modifie an image. Always use the appropriate programe to resize your image ( Photoshop or illustrator). Even if the web standart are 72 dpi you might never know what is the format of your image, and by stretching too much or downscaling it's size too much you will .. well.. have a low result.
    Next : why do you want to keep a zone for navigation ?. Background by default cover everthing, and if you put your navigation on top of it, it will cover the background and make it invisible at that spot because your navigation will be on top of it.
    Anyway What you want to do is first define exactly the maximum size of your Bg minus the zone you want to keep blank. Then put the bg and use option like Margin-right, margin-top to force the image to be where you want it to be.
    Margin-bottom: 100px for exemple.
    You can achieve that in your CSS setting i believe.
    Hope this help.

  • IE6 stretching images in CSS photo viewer

    I'm creating a simple photo viewer with CSS swapping out
    images. I sized the box to hold them wide enough for the landscape
    shots, but my verticals, which are narrower are getting stretched.
    In FF I got them to at least position left (centered would be
    prefered), but IE insists on stretching them. I don't want to put
    separate settings on horizontals and verticals. The page is at
    www.carondesign.com/yosemite/index.html. CSS is attached.
    Thanks!

    This has helped me with a similar situation.    http://answers.microsoft.com/en-us/windows/forum/w​indows_rt-pictures/windows-photo-viewer-suddenly-w​...

  • Stretched images inside DreamWeaver CS6

    Hello. I'm a newbie to this forum. Hope someone can help me out there. Just upgraded from CS3 to CS6 and noticed my images are stretched inside DreamWeaver.

    When you select one of these images in DW's Design view, and look at the property inspector, do you see the height/width values in bold type with an array of icons to the right (see image)?
    If so, just click on the middle icon to reset the dimensions to the native image size. Somehow during the change to CS6, these images were resized in design view. This will reverse that.

  • QuickLook and preview pane stretches images

    The Finder column view preview pane and QuickLook stretch many of my photos. But when I open the same photos in Preview.app, they look normal.
    Screenshot:
    For example, download this image (reaver.jpg), and view it with Finder's column view. Now view it with QuickLook. It renders correctly in every other application, so there's something going wrong in how QuickLook/Finder get the image dimensions.
    This problem started happening in either Mac OS X 10.8.1 or 10.8.2.
    Specs:
    * Finder 10.8
    * QuickLook v4.0 (555.0)
    * Mac OS X 10.8.2
    * MacBook Pro 2009
    Also posted in SuperUser.

    Have you tried starting in Safe Mode and see if the problem still occurs?
    Restart holding the "shift" key.
    (Expect it to take longer to start this way because it runs a directory check first.)
    If this works look in System Preferences > Users & Groups > Login items and disable any third party login items. Also look in /Library/Startup Items. Nothing is put in that folder by default, so anything in there is yours.

  • How to stretch image

    Hi
    I am using the following method to resize an image, but when the new width and height do not maintain the aspect ratio of the image, the image doesn't stretch to the new size, but rather fills the background with black.
    I would like to change the method to stretch the image if the new coords do not maintain the image's aspect ratio.
    Also, how would I add support for saving the resized image as a GIF?
    Kind regards
    Peter
    public static void resizeImage(String filename, int newWidth, int newHeight)
         try
              BufferedImage input = ImageIO.read(new File(filename));
              BufferedImage output = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_RGB);
              double scale = (double)Math.max(newWidth,newHeight)/(double)input.getHeight(null);
              if (input.getWidth(null) > input.getHeight(null)) {
                   scale = (double)Math.max(newWidth,newHeight)/(double)input.getWidth(null);
              // Set the scale.
              AffineTransform tx = new AffineTransform();
              if (scale < 1.0d)
              tx.scale(scale, scale);
              // Paint image.
              Graphics2D g2d = output.createGraphics();
              g2d.drawImage(input, tx, null);
              g2d.dispose();
              //TODO: Add support for GIF.
              ImageIO.write(output,MiscUtils.extractFileExt(filename),new File(filename));
         catch(IOException e)
              e.printStackTrace();
    }

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import java.text.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.*;
    public class ImageScaling
        public static void main(String[] args)
            JFrame f = new JFrame("Image Scaling");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            BufferedImageComponent bic = new BufferedImageComponent();
            ImageSelector selector = new ImageSelector(bic, f);
            ImageAdjustor adjustor = new ImageAdjustor(bic);
            f.setJMenuBar(selector.getMenuBar());
            f.getContentPane().add(bic);
            f.getContentPane().add(adjustor, "South");
            f.setSize(500,350);
            f.setLocation(400,200);
            f.setVisible(true);
            System.out.println(bic.getSize());
    * Image component displays scaled image.
    class BufferedImageComponent extends JPanel
        URL fileURL;
        BufferedImage image;
        int width, height;
        JLabel label;
        NumberFormat nf;
        boolean centerImage;
        public BufferedImageComponent()
            width = 300;
            height = 200;
            label = new JLabel();
            nf = NumberFormat.getNumberInstance();
            nf.setGroupingUsed(false);
            nf.setMaximumFractionDigits(3);
            centerImage = false;
            setBackground(Color.white);
            setLayout(new GridBagLayout());
            add(label, new GridBagConstraints());
        private void scaleImage(int width, int height)
            BufferedImage scaledImage = new BufferedImage(width, height,
                                                BufferedImage.TYPE_INT_RGB);
            double imageWidth = image.getWidth();
            double imageHeight = image.getHeight();
            // the smaller dimension of image will fill scaledImage
            // allowing the longer dimension to overflow scaledImage
            double wScale = width/imageWidth;
            double hScale = height/imageHeight;
            double scale = Math.max(wScale, hScale);
            double y = (height - scale*imageHeight)/2;
            double x = (width - scale*imageWidth)/2;
            System.out.println("wScale = " + nf.format(wScale) + "\t" +
                               "hScale = " + nf.format(hScale) + "\n" +
                               "scale = " + nf.format(scale) + "\n" +
                               "x = " + nf.format(x) + "\ty = " + nf.format(y) + "\n" +
                               "scaledImageWidth = " + nf.format(scale*imageWidth) + "\t" +
                               "scaledImageHeight = " + nf.format(scale*imageHeight));
            AffineTransform xform = new AffineTransform();
            if(centerImage)
                xform.translate(x,y);
            xform.scale(scale, scale);
            Graphics2D g2 = scaledImage.createGraphics();
            g2.drawImage(image, xform, this);
            g2.dispose();
            label.setIcon(new ImageIcon(scaledImage));
            revalidate();       
            repaint();
        private void loadImage()
            try
                image = ImageIO.read(fileURL);
            catch(IOException ioe)
                System.out.println("IOE: " + ioe.getMessage());
        public void setImage(URL url)
            fileURL = url;
            loadImage();
            scaleImage(width, height);
        public void setCenterFlag(boolean b)
            centerImage = b;
            scaleImage(width, height);
        public void setWidth(int w)
            width = w;
            scaleImage(width, height);
        public void setHeight(int h)
            height = h;
            scaleImage(width, height);
    * JSpinners to change the width and height of the image displayed
    * in BufferedImageComponent and a JCheckBox that offers a centering option.
    * Loaded into south section of content pane in main method.
    class ImageAdjustor extends JPanel
        BufferedImageComponent bic;
        public ImageAdjustor(BufferedImageComponent c)
            bic = c;
            SpinnerNumberModel widthModel = new SpinnerNumberModel(300, 50, 400, 10);
            final JSpinner widthSpinner = new JSpinner(widthModel);
            SpinnerNumberModel heightModel = new SpinnerNumberModel(200, 50, 400, 10);
            final JSpinner heightSpinner = new JSpinner(heightModel);
            ChangeListener l = new ChangeListener()
               public void stateChanged(ChangeEvent e)
                   JSpinner spinner = (JSpinner)e.getSource();
                   int value = ((Integer)spinner.getValue()).intValue();
                   if(spinner == widthSpinner)
                       bic.setWidth(value);
                   if(spinner == heightSpinner)
                       bic.setHeight(value);
            widthSpinner.addChangeListener(l);
            heightSpinner.addChangeListener(l);
            final JCheckBox centerCheck = new JCheckBox("center");
            centerCheck.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    bic.setCenterFlag(centerCheck.isSelected());
            setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            gbc.insets = new Insets(2,2,2,2);
            gbc.anchor = gbc.EAST;
            add(new JLabel("width"), gbc);
            gbc.anchor = gbc.WEST;
            add(widthSpinner, gbc);
            gbc.anchor = gbc.EAST;
            add(new JLabel("height"), gbc);
            gbc.anchor = gbc.WEST;
            add(heightSpinner, gbc);
            gbc.anchor = gbc.CENTER;
            add(centerCheck, gbc);
    * JFileChooser used to load images into BufferedImageComponent.
    * Accessed through file menu.
    class ImageSelector
        BufferedImageComponent bic;
        JFrame frame;
        JFileChooser chooser;
        JMenuBar menuBar;
        public ImageSelector(BufferedImageComponent c, JFrame f)
           bic = c;
           frame = f;
           chooser = new JFileChooser();
           JMenu fileMenu = new JMenu("file");
           final JMenuItem openItem = new JMenuItem("open");
           ActionListener l = new ActionListener()
               public void actionPerformed(ActionEvent e)
                   JMenuItem item = (JMenuItem)e.getSource();
                   if(item == openItem)
                       openDialog();
            openItem.addActionListener(l);
            fileMenu.add(openItem);
            menuBar = new JMenuBar();
            menuBar.add(fileMenu);
        private void openDialog()
            int returnVal = chooser.showOpenDialog(frame);
            if(returnVal == JFileChooser.APPROVE_OPTION)
                File file = chooser.getSelectedFile();
                if(!isImage(file))
                    return;
                try
                    URL url = file.toURL();
                    bic.setImage(url);
                catch(MalformedURLException mue)
                    System.out.println("MUE: " + mue.getMessage());
         * Filters files for jpg and png extensions
        private boolean isImage(File file)
            String extension = file.getPath().toLowerCase();
            if(extension.indexOf("jpg") != -1 || extension.indexOf("png") != -1)
                return true;
            return false;
        public JMenuBar getMenuBar()
            return menuBar;
    }

  • Image to fit in landscape frame without stretching image

    I want the main body of my landscape image  to bleed off the left edge of frame however this creates a white gap on the right edge. When I pull the image to the right it 'stretches'

    With the Free Transform (E) or Direct Section (A) tools select the image, hold down Shift and drag one of the corner handles, which will constrain the sizing. You can also use Command-> or Command-< to increase or decrease the image size.

  • Project incorrectly stretching images

    Hello!
    I really need help with this and I would greatly appreciate any advice.  I'm using Premiere Pro CS3 and trying to import a batch of images that are 960x720. They import fine, but when I drop them on the timeline it stretches the image out beyond the vertical boundary. The source window says the image is still at 960x720 but gives the aspect ratio as 1.333! This would account for the stretch.
    I have done extensive fiddling with the project settings including:
    1) Changing the editing mode to desktop and manually setting the H and V to 960x720
    2) Changing between square pixels (1.0) and (0.9)
    3) Turning on and off the default scale to frame size
    4) Trying 16:9 and 6:5
    5) When I resize the image to 800x600 (which is still the same ratio) and set the project settings to same, it imports fine and fills the window correctly. The source window says "800x600 1.0"
    I could go in and manually resize all 60 images but this seems ridiculous.   As far as I can tell I need to achieve "960x720 1.0 4:3".  Any ideas?  Thank you for ANY comments!

    Sorry you're right. The PAR is 1.333 (determined by dividing W by H). When I set it to this (HD anamorphic 1.333) in the initial project settings it still stretchesthe image. The Frame Aspect Ratio of the images appears to be natively 4:3 but when I set the project in Premiere as 1.333 Pixel Aspect ratio, the Frame Aspect ratio is automatically set to 16:9.
    I included images so you could see the regular image and then what Premiere does with it on the timeline. I scaled them down, but you can see the difference.
    Thanks!

  • How avoid stretched image on DVD from HD source clips?

    I edited a program in FCP 7.0 using HD footage from my Sony Handycam HDR-XR520. I exported to Compressor and followed the steps Shane sent in Shane's Stock Answer #42 on how to author a DVD. Thanks, Shane, I made the DVD. But the end images are all somewhat stretched out horizontally. Where did I go wrong? Where do I code this footage to come out in HD ratio but not be unnaturally stretched?
    Thanks, Duncan

    David, Thanks for your specific directions.
    1. My Sony HD camera specs say its system is 1080/60i. The FCP Browser lists the Frame Size of the imported clips as 1440 x 1080.
    2. Here I think I owe you and Shane an apology. I see that in the Browser, the Frame Size of my edited Sequence of these clips is listed as only 720 x 480. In my upgrade to FCP7 I had assumed that FCP recognized the frame size of the HD clips I was importing and would process them accordingly. But it looks like I needed to first specify the Sequence Settings. Is that true? Would it make a difference? If so, what should I set for Frame Size, Aspect Ratio, Pixel Aspect Ratio, Field Dominance? Should I check Anamorphic 16:9?
    3. FYI, despite FCP describing the ratio of the Sequence as 720 x 480, the ratio of the images still appears to be 16:9.
    4. I did as you directed and exported my edited Sequence as a QT Movie Self-Contained and looked at it. It was NOT distorted -- it looked just right. Cmnd-I shows the ratio to be 720 x 480, but it displays the 16:9 ratio images in a letterbox fashion.
    5. If the settings in FCP need to be changed, can I do that globally or do I need to reedit the program?
    6. If I simply took the Self Contained QT movie into Compressor and DVD SP, would the quality be as good as if I started with the right settings?
    With lots of thanks, Duncan

Maybe you are looking for