Adding gif/jpeg image to frame

Hi,
Can anyone please tell me how to add a jpeg/gif image or an icon to the title bar ofa frame such that it appears before the title.
Thanks

    Image myImg=Toolkit.getDefaultToolkit().getImage(
      getClass().getResource("YourImage.gif"));
myFrame.setIconImage(myImg);~Bill
Edited by: abillconsl on Sep 24, 2007 5:07 PM

Similar Messages

  • GIF/JPEG Images Always Open As "Locked"

    Hey,
    When I open up my images of JPEG/GIFs as "Locked". PNG image types are fine and aren't locked on opening but I really don't know why my JPEG and GIF's are always locked.
    I can fix it by just duplicating it on the JPEG files, allowing me to make changes to my image but on GIFs it wont even let me duplicate.
    Anyone know what is going wrong?
    Hatton

    I think what your seeing is normal for file formats that don't support layers.
    For jpegs, just double clicking on the background layer thumbnail in the
    layers panel and clicking ok in dialog that appears should unlock the layer.
    Instead of doing that, i usually drag the background layer to the new layer icon
    at the bottom of the layers panel. This creates a background copy that you
    can work on and should be unlocked.
    Your gifs are probably in the Index color mode (says Index beside the layer thumbnail)
    To unlock gifs go to Image>Mode>RGB.
    MTSTUNER

  • Howto remove gif, jpeg (images) from e-mails?

    Hi Gurus.
    Please help, I want to remove gifs and other images from emails and deliver the rest of content to the user mailbox.
    Many thanks
    BR

    Hi,
    Look at the conversion channel in the Messaging Server Administration Guide. This allows you to replace the MIME contents of messages e.g. replace/remove a gif or other images that you specify.
    Regards,
    Shane.

  • Inserting gif/jpeg image into excel through POI-HSSF

    HI,
    I am using jExcel to generate xls file from java. But I have to include image into the excel sheet. but jExcel supports only PNG file format to insert into excel sheet.
    what about POI-HSSF? Does it support inserting images into Excel or not. if supports what type of images it will support?
    I am in urgent need of it. Help me out in this issue
    Thanks

    MinOP wrote:
    > but I can't seem to figure the image part out. I am not
    calling the loadPicture correctly, which is confusing CF.
    You did not mention which version of POI. Did you verify your
    version supports the patriarch.createPicture method? If you are
    using a really old version it might not.
    > loadPicture("asset/images/logo_e2eA.png",
    workSheet))/>
    Does the code actually have access to a loadPicture() method
    or function? I think loadPicture() is a private method in one of
    the example classes: org.apache.poi.hssf.usermodel.examples.*. So
    you may have to write your own version of it. Assuming you have not
    done so already...

  • How can i add a jpeg image in a label of my frame !

    hi!
    i wana to add a jpeg image to my frame in a label !!
    can you please help em !
    thanks

    yourPicture is a jpeg in the same dierctory as the class where u add this code ....
    URL picURL1 = getClass().getResource("yourPicture.jpeg");
    ImageIcon icon = null;
    if(picURL1 != null)icon = new ImageIcon(picURL1);
    JLabel lblLogo = new JLabel(icon, JLabel.CENTER);

  • How to save applet in image(gif/jpeg) format

    Hi there !
    how to save applet in image (gif/jpeg) format. i have just gone through JIMI package where serilization is there ,WHERE U CAN SORE in image format ...........can anybudy help me out.........if possible then pleeez provide me some example.
    Thanks in advan...........

    I think that is possible because i have seen some commercial applets that do that.
    -http://www.izhuk.com/painter/
    -http://www.lawrencegoetz.com/programs/signature/
    Thses two saves the image in the server since applets cant write in the host they are running. Maybe it would be possible whit JFS, i don't know.
    For now I am trying to store an image draw in the applet on my server.
    My idea now is copying the image to a buffer or something, open a connection to the server and receive the image with a perl CGI.
    There is an example with text:
    -http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html
    I want to do something similar but with an image.

  • How to convert images to gif/jpeg files

    I have created images in java. Now i want to convert this image into a gif/jpeg file so that i can save this gif/jpeg file in one particular folder on the system & also show the same file to the user.

    use
    javax.imageio.ImageIO.write
    for an introduction see:
    http://java.sun.com/products/jfc/tsc/articles/javaOne2001/600/

  • How combine a jpeg image & animated gif image & save  it as GIF ?

    i have an jpeg image, & also aminated gif image, how do i place the animated gif image over (in the center of the image) a jpeg image & save it as gif file ??

    First thing you need to do is stop thinking in terms of file formats once the files are in photoshop they are all the same. The exception being vector vs raster. But in this instance the process is rteally the same so 6 on one hand a half a dozen on the other. Or as some would say Tomatoe, tomahtoe(mispelled on purpose).
    The jpeg I would assume is the background image and the gif image is the fore ground object. Open the jpeg, and then place the gif file. As long as the fore ground object has transparency, your job is pretty much done. If not, then it will be up to you to mask what you want to keep vs what you don't and apply that selection to the foregrounds layer as a mask.
    Google the net or skim the users manual for the keywords - mask, selections, quickmask, pen tool, paths. Each of these can in one way or another take care of your issue.
    It would be worth your time to also go through the numerous videos about photoshop and see how its done.
    Either go to adobe tv,
    Itunes podcasts
    or one of the following web sites:
    http://kelbytv.com/
    http://creativesuitepodcast.com/

  • Adding gif image to a panel

    Hi
    i have had a look at the link that you have directed to me but i dont understand which code is neccessary for me. please could you help me with the code to add a GIF background image to a Jpanel.
    Thanks

    hi, no it wasnt this link but the link given was not suitable for my programming i need to add an image to a background using the drawImage() method could you please please please help me.
    Thanks

  • Captivate Adding JPEG images! HELP!

    Good day all,
    I am having an issue with Captivate, that I've never had
    before. I've used Captivate now to develop interactive simulations
    on three other projects, so I'm familiar with Captivate itself.
    However, just recently I started developing more simulations for a
    interactive tool that we use here at work. But on every simulation
    that I have recorded so far, Captivate seems to be inserting1-5
    JPEG images on the first slide. I can't delete these, and when I
    do, it completly freezes Captivate. These images have slowed down
    Captivate so much. I can't even access the "edit" tab. i have to
    double click another slide, and then it finally takes me to the
    edit tab. Does anybody have any idea as to the problem?? I can
    probably get a screen shot of these so called images in the time
    area in Captivate itself.
    Hoping somebody can help me out!

    You didn't say what version you are running - that might be
    important. You did say:
    quote:
    But on every simulation that I have recorded so far, Captivate
    seems to be inserting1-5 JPEG images on the first slide. I can't
    delete these, and when I do, it completly freezes Captivate
    Let me restate the issue in beta-style steps, to see
    if I have it "right", okay?
    1) You are recording in one of the simulation modes ...
    2) After pressing the END key to stop recording, you are
    returned to Captivate where ...
    3) Your new recording is waiting in storyboard view...
    4) You cannot access slide #1 in Edit view, so you open any
    other slide ...
    5) And work your way back to slide #1 from there ...
    6) To find that on slide #1 timeline, there are from 1 to 5
    JPEG images ...
    . . . .(that have nothing to do with the application you
    recorded?) . . . .
    7) And apparently not just any JPEG images but images
    so large they actually burn all resources on your computer,
    causing Captivate to freeze.
    Please let me know if I'm restating your problem correctly
    (above). I am nearly positive that I have
    not understood you. But if that's the case, perhaps you
    could restate the problem in the "step" format I've used here, so
    that we can understand and try to resolve the issue. Thanks very
    much!
    .

  • Problem displaying CMYK jpeg images

    I have a problem with a CMYK jpeg image.
    I know that about supported JPEGs in JRE - JCS_CMYK and JCS_YCCK are not supported directly.
    And I found here how to load the image:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799903
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5100094
    I used both the suggestions described to load it, but when the image is displayed the colors are wrong, are very different from the one displayed in PhotoShop, for example.
    Any suggestion are very appreciated. If it's necessary i can send you the image.
    Roberto
    Here is the code
    package com.cesarer.example.crop;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.util.Iterator;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.ImageInputStream;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class CroppingRaster extends JPanel
        BufferedImage image;
        Dimension size;
        Rectangle clip;
        boolean showClip;
        public CroppingRaster(BufferedImage image)
            this.image = image;
            size = new Dimension(image.getWidth(), image.getHeight());
            showClip = false;
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int x = (getWidth() - size.width)/2;
            int y = (getHeight() - size.height)/2;
            g2.drawImage(image, x, y, this);
            if(showClip)
                if(clip == null)
                    createClip();
                g2.setPaint(Color.red);
                g2.draw(clip);
        public void setClip(int x, int y)
            // keep clip within raster
            int x0 = (getWidth() - size.width)/2;
            int y0 = (getHeight() - size.height)/2;
            if(x < x0 || x + clip.width  > x0 + size.width ||
               y < y0 || y + clip.height > y0 + size.height)
                return;
            clip.setLocation(x, y);
            repaint();
        public Dimension getPreferredSize()
            return size;
        private void createClip()
            clip = new Rectangle(140, 140);
            clip.x = (getWidth() - clip.width)/2;
            clip.y = (getHeight() - clip.height)/2;
        private void clipImage()
            BufferedImage clipped = null;
            try
                int w = clip.width;
                int h = clip.height;
                int x0 = (getWidth()  - size.width)/2;
                int y0 = (getHeight() - size.height)/2;
                int x = clip.x - x0;
                int y = clip.y - y0;
                clipped = image.getSubimage(x, y, w, h);
            catch(RasterFormatException rfe)
                System.out.println("raster format error: " + rfe.getMessage());
                return;
            JLabel label = new JLabel(new ImageIcon(clipped));
            JOptionPane.showMessageDialog(this, label, "clipped image",
                                          JOptionPane.PLAIN_MESSAGE);
        private JPanel getUIPanel()
            final JCheckBox clipBox = new JCheckBox("show clip", showClip);
            clipBox.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    showClip = clipBox.isSelected();
                    repaint();
            JButton clip = new JButton("clip image");
            clip.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    clipImage();
            JPanel panel = new JPanel();
            panel.add(clipBox);
            panel.add(clip);
            return panel;
        public static void main(String[] args) throws IOException
             File file = new File("src/ABWRACK_4C.jpg");
             // Find a JPEG reader which supports reading Rasters.
            Iterator readers = ImageIO.getImageReadersByFormatName("JPEG");
            ImageReader reader = null;
            while(readers.hasNext()) {
                reader = (ImageReader)readers.next();
                if(reader.canReadRaster()) {
                    break;
         // Set the input.
            ImageInputStream input =
                ImageIO.createImageInputStream(file);
            reader.setInput(input);
            Raster raster = reader.readRaster(0, null);
             BufferedImage bi = new BufferedImage(raster.getWidth(),
                    raster.getHeight(),
                    BufferedImage.TYPE_4BYTE_ABGR);
             // Set the image data.
             bi.getRaster().setRect(raster);
            // Cropping test = new Cropping(ImageIO.read(file));
             CroppingRaster test = new CroppingRaster(bi);
            ClipMoverRaster mover = new ClipMoverRaster(test);
            test.addMouseListener(mover);
            test.addMouseMotionListener(mover);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(test));
            f.getContentPane().add(test.getUIPanel(), "South");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class ClipMoverRaster extends MouseInputAdapter
        CroppingRaster cropping;
        Point offset;
        boolean dragging;
        public ClipMoverRaster(CroppingRaster c)
            cropping = c;
            offset = new Point();
            dragging = false;
        public void mousePressed(MouseEvent e)
            Point p = e.getPoint();
            if(cropping.clip.contains(p))
                offset.x = p.x - cropping.clip.x;
                offset.y = p.y - cropping.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;
                cropping.setClip(x, y);
    }

    The loading process It takes about 10 seconds, and every repaint it takes the same time.The painting yes, the loading no. It shouldn't take much more time to load the image then an ordinary JPEG. In particular, your now using a "natively accelerated" JPEG image reader, so it should take less time on average to load any JPEG. 10 seconds is absurd. Are you sure your not including the drawing time in that figure?
    - Another problem: JAI-ImageIO is not available for MAC OS X platform.This is somewhat true. You can take the imageio.jar file and package it together with your program (adding it to the class path). This will give you most of the functionality of JAI-ImageIO; in particular the TIFFImageReader. You just won't be able to use the two natively accelerated ImageReaders that comes with installing.
    Right now, you're using the accelerated CLibJPEGImageReader to read the image. You can't use this image reader on the MAC, so you have to take the approach mentioned in the 2nd bug report you originally posted (i.e. use an arbitrary CMYK profile).
    The conversion is too long more than 30 seconds.The code you posted could be simplified to
    BufferedImage rgbImage = new BufferedImage(w,h,
                BufferedImage.3_BYTE_BGR);
    ColorConvertOp op = new ColorConvertOp(null);
    op.filter(cmykImage,rgbImage);But again, 30 seconds is an absurd value. After a little preparation, converting from one ICC_Profile to another is essentially a look up operation. What does,
    System.out.println(cmykImage.getColorModel().getColorSpace());print out? If it's not an instance of ICC_ColorSpace, then I can understand the 30 seconds. If it is, then something is dreadfully wrong.
    the RGB bufferedImage that i get after the transformation when it is displayed is much more brightThis is the "one last problem that pops up" that I hinted at. It's because some gamma correction is going on in the background. I have a solution, but it's programming to the implementation of the ColorConvertOp class and not the API. So I'm not sure about its portability between java versions or OS's.
    import javax.swing.*;
    import java.awt.color.ICC_ColorSpace;
    import java.awt.color.ICC_Profile;
    import java.awt.image.BufferedImage;
    import java.awt.image.ColorConvertOp;
    import javax.imageio.ImageIO;
    import java.io.File;
    public class CMYKTest {
         public static void main(String[] args) throws Exception{
            long beginStamp, endStamp;
            //load image
            beginStamp = System.currentTimeMillis();
            BufferedImage img = ImageIO.read(/*cmyk image file*/);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to load image: " + (endStamp-beginStamp));
            //color convert
            BufferedImage dest = new BufferedImage(img.getWidth(),
                                                   img.getHeight(),
                                                   BufferedImage.TYPE_3BYTE_BGR);
            beginStamp = System.currentTimeMillis();
            sophisticatedColorConvert(img,dest);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to color convert: " + (endStamp-beginStamp));
            //display
            JFrame frame = new JFrame();
            frame.setContentPane(new JScrollPane(new JLabel(new ImageIcon(dest))));
            frame.setSize(500,500);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
        public static BufferedImage sophisticatedColorConvert(BufferedImage src,
                                                              BufferedImage dst) {
            ICC_ColorSpace srcCS =
                    (ICC_ColorSpace) src.getColorModel().getColorSpace();
            ICC_Profile srcProf = srcCS.getProfile();
            byte[] header = srcProf.getData(ICC_Profile.icSigHead);
            intToBigEndian(ICC_Profile.icSigInputClass,header,12);
            srcProf.setData(ICC_Profile.icSigHead,header);
            ColorConvertOp op = new ColorConvertOp(null);
            return op.filter(src, dst);
        private static void intToBigEndian(int value, byte[] array, int index) {
                array[index]   = (byte) (value >> 24);
                array[index+1] = (byte) (value >> 16);
                array[index+2] = (byte) (value >>  8);
                array[index+3] = (byte) (value);
    }

  • Using QuickTime Pro to convert a series of JPEG images into a QT movie?

    Can I use QuickTime Pro to convert a series of JPEG images into a QT (uncompressed) movie? Thanks...
      Windows XP  

    Yes.
    One of the features of the QuickTime Pro upgrade is "Open Image Sequence". It imports your sequencially named (1.jpg, 2.jpg) liked sized images (any format that QT understands) and allows you to set a frame rate.
    http://www.apple.com/quicktime/tutorials/slideshow.html
    You can also adjust the frame rate by adding your image .mov file to any audio clip. Simply "copy" (Command-A to select all and then Command-C to copy) and switch to your audio track.
    Select all and "Add to Selection & Scale". Open the Movie Properties window and "Extract" your new (longer or shorter) file and Save As.
    As you've posted in the Mac Discussion pages but your profile says XP you'll need to subsitute Control key where I reference Command key.

  • How do i create a jpeg image from clips in fcp

    how do i/can I create a jpeg image from clips in fcp?
    Stephen

    Select clip in timeline and place the playhead over the frame you want to save as a JPEG. Open the share window ( Button on far right of tool bar) and select 'Save current frame'. If you don't see that option click on add destination and select the Save current frame choice. It will be added to your share options.

  • ID ePUB export converts all *inline* anchored JPEG images to PNG?

    During ePUB export, when Image Conversion = Automatic, anchored JPEG images with Position = Inline are converted to PNG. If Anchored Object Position = Custom, the same images stay JPEG. Anyone know a better way to avoid than the less-than-ideal options below?
    Less than idea options:
    a) Use Image Conversion = JPEG (would also convert existing .gif and .png images)
    b) Specify Object Export Options for each image frame that contains a JPEG.
    Maybe this is just a bug.

    Here's the definition from the InDesign Help file:
    Image Conversion
    Lets you choose whether the optimized images in your document are converted to GIF, JPEG, or PNG. Choose Automatic to let InDesign decide which format to use in each instance. Choosing PNG disables the image compression settings; use PNG for lossless images or for images that include transparency.
    Choosing Automatic means InDesign decides which format to use. It doesn't mean keep the same format.

  • Scaling Binary JPEG images

    Sorry if this is in the wrong forum.
    I am extracting JPEG images stored in a blob field in a DB. I can obtain the bytes of the JPEG in a couple different ways but I have had no luck in scaling the images.
    I need to simple scale the image, and then return the new image preferably in a byte[] or something that I can convert to a byte[].
    I have come accross several past post, and at times seems to work. None of them actually return an image or errors so I am not sure where it fails.
    I tried a modified version of the following which was an example on making thumbnails out of a larger image.
    Here's the url to that example
    http://developer.java.sun.com/developer/TechTips/1999/tt1021.html
    After modifying the code, when I went to test I recieved a weird error in a log file that basically said something could not use :0 which is refering to my monitor.
    This is and will be used in a Linux env, but does not or should not invlove X in anyway. I have come accross other example that talk about a frame.addnotify() method that is supposed to resolve this issue when not outputing to a monitor.
    After adding that, the error is not there, but neither is my scaled image.(which wasn't there before either)
    If this sound strange, that's beacuse I am creating a custom Generator object. Generator being a Servlet created by Macromedia to generate Flash movies and etc. on the fly.
    For some reason in the API it lacks the ability to scale a JPEG image. Yet to be able to put the image into Flash, I must get the image's byte[].
    Please help, I have played around with this one for some time now, and have tried more things than I could document here.
    Any assistance is greatly appreciated!
    Sincerely,
    William L. Thomson Jr.
    Support Group
    Obsidian-Studios Inc.
    439 Amber Way
    Petaluma, Ca. 94952
    Phone/Fax 707.766.9509

    HI,
    The code is not very well organized, but should be clear enough for your reference.
    import java.awt.image.*;
    import java.awt.Image;
    import java.awt.Graphics2D;
    import java.awt.geom.AffineTransform;
    import javax.swing.ImageIcon;
    byte[] b; /* your binary image */
    Image inImage = new ImageIcon(b).getImage();
    int iH=inImage.getHeight(null);
    int iW=inImage.getWidth(null);
    BufferedImage outBImage = new BufferedImage(iW,iH,BufferedImage.TYPE_INT_RGB);
    Graphics2D g2d = outBImage.createGraphics();
    g2d.drawImage(inImage,null,null);
    g2d.dispose();
    double scale=0.5; /* rescale the image to 50% of its original size*/
    int scaledW=(int)iW*scale;
    int scaledH=(int)iH*scale;
    BufferedImage dstbimg = new BufferedImage(scaledW, scaledH,BufferedImage.TYPE_INT_RGB);
    AffineTransform tx = new AffineTransform();
    tx.scale(scale, scale);
    Graphics2D g2d = dstbimg.createGraphics();
    RenderingHints qualityHints = new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
    qualityHints.put(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_QUALITY);
    g2d.setRenderingHints(qualityHints);
    g2d.drawImage(outBImage, tx, null);
    g2d.dispose();
    /* dstbimg is the scaled BufferedImage */

Maybe you are looking for