Saving images with BitmapData

I am saving a screen shot of my application using the
following code...
var bd : BitmapData = new BitmapData( target.width,
target.height );
bd.draw( target, new Matrix());
to get the contents of the target (a UIComponent) into the
BitmapData object, which I then convert to a PNG, etc, etc. My
question revolves around the fact that when I do this, the
resulting image only shows the "viewable" portion of the target
component. As an example, I have a Canvas that is nested in another
Canvas in such a way that there are scrollbars. When I do the
saving, rather than getting the entire size of the inner Canvas, I
only get the viewable size of the outer Canvas.
My question is, how do I (or can I) get the entire content of
the inner Canvas and not just what is viewable/
Thanks

In Keynote you can add your image to a slide, move the bottom of it upwards, select reflection, adjust the background color and opacity to get the effect you want and then export as a JPEG.
If the Keynote slide size doesn't suit your photo size you can do as above, take a snapshot and crop it.

Similar Messages

  • Problems saving image with outer glow as gif

    I've created a logo with an outer glow and it looks great as an illustrator file but there are problems when I save it as a gif file.  The glow is replaced by a white blob around the logo.  Not sure if this has anything to do with it but the image has a transparent background.  I'm new to the Adobe suite.  Should I be adding the glow in Photoshop or can it be done, and look right, in illustrator?
    Any help would be greatly appreciated.  Thanks.

    GIFs cannot have alpha transparency. So you need to choose the same background color as you use on the HTML page, so that Illustrator can calculate your graphic when saving for web.
    PNG can have alpha transparency, but you cannot use the "screen" blend mode in it.

  • Saving images with quality 12 increases size. Why?

    A minutely modifyed image saved with quality of 10 maintained its original size (more or less), but saving with a quality of 12 increases size.
    I would like to know why?
    I'd appreciate your comments.

    Because that's how .jpg works. Sizes of less than 10 usually compress your files somewhat, lower numbers resulting in smaller file sizes and more compression, with a corresponding loss of quality. Sizes greater than 10 also use the .jpg compression algorithm, but they choose less compression, and so two pixels that may have been compressed together at compression 10 may now be separated at compression 11 or 12, resulting in a larger file. (But that doesn't imply an increase in the quality, even at 12 there is still a slight decrease in quality in that the .jpg saved version still doesn't exactly represent what you saw on the screen)
    The amount of modification to the photo doesn't really matter in how much the space the .jpg compression takes up.

  • Why does adobe camera raw keep saving images with the incorrect white balance?

    I am having an issue when I edit images.  here is the scenerio:
    I choose 50 Raw files and open them in Camera Raw.
    I edit each individually - many of them have different white balances.
    Once I have each image how I want them, I select all and click done.
    Sometimes all the edits are saved correctly, but very often all the changes are saved correctly except white balance.  The program seems to take the white balance from one image and applies it to all the images.
    Why???  Very frustrating to have to go back and individually edit all the white balances again.
    Thanks!

    It seems to not happen if I slow down a few seconds before I click select all and then done.
    That should not be the problem, once you changed settings and hitting done they all should be applied immediately. It even is not needed to first select all, that is only needed when you need to open or save the files.
      But I still don't know why it would only change the white balance in every shot and not everything.
    If it happens again could you first in Bridge select one of the none changed files and with right mouse click menu choose select purge cache for selection?
    And can you provide more details about system version, app versions and file types?

  • Saving image with transparent background for web/Dreamweaver

    How do I save a little image, so that the background stays transparent. I already have the image set up in Photoshop with a transparent background and have saved it as gif and png. When I import it into Dreamweaver the background stays white instead of transparent. What am I not doing right, since I read several posts saying that png and gif are the right formats to save in, if you want a transparent background?
    Thanks for any help with this,
    Anne

    Well now that you have told me to save with some sort of an alpha channel, it works perfectly.
    In CS5:
    Select layer,"Composition,Make movie". Then navigate to "Output module" and choose an option that has "alpha channel" in the title.Choose a name for your project "Output to". I now use "lossless alpha".I don't know if that is the best one, but it seems to be working fine.
    There is no "Quicktime" option in CS5 as in older versions of AE.
    I was trying to save as a video in general or for photoshop and that just wasn't working out well.
    I don't know what the "Frames to Layers import assistant" is that you mentioned though. I still tend to drag and drop, rather then import.
    Thanks for your help.

  • When I try to open a saved image with the "htm" file extension all I get is a page of gibberish text.

    I have the new Snow Leopard system on my iMac. I saved several images from an art site. The file extension on each image is "htm". when I try to open each image all I get is gibberish tpye text.
    Can convert these "images" to jpeg files so I can view and edit them?
    thanks

    If the images have a .htm(l) file extension then you need to rename the files and give them an image file extension like .jpg<br />
    That should be sufficient to make programs recognize them as images.

  • Saving images with an associated .wav file

    Occasionally I will create a voice note with an photograph - this is to identify a species or note a location.
    Is there some way to (automatically) tag all my images which a sound associated with them?
    Thanks

    Thanks, Steven. But that's not it. Here's some new information:  The camera
    I was using (Panasonic HVX 200) had the frame rate set to 720 30pn.
    However, the "scene file" mistakenly applied listed 24fps. Premiere Pro
    thinks this footage is 29.97. Is it possible that it's actually 24fps and
    that's why it's about 25% shorter than the corresponding .wav file? If so,
    is there a way to "fool" Premiere Pro into slowing down the footage?
    Unless I'm off the mark completely. It's been known to happen.......

  • Capture image with webcam: how to change image orientation

    Hi all,
    I have taken the code shown in thread http://forum.java.sun.com/thread.jspa?threadID=570463&tstart=0, and it works ok (many thanks for it).
    However, all webcam resolutions are in "landscape" mode (e.g. 320 x 240), but I would like to capture a "portrait" image (e.g. in 240 x 320).
    Do you know any easy way to do it (but not physically tilting the camera, so that the video in the screen is shown in its correct orientation)?
    Best regards.

    Hi Owen,
    in my current application I don't need right now to use any large image, so that I have decided to implement a "simple" solution as the first one that you appointed: to use a transparent rectangle above the image, and then crop the saved image withing the limits of this rectangle.
    In order to do it, I have modified your code so that the panel (visualContainer) where to show the image is using an OverlayLayout format:
    <address>visualContainer = new JPanel();</address>
    <address>OverlayLayout overlay = new OverlayLayout(visualContainer);</address>
    <address>visualContainer.setLayout(overlay);</address>
    I have added one class to create the transparent rectangle, using a code like this:
    class TopPanel extends JPanel
    Point loc;
    int width, height;
    public TopPanel()
    setOpaque(false);
    width = 50;
    height = 50;
    protected void paintComponent(Graphics g)
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
    RenderingHints.VALUE_ANTIALIAS_ON);
    if(loc == null)
    init();
    g2.setPaint(Color.blue);
    g2.drawRect(loc.x, loc.y, width, height);
    private void init()
    int w = getWidth();
    int h = getHeight();
    loc = new Point();
    loc.x = (w - width)/2;
    loc.y = (h - height)/2;
    In order to show the rectangle, what I have done is to add a TopPanel() to visualContainer just before adding the Player visualComponent.
    However, by doint in this way, the rectangle is not shown, but only the webcam image. I don't know if I'm doing something wrong, so any help on this issue is welcome.
    Best regards,
    izk

  • I've been editing images with ease for a long time but now the changes are not being saved.

    I've been editing images with ease for a long time but now the changes are not being saved.
    Also, it is not liking me adding a large ammount of images in one go?

    Remember: we cannot see your machine. There are 9 different versions of iPhoto and they run on 8 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS.  So to get help you need to give as much information as you can. Basic things like :
    - What version of iPhoto.
    - What version of the Operating System.
    - Details. As full a description of the problem as you can. For instance: 'iPhoto won't export' is best explained by describing how you are trying to export, and so on.
    - History: Is this going on long? Has anything been installed or deleted?
    - Are there error messages?
    - What steps have you tried already to solve the issue.
    - Anything unusual about your set up? Or how you use iPhoto?
    Anything else you can think of that might help someone understand the problem you have.

  • I have problems with uploading images to my printing company have the images have been manipulated through CS6 i have saved images as jpeg but the printer company tell me they are not j peg, they will not upload images save from a camera are fine

    I have problems with uploading images to my internet printing company when  the images have been manipulated through CS6 and  i have saved images as jpeg  the printer company tell me they are not j peg,
    but images saved from my phone or camera images that have not been manipulated upload fine, What am i doing wrong?

    Save/Export them as JPG. Photoshop defaults to PSD, so make sure you select JPG and not just rename the file to .jpg.
    There are two ways to save them as JPG: Regular Save as option or Save for Web & Devices
    Take your pick.

  • Load, crop and saving jpg and gif images with JFileChooser

    Hello!
    I wonder is there someone out there who can help me with a applic that load, (crop) and saving images using JFileChooser with a simple GUI as possible. I'm new to programming and i hope someone can show me.
    Tor

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.filechooser.*;
    import javax.swing.filechooser.FileFilter;
    public class ChopShop extends JPanel {
        JFileChooser fileChooser;
        BufferedImage image;
        Rectangle clip = new Rectangle(50,50,150,150);
        boolean showClip = true;
        public ChopShop() {
            fileChooser = new JFileChooser(".");
            fileChooser.setFileFilter(new ImageFilter());
        public void setClip(int x, int y) {
            clip.setLocation(x, y);
            repaint();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(image != null) {
                int x = (getWidth() - image.getWidth())/2;
                int y = (getHeight() - image.getHeight())/2;
                g2.drawImage(image, x, y, this);
            if(showClip) {
                g2.setPaint(Color.red);
                g2.draw(clip);
        public Dimension getPreferredSize() {
            int width = 400;
            int height = 400;
            int margin = 20;
            if(image != null) {
                width = image.getWidth() + 2*margin;
                height = image.getHeight() + 2*margin;
            return new Dimension(width, height);
        private void showOpenDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    image = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("Read error for " + file.getPath() +
                                       ": " + e.getMessage());
                    image = null;
                revalidate();
                repaint();
        private void showSaveDialog() {
            if(image == null || !showClip)
                return;
            if(fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                String ext = ((ImageFilter)fileChooser.getFileFilter()).getExtension(file);
                // Make sure we have an ImageWriter for this extension.
                if(!canWriteTo(ext)) {
                    System.out.println("Cannot write image to " + ext + " file.");
                    String[] formatNames = ImageIO.getWriterFormatNames();
                    System.out.println("Supported extensions are:");
                    for(int j = 0; j < formatNames.length; j++)
                        System.out.println(formatNames[j]);
                    return;
                // If file exists, warn user, confirm overwrite.
                if(file.exists()) {
                    String message = "<html>" + file.getPath() + " already exists" +
                                     "<br>Do you want to replace it?";
                    int n = JOptionPane.showConfirmDialog(this, message, "Confirm",
                                                          JOptionPane.YES_NO_OPTION);
                    if(n != JOptionPane.YES_OPTION)
                        return;
                // Get the clipped image, if available. This is a subImage
                // of image -> they share the same data. Handle with care.
                BufferedImage clipped = getClippedImage();
                if(clipped == null)
                    return;
                // Copy the clipped image for safety.
                BufferedImage cropped = copy(clipped);
                boolean success = false;
                // Write cropped to the user-selected file.
                try {
                    success = ImageIO.write(cropped, ext, file);
                } catch(IOException e) {
                    System.out.println("Write error for " + file.getPath() +
                                       ": " + e.getMessage());
                System.out.println("writing image to " + file.getPath() +
                                   " was" + (success ? "" : " not") + " successful");
        private boolean canWriteTo(String ext) {
            // Support for writing gif format is new in j2se 1.6
            String[] formatNames = ImageIO.getWriterFormatNames();
            //System.out.printf("writer formats = %s%n",
            //                   java.util.Arrays.toString(formatNames));
            for(int j = 0; j < formatNames.length; j++) {
                if(formatNames[j].equalsIgnoreCase(ext))
                    return true;
            return false;
        private BufferedImage getClippedImage() {
            int w = getWidth();
            int h = getHeight();
            int iw = image.getWidth();
            int ih = image.getHeight();
            // Find origin of centered image.
            int ix = (w - iw)/2;
            int iy = (h - ih)/2;
            // Find clip location relative to image origin.
            int x = clip.x - ix;
            int y = clip.y - iy;
            // clip must be within image bounds to continue.
            if(x < 0 || x + clip.width  > iw || y < 0 || y + clip.height > ih) {
                System.out.println("clip is outside image boundries");
                return null;
            BufferedImage subImage = null;
            try {
                subImage = image.getSubimage(x, y, clip.width, clip.height);
            } catch(RasterFormatException e) {
                System.out.println("RFE: " + e.getMessage());
            // Caution: subImage is not independent from image. Changes
            // to one will affect the other. Copying is recommended.
            return subImage;
        private BufferedImage copy(BufferedImage src) {
            int w = src.getWidth();
            int h = src.getHeight();
            BufferedImage dest = new BufferedImage(w, h, src.getType());
            Graphics2D g2 = dest.createGraphics();
            g2.drawImage(src, 0, 0, this);
            g2.dispose();
            return dest;
        private JPanel getControls() {
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.weightx = 1.0;
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.gridwidth = GridBagConstraints.REMAINDER;
            panel.add(getCropPanel(), gbc);
            panel.add(getImagePanel(), gbc);
            return panel;
        private JPanel getCropPanel() {
            JToggleButton toggle = new JToggleButton("clip", showClip);
            toggle.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    showClip = ((AbstractButton)e.getSource()).isSelected();
                    repaint();
            SpinnerNumberModel widthModel = new SpinnerNumberModel(150, 10, 400, 1);
            final JSpinner widthSpinner = new JSpinner(widthModel);
            SpinnerNumberModel heightModel = new SpinnerNumberModel(150, 10, 400, 1);
            final JSpinner heightSpinner = new JSpinner(heightModel);
            ChangeListener cl = new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    JSpinner spinner = (JSpinner)e.getSource();
                    int value = ((Number)spinner.getValue()).intValue();
                    if(spinner == widthSpinner)
                        clip.width = value;
                    if(spinner == heightSpinner)
                        clip.height = value;
                    repaint();
            widthSpinner.addChangeListener(cl);
            heightSpinner.addChangeListener(cl);
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            gbc.weightx = 1.0;
            panel.add(toggle, gbc);
            addComponents(new JLabel("width"),  widthSpinner,  panel, gbc);
            addComponents(new JLabel("height"), heightSpinner, panel, gbc);
            return panel;
        private void addComponents(Component c1, Component c2, Container c,
                                   GridBagConstraints gbc) {
            gbc.anchor = GridBagConstraints.EAST;
            c.add(c1, gbc);
            gbc.anchor = GridBagConstraints.WEST;
            c.add(c2, gbc);
        private JPanel getImagePanel() {
            final JButton open = new JButton("open");
            final JButton save = new JButton("save");
            ActionListener al = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JButton button = (JButton)e.getSource();
                    if(button == open)
                        showOpenDialog();
                    if(button == save)
                        showSaveDialog();
            open.addActionListener(al);
            save.addActionListener(al);
            JPanel panel = new JPanel();
            panel.add(open);
            panel.add(save);
            return panel;
        public static void main(String[] args) {
            ChopShop chopShop = new ChopShop();
            ClipMover mover = new ClipMover(chopShop);
            chopShop.addMouseListener(mover);
            chopShop.addMouseMotionListener(mover);
            JFrame f = new JFrame("click inside rectangle to drag");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(chopShop));
            f.getContentPane().add(chopShop.getControls(), "Last");
            f.pack();
            f.setLocation(200,100);
            f.setVisible(true);
    class ImageFilter extends FileFilter {
        static String GIF = "gif";
        static String JPG = "jpg";
        static String PNG = "png";
        // bmp okay in j2se 1.5+
        public boolean accept(File file) {
            if(file.isDirectory())
                return true;
            String ext = getExtension(file).toLowerCase();
            if(ext.equals(GIF) || ext.equals(JPG) || ext.equals(PNG))
                return true;
            return false;
        public String getDescription() {
            return "gif, jpg, png images";
        public String getExtension(File file) {
            String s = file.getPath();
            int dot = s.lastIndexOf(".");
            return (dot != -1) ? s.substring(dot+1) : "";
    class ClipMover extends MouseInputAdapter {
        ChopShop component;
        Point offset = new Point();
        boolean dragging = false;
        public ClipMover(ChopShop cs) {
            component = cs;
        public void mousePressed(MouseEvent e) {
            Point p = e.getPoint();
            if(component.clip.contains(p)) {
                offset.x = p.x - component.clip.x;
                offset.y = p.y - component.clip.y;
                dragging = true;
        public void mouseReleased(MouseEvent e) {
            dragging = false;
        public void mouseDragged(MouseEvent e) {
            if(dragging) {
                int x = e.getX() - offset.x;
                int y = e.getY() - offset.y;
                component.setClip(x, y);
    }

  • Saving images from LR Mobile with edits.

    I'm having a bit of trouble saving images on my ipad with the current edits.
    To me it seems I have to manually sync the edited image first, otherwise Lr just saves a JPG of the original image to my photostream rather than a copy with adjustments on it.
    Am I missing something or is this the way it works?
    Thanks for any insight.

    Correct. As long your image is in Develop mode (same with presets and crop) and you would like to share from there you need to maually force sync your changes first. This is already logged as in internal bug. Thanks, Guido

  • Saving Binary Image with Overlay?

    Hi
    I'm having some issues saving an image with overlay information. I'm using IMAQ Find Circles to measure the radii of holes in a binary image. The hole data is then used with IMAQ Overlay Oval, to draw on ovals to highlight the circles detected. Works fine and the image is shown as expected in the image output on screen, pallette is set to binary. (See second image of 3, below)
    When I try and save the image to PNG I just get a blank (black) image. If I use the IMAQ Merge Overlay tool, I just get the green circles on the black (see last image of 3 below). Is there something I'm missing with pallettes/merging? Any help much appreciated. Snapshot of (messy) code attached.
    Solved!
    Go to Solution.
    Attachments:
    forum2.PNG ‏47 KB

    The problem is the binary image is all zeroes and ones.  A normal image goes up to 255, so a value of 1 looks black.
    One solution is to multiply the binary image by 255, which makes the image black and white.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Saving images from camera raw in new CC suite

    Hi Im having trouble re saving images from new adobe cc bridge camera raw, images once saved then show in bridge with no adjustments done in camera raw and the images are downsized to KB size images even from a 9.20mb raw image, Ive looked at setting or rather preferences and totally lost please help!!
    Thank you
    Jon

    This forum is actually about the Cloud, not about using individual programs
    Once your program downloads and installs with no errors, you need the program forum
    If you start at the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says ALL FORUMS) to open the drop down list and scroll
    http://forums.adobe.com/community/bridge

  • I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image,

    I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image, the guidelines are not locked, it is annoying to have to lock them down again. and it would actually be nice, to ba able to give specific directions when placing the guidelines. Thanks

    Then why are the guides unlocked when I reopen a document that I saved with the guides locked ?
    Thanks.

Maybe you are looking for