'Ghosts' seen through transparent GIFs

An interesting thing I've noticed regarding the thumbnails of images with transparent pixels (such as animated GIFs) in the Photos app: instead of showing blackness, the transparent pixels are covered with thumbnails of other images I've recently deleted. I say 'thumbnails' of previous images because a thumbnail of a video was once 'spliced' in, with the video length and all showing in the should-be-blank spaces of the image.
What's going on? I'm pretty sure a camera roll clean out to my computer, or a simple reboot/re-sync/restore will fix it, but I would really like to know WHY, and if it will keep happening.

JPhillips,
Lookout only accepts BMP or WMF, formats that unfortunately don't allow transparency. Although, there's a way to do what you want.
You must use a BMP filled with a flat color in the area you want to make transparent(use any image editor,ex. photo paint, paint, etc.). Then rigth-click over the panel and choose "INSERT GRAPHICS". Select your BMP and select the pixel which color you want to make transparent.(Enter X and Y coordinates in the Transparent pixel fields, and the corresponding color becomes transparent. The top-left corner of the bitmap is X=0, Y=0; the center is X=-1, Y=-1; the bottom-right corner is X=-2, Y=-2. To get the result you want, try entering a value for X, then a value for Y, then click in the X field to see how the bitmap is affected.)
regards
JSS

Similar Messages

  • Hide line art seen through upper layer line art?

    I'm doing a t-shirt illustration and I need the line-art to overlap, remain transparent (no fills) and not see the line art behind through the front line art. If I have two shapes overlapping, I don't want the illustration behind to be seen through the front illustration. I can't use a fill on the front art, because I need to maintain transparency on all the artwork so that the t-shirt color shows through. In Photoshop, I would simply mask away the bottom layer areas I wanted to disappear. I don't know how to do this in illustrator. I'm working in CS4 and I am a newbie. Any help would be appreciated.
    In the example below, the gray circle is in front of the white circle. I want the intersecting area inside the gray circle to be clear so that I do not see the section of the white circle contained within. I can't use a fill because I need both circles to remain clear so the fabric of the t-shirt shows through.

    I can't use a fill on the front art, because I need to maintain transparency...
    That depends on how the T-shirt is going to be printed. For example, if the design you've shown is going to be screen printed on a gray shirt (as your screenshot implies), you could simply:
    Define a dark gray spot color Swatch and apply it to the left circle.
    Define a light gray spot color Swatch and apply it to the right circle.
    Fill the left circle with the default white swatch.
    In screen printing, you need to think in terms of inks, not colors.In a program like Illustrator, white means "no ink." The design would be printed as color separations. There would be no "white" separation unless you defined a white Swatch as a spot color and used it.
    JET

  • Regarding transparent gif creation

    To anyone who knows more about this subject, I'm looking for some sample code.
    I've been having trouble redrawing an image as a gif while introducing transparent regions.
    The following method results in blackness where the transparency should be:
        [http://www.exampledepot.com/egs/java.awt.image/DrawOnImage.html]
    The next method accomplishes the transparency, but the non-transparent areas suffer in quality (I am drawing a BufferedImage of an outdoor scene after the transparency is drawn - it come out grainy). I think this is because in creating a new ColorModel to establish the transparent pixels, the original colors are approximated.
        [m-10305410]
    Can anyone show me how to establish a transparent gif with the original quality of the non-transparent areas preserved?
    Thanks.

    I think I can accomplish what you suggest by creating the bufferedImage as type TYPE_INT_ARGB.
    Although it doesn't show the creation of the BufferedImage in the first link of the two above, specifying TYPE_INT_ARGB doesn't seem to make a difference.
    The second link seems to provide a way around this by setting the transparency through use of a new ColorModel.
    This is guesswork. If it's a false assumption that initializing a BufferedImage with TYPE_INT_ARGB provides alpha support, let me know.
    By grainy, I mean pixelated.
    The code I used can be found at:
         [http://forums.sun.com/thread.jspa?threadID=5333259&tstart=45]
    I had posted the subject there earlier, but I think I didn't get to the point soon enough (no replies).
    You can cut and paste that code and try the two methods bWITH_TRANSPARENCY=true & bWITH_TRANSPARENCY=false and see the difference in the quality of the images produced. Just change "c:\\myjpg.jpg"; to point at a JPG file on your system.

  • Creating a transparent GIF in Photoshop CS4

    I am new to Photoshop CS4 and I'm finding it a bit of a 'challenge'.
    I would like to create a transparent GIF of my signature, so that I can put it into various documents.
    My signature is on a white background and is written using a blue ball point pen and is scanned in as a colored GIF file.
    Despite having Googled how to do that I am completely stumped.  They talk about using the lasso tool to draw around my signature (which I do) and then they say press the delete key.  Well, on my iMac NOTHING happens!
    Can anyone offer me a simple tutorial (for the Mac) that can walk me through creating a transparent GIF file of my signature?
    Thanks,
    Peter

    Load luminance or the channel with the best contrast by command-clicking the appropriate channel in the Channels Panel
    It seems hard to make it more clear …
    Command-click (hold the command-key pressed while clicking) the composite Channel’s icon (or any of the other channels’ if you should deem them preferable) in the Channels Panel.
    This should load a Selection.
    I would like to create a transparent GIF of my signature, so that I can put it into various documents.
    Where do you want to do that anyway (Photoshop, some layout-software, a browser …)?
    Because depending on that using a file-format of fairly limited features like gif could seem inadvisable.
    the problem I have with Photoshop CS4 is that when I enter the help system it goes to the web and give me help for Photoshop CS5!!!!
    You should be able to download the Help as a pdf here:
    http://kb2.adobe.com/cps/408/kb408379.html
    If psd doen’t mean anything to you you should look it up.

  • How to import transparent gifs in after effects cc

    I just upgraded form after effects cs5 to cc and one thing i cant understand is why i cant directly import transparent gifs as i could in cs5. I heard that you have to make a png sequence from fireworks but i dont want to go through all of that. I would appreciate if someonecan tell me how to easily import transparent animated gifs into after effects cc as you could in sc5

    You can't and that is that. This stuff used Quicktime components and simply too much has changed. You need to work with image sequences exported from Photoshop or whatever other program based on your GIF.
    Mylenium

  • Trouble buffering transparent gif

    I've been working on a fairly simple interface that allows multiple people to use sprites and walk around in a room conected through the internet. I've been having lots of the normal trouble with flickering but I had solved it with buffering. As soon as I started trying to use a transparent gif as the sprite the flickering returned. Here I have greatly simplified my program to basicaly just show the flickering after you hit connect so there is a lot of stuff that was used in the full version but is pointless here. If you make "sprite.gif" a normal gif there is no problem, but when its transparent there is noticeable flickering. Does anyone know why this happens?
    import javax.swing.*;
    import java.io.PrintWriter;
    import java.net.Socket;
    import java.net.URL;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.BufferedInputStream;
    import java.io.ObjectInputStream;
    public class GifDisplay extends JPanel implements ActionListener {
        JTextArea topTextArea;
        Color m_clrBg = new Color(0, 0, 100);
        static JTextArea bottomTextArea;
        JButton button1, button2;
        final static String newline = "\n";
        static JTextField namef, input_text; // Textfields
        Button display_button; // Display button
        static JLabel message, input_label, output_label; // Labels for textfields
        String out_string;
        static JButton button;
        static Image image, image1, image2, image3, image4, image5, image6;
        static JTextArea textArea, online;
        static int start, start2;
        static Color squareColor; // The color of the square.
        int squareTop, squareLeft; // Coordinates of top-left corner of square.
        boolean focussed = false; // True when this applet has input focus.
        static boolean init = false;
        static DisplayPanel canvas; // The drawing surface on which the applet draws,
        // belonging to a nested class DisplayPanel, which
        // is defined below.
        Image m_imgOffScr = null; //  Image for off-screen drawing -- "back buffer"
        Graphics m_gOffScr = null; //  Graphics drawing interface to offscr image
        public GifDisplay() {
            super(new GridBagLayout());
            GridBagLayout gridbag = (GridBagLayout) getLayout();
            GridBagConstraints c = new GridBagConstraints();
            message = new JLabel("Enter Name:");
            gridbag.setConstraints(message, c);
            add(message);
            c.weightx = 1;
            c.ipadx = 250;
            namef = new JTextField(15);
            namef.setEditable(false);
            namef.setForeground(Color.BLACK);
            gridbag.setConstraints(namef, c);
            add(namef, c);
            c.ipadx = 0;
            c.weightx = 0;
            c.ipady = 60;
            c.gridwidth = 2;
            c.gridheight = 2;
            c.gridx = 0;
            c.gridy = 1;
            c.fill = GridBagConstraints.BOTH;
            bottomTextArea = new JTextArea();
            bottomTextArea.setEditable(false);
            JScrollPane bottomScrollPane = new JScrollPane(bottomTextArea);
            gridbag.setConstraints(bottomScrollPane, c);
            add(bottomScrollPane);
            c.ipady = 80; //reset to default
            c.ipadx = 60; //make this component tall
            c.weighty = 1.0;
            c.weightx = .8;
            c.gridwidth = 0;
            c.gridheight = 3;
            c.weighty = 1;
            // c.ipady = 40; //make this component tall
            c.gridx = 3;
            c.gridy = 0;
            online = new JTextArea();
            online.setEditable(false);
            JScrollPane onlinePane = new JScrollPane(online);
            // bottomScrollPane.setPreferredSize(preferredSize);
            gridbag.setConstraints(onlinePane, c);
            add(onlinePane);
            c.weightx = 0.0;
            c.gridwidth = 4;
            c.gridx = 0;
            c.gridy = 3;
            c.weightx = 1;
            c.weighty = 1;
            c.fill = GridBagConstraints.BOTH;
            squareColor = Color.red;
            canvas = new DisplayPanel(); // Create drawing surface and
            canvas.setBackground(Color.white); // Set the background color of the canvas.
            squareTop = canvas.getSize().height - canvas.getSize().height / 10 / 2;
            squareLeft = canvas.getSize().width - canvas.getSize().height / 10 / 2;
            gridbag.setConstraints(canvas, c);
            add(canvas);
            c.fill = GridBagConstraints.NONE;
            c.ipady = 0; //reset to default
            c.weightx = 0;
            c.weighty = 0;
            c.gridwidth = 3;
            c.gridx = 0; //aligned with button 2
            c.gridy = 7; //third row
            c.gridwidth = 1;
            button1 = new JButton("Connect");
            gridbag.setConstraints(button1, c);
            add(button1);
            start = 1;
            button1.addActionListener(this);
            namef.addActionListener(this);
            URL url = this.getClass().getResource("sprite.gif");
            image3 = getToolkit().getImage(url);
            setPreferredSize(new Dimension(500, 500));
        class DisplayPanel extends JPanel {
            public void update(Graphics g) {
                paint(g);
            public void paint(Graphics g) {
                while (Abstract.paint) {}
                if (refresh.buffer1 != null) {
                    g.drawImage(Abstract.buffer, 0, 0, this); //  Just display the "back" buffer
                } else {
                    g.setColor(m_clrBg);
                    g.drawRect(0, 0, getSize().width, getSize().height);
                Abstract.paint = true;
        } // end nested class DisplayPanel
        public static void disp(String mes) {
            bottomTextArea.append(mes);
            bottomTextArea.setCaretPosition(bottomTextArea.getDocument().getLength());
            Toolkit.getDefaultToolkit().beep();
        public static void onup(User c[]) {
            online.setText("");
            for (int l = 0; l < c.length; l++) {
                if (c[l].active && c[l].name != null) {
                    online.append(c[l].name + newline);
        public static void sen(String h) {
            try {
                PrintWriter os = new PrintWriter(Abstract.soccer().
                                                 getOutputStream());
                os.print(h + "\r\n");
                os.flush();
                init = true;
            } catch (java.io.IOException c) {
        public void actionPerformed(ActionEvent e) {
            if (e.getSource().equals(button1)) {
                if (start == 0) {
                    start = 1;
                    sen(":exit:");
                    System.err.println("Exit");
                    namef.setEditable(false);
                    button1.setText("Connect");
                    message.setText("Enter Name:");
                } else {
                    start = 0;
                    new refresh().start();
                    start2 = 0;
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("GifDisplay");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            JComponent newContentPane = new GifDisplay();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    class Abstract {
        static Socket s;
        static int serial;
        static String c[];
        static String name;
        static Image buffer;
        static boolean paint = false;
        static JFrame fra;
        public static Socket soccer() {
            return s;
        public static void soccer(Socket soc) {
            s = soc;
        public static void retu(String a[]) {
            c = a;
        public static void retun(String a) {
            name = a;
        public static void fram(JFrame a) {
            fra = a;
        public static void ser(int a) {
            serial = a;
    class refresh extends Thread {
        static int f[][];
        Color m_clrBg = new Color(0, 0, 100);
        static Image buffer1;
        Graphics pad;
        final static String newline = "\n";
        private User m[];
        Image image;
        public void run() {
            int place = Abstract.serial;
            while (true) {
                if (Abstract.paint) {
                    painter(place);
                    GifDisplay.canvas.repaint();
        public void painter(int place) {
            int width = GifDisplay.canvas.getSize().width; // Width of the applet.
            int height = GifDisplay.canvas.getSize().height; // Height of the applet.
            buffer1 = GifDisplay.canvas.createImage(GifDisplay.canvas.getSize().width,
                                               GifDisplay.canvas.getSize().height);
            pad = buffer1.getGraphics();
                pad.drawImage(GifDisplay.image3, 55, 55,
                              width / 25, height / 25 * 2,
                              GifDisplay.canvas);
            Abstract.buffer = buffer1;
            Abstract.paint = false;
    }

    Cross post http://forums.java.sun.com/thread.jspa?threadID=637547
    � {�                                                                                                                                                                                           

  • Transparent Gif Background?

    Hello,
    I've been trying to make a gif with a transparent background, however I've been having a few problems with it.
    While the gif does start fine and the background is transparent at the beginning, after a few frames the background color would come up and then after a few frames more it'll be transparent again, then colored again.
    It's really troubling since I've been stalking every forum I could find on the subject, however my research had deemed fruitless.
    The best I could find out is that when I change its palette on the 'Publish settings' to either Web 216 or Web Snap Adaptive--the background stays transparent! However in return, the colors of the gif turn really ugly. The only palette setting I could go with that won't ruin its colors is 'Adaptive' of course, but I really want it to be transparent and it would absolutely not give me that choice. The other option for the palette choice is Custom which also makes the background transparent--however I don't know what palette to use for it since even if I chose the photo itself as a palette resource the colors still come out undesireable. I'm not really sure what the best 'palette choice' is for custom. (do you have a specific file to use for that?)
    Anyways I would love it if I could get some help figuring this out! It seems simple enough, but I really can't for the love of me figure it out.

    Normally in transparent GIF creation only one color can be used to define the transparency.  It sounds like somewhere along the line your background color is changing such that it no longer matches the transparency color.

  • Best way to edit out a white background and make a transparent gif

    I have an image I purchased but need to make it into a gif. It already has a white background but when I use the magic wand it chops little bits of the edge of the images up.
    Is there an easier way of editing the white out of this background and making a transparent gif?
    I am using Adobe Photoshop CS2
    Image is attached to take a look.
    Thanks, I appreciate any help with this.
    Nick

    Worked perfect at a tolerance of 10, didn't know what that was for before
    Thanks!
    Nick

  • Does Keynote 6.0 no longer support Transparent GIF or Quicktime Animations?

    So, I have some sample files here:
    Bees and Honey Clear Quicktime
    http://www.presentermedia.com/blog/wp-content/uploads/2013/10/beehive_bees_400_c lr_12723.mov
    Bees and Honey Clear GIF
    http://www.presentermedia.com/blog/wp-content/uploads/2013/10/beehive_bees_150_c lr_12723.gif
    Bees and Honey Green Background Quicktime
    http://www.presentermedia.com/blog/wp-content/uploads/2013/10/beehive_bees_12723 _grn.mov
    Bees and Honey Blue Background GIF
    http://www.presentermedia.com/blog/wp-content/uploads/2013/10/beehive_bees_12723 _blue.gif
    Moving on...
    At my company, we create images, animations, video backgrounds and templates for PowerPoint and Keynote etc.  Keynote '09 (iwork '09) and PowerPoint 2008 and 2011 on the Mac, all work.  Now we're hearing that the transparent backgrounds are no longer being recognized (black background instead of clear).  Is anyone able to check this for me and let me know if there is a workaround or something? I can't find any documentation on how Quicktime changed with Maverick or Keynote 6, so need to do real world testing I'm only running '09 on my Mac and won't have Keynote 6 for another 2 weeks or so.
    Please let me know, I may be able to throw in a free subscription to our website for someone who can help me with this.

    Hello all... I'm maybe a little late to the party here, but I've had the same trouble for a while with both animated Transparent gifs and quicktime movies with an alpha channel matte.
    This morning I spent half an hour tinkering with the export options from quicktime player pro on my old laptop (I used QT 7.6.6 on OSX 10.8.5) and managed to make a "transparent" quicktime movie which plays in the new version of Keynote.
    If you have access to the old version of quicktime player pro, you can open your transparent, previously playable file (.gif or .movie) and use the ProRes compressor, using the "4444" option in the list of compressors. Make sure the colours are set to "millions+" to retain the matte and you shoud be OK.
    It works a charm... you have to re-import it, simply replacing the original file in the finder seemingly doesn't work, but you can use this method to generate a working version and take 30 seconds to re-import it into the keynote.
    Yes, the files are much larger than gifs. Yes it's a lot of messing around if you're not familiar with movies. But in principle it worked for me and sorted out a whole heap of my problems.
    Just for note, I've not tried exporting it to Powerpoint as I've no need to do so, or way to test it, but I guess that is a different matter.
    Hope that makes sense!

  • Error while connecting oracle11g to sql server through transparent gateway

    Hello
    i'm facing this errors when i try to connect oracle 11g to sql server through transparent gateway:
    http://www.freeimagehosting.net/newuploads/d4454.jpg
    the directory for my db is : C:\oracle\product\11.1.0\db1
    and for the gateway: C:\oracle\product\11.1.0\dg4msql
    the configurations i used:
    gateway :
    tnsnames.ora:
    dg4msql =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=Kinda-PC)(PORT=1522))
    (CONNECT_DATA=(SID=dg4msql))
    (HS=OK)
    listener.ora:
    GATELIST =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Kinda-PC)(PORT = 1522))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (PROGRAM = dg4msql)
    (SID_NAME = dg4msql)
    (ORACLE_HOME = C:\oracle\product\11.1.0\dg4msql)
    and for the oracle database :
    listener.ora
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = Kinda-PC)(PORT = 1521))
    tnsnames.ora:
    DB1 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Kinda-PC)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = db1)
    gateway =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=Kinda-PC)(PORT=1522))
    (CONNECT_DATA=(SID=dg4msql)
    (HS=OK)
    thanks :)
    Edited by: 903043 on Dec 18, 2011 6:18 AM

    Did you go through the various steps in the doc?
    There is a gateway specific forum below;
    Heterogeneous Connectivity
    Cheers
    David

  • How to add text to transparent gif?

    Hi, I'm using Photoshop 6.01. with Windows 7 Professional.  I have a transparent gif file, to which I want to add text, including bullets.  The stuff I want to add is now on one of my webpages, and so is the gif, but I want to combine the image and the text.  Is there a way to do this?  If so, how?
    Thanks.

    If I understand what you are after and due to the point that Marion made. It would be wise to overlay the html text onto the graphic. To do so I recommend that you do a bit of research on CSS for absolute position and placement.
    But this assumes that the text in the html fits your needs. If you require special effects applied to the text or even fonts that are not supported via html, then you are more or left forced to use either photoshop or flash.

  • How can I take away the 1x1 transparent gif on my slideshows in muse?

    How can I take away the 1x1 transparent gif on my slideshows in muse?  It's showing up as a SEO error only on the pages that include slideshows. 

    To see all the photos on the phone, including photos that have already been imported into iPhoto, deselect the "Hide Photos Already Imported" checkbox. If the camera contains photos that have already been imported into iPhoto, those photos are hidden by default.

  • White lines around transparent gifs

    I've tried without success to eliminate the thin white line
    that appears around my transparent gifs in Fireworks. Does anyone
    know how to achieve this?

    The problem is how GIFs render transparency. What might help
    is to change the "matte" color found in the Optimize panel. It's
    probably set to white. Set it to match the background color of
    wherever the GIF is going to go.
    Because GIFs can't have semi-transparency, then anti-aliased
    (smoothed) edges basically have to have a background color baked
    into those pixels, that's what the matte color it. However, if you
    use PNG32 or PNG8 with Alpha Transparency, it will remain smooth.
    The only problem is the same problem with most things on the web:
    Internet Explorer. Alpha Transparency doesn't work in Internet
    Explorer 6 or below, without using some crazy hacks you'd have to
    google for.

  • Transparent GIFs for the web

    Hope someone can help with this.
    I'm basically trying to optimize a transparent image for the
    web. I have a straight PNG vesion here, which is what I'm trying to
    do, but it's around 96k - so a bit high.
    It looks like :
    example
    one
    I tried exporting it as an 8 bit PNG, which got the file size
    down, and looks OK in Safari, but looks hopeless in IE (6) :
    example
    2
    So I tried exporting as a transparent GIF, but it only looks
    like these :
    example
    3
    example
    4
    Any tips on how I can optimize it a bit better for the web,
    and retain it's original appearance?
    Cheers.

    As I have asked several times on the DW forum, how did you
    export the PNG
    image?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Iain71" <[email protected]> wrote in
    message
    news:fan87d$n8r$[email protected]..
    > Hope someone can help with this.
    >
    > I'm basically trying to optimize a transparent image for
    the web. I have a
    > straight PNG vesion here, which is what I'm trying to
    do, but it's around
    > 96k -
    > so a bit high.
    >
    > It looks like :
    >
    >
    http://www.handprintdvd.co.uk/webdesign/carcarenew/homepagetemp.shtml
    >
    > I tried exporting it as an 8 bit PNG, which got the file
    size down, and
    > looks
    > OK in Safari, but looks hopeless in IE (6) :
    >
    >
    http://www.handprintdvd.co.uk/webdesign/carcarenew/homepage.shtml
    >
    > So I tried exporting as a transparent GIF, but it only
    looks like these :
    >
    >
    http://www.handprintdvd.co.uk/webdesign/carcarenew/homepagetemp3.shtml
    >
    >
    http://www.handprintdvd.co.uk/webdesign/carcarenew/homepagetemp4.shtml
    >
    > Any tips on how I can optimize it a bit better for the
    web, and retain
    > it's
    > original appearance?
    >
    > Cheers.
    >

  • ANuB figures out how == overlap transparent gif in a JPanel!

    I have to say I have a hate/love realtionship with this forum. Sorry if I ofend but I know it's hard sometimes to get an answer for help as it is purely voluntary. But I've asked help for this a bazillion times and help has been min to null, but I want to say I'm hoping to post something to help someone how to figure out how to Overlap a transparent image or transparent gif over another in a custom JPanel and display it when an action is called. (action called code to follow soon in another forum)
    import java.awt.*;                                                                                          //     import extension packages
    import javax.swing.*;
    * <strong>TransparentImageExample</strong> -- drawing a transparent
    * image on top of a background image.
    public class PizzaImage extends JPanel
         private Icon     icnPizza,
                             icnLoaded,
                             icnSausage,
                             icnPepp,
                             icnOnion,
                             icnGrPep,
                             icnMush,
                             icnOlive,
                             icnGarlic,
                             icnPineApp,
                             icnSpinach;
         private Color bgColor;
         public void paintComponent( Graphics g )
              super.paintComponent( g );
              bgColor = new Color( 255, 235, 160 );
              this.setBackground( bgColor );
              icnPizza = new ImageIcon( "pzaThin.gif" );
              icnLoaded = new ImageIcon( "icnLoaded.gif" );
              icnSausage = new ImageIcon( "topSausage.gif" );
              icnPepp = new ImageIcon( "topPepp.gif" );
              icnOnion = new ImageIcon( "topOnion.gif" );
              icnGrPep = new ImageIcon( "topGrPep.gif" );
              icnMush = new ImageIcon( "topMush.gif" );
              icnOlive = new ImageIcon( "topOlives.gif" );
              icnGarlic = new ImageIcon( "topGarlic.gif" );
              //icnPineApp = new ImageIcon( "topPineApp.gif" );
              //icnSpinach = new ImageIcon( "icnLoaded.gif" );
              icnPizza.paintIcon( this, g, 0, 0 );
              icnSausage.paintIcon( this, g, 0, 0 );
              icnPepp.paintIcon( this, g, 0, 0 );
              icnOnion.paintIcon( this, g, 0, 0 );
              icnGrPep.paintIcon( this, g, 0, 0 );
              icnMush.paintIcon( this, g, 0, 0 );
              icnOlive.paintIcon( this, g, 0, 0 );
              icnGarlic.paintIcon( this, g, 0, 0 );
         public void draw()
              repaint();
    so just import the above code in a class fime which extends JPanel and display the PizzaImage objVariable  = new PizzaImage() in the component of your choice.
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    You guys are right about setting the background color outside of the paint method. I was more pre-occupied with trying to overlap the images. So now I have it set. NOW I need to draw each item when it is selected with a JCheckBox and I can't think of a good way to do that. Is there a way to undraw an image? I suppose I've gone too long w/o sleep. Here's what I have.
    // this code is in another class file
    private class chkBoxHandler implements ItemListener
              public void itemStateChanged( ItemEvent e )
                   for( int i = 0; i < chkBoxName.length; i++ )
                        if( e.getSource() == toppingChk[ i ] )     
                             if( e.getStateChange() == ItemEvent.SELECTED )
                                  pzaImage.setImage( i );
                                  pzaImage.draw();
                             if( e.getStateChange() != ItemEvent.SELECTED )
                                  JOptionPane.showMessageDialog( null, "Button Unselected",     //     displays a message
                                       "About MyPizzeria", JOptionPane.PLAIN_MESSAGE );          //     code to "undraw" the image will go here
    import java.awt.*;     
    import javax.swing.*;
    public class PizzaImage extends JPanel
         int     thisImgNum = -1;
         Icon pzaThin, icnLoaded;
         public String imgName[] = {     "topSausage.gif",
                                            "topPepp.gif",
                                            "topOnion.gif",
                                            "topGrPep.gif",
                                            "topMush.gif",
                                            "topOlives.gif",
                                            "topGarlic.gif",
                                            "topPine.gif",
                                            "topSpinach.gif"
         public Icon topping[] = {     new ImageIcon ( imgName[ 0 ] ),
                                            new ImageIcon ( imgName[ 1 ] ),
                                            new ImageIcon ( imgName[ 2 ] ),
                                            new ImageIcon ( imgName[ 3 ] ),
                                            new ImageIcon ( imgName[ 4 ] ),
                                            new ImageIcon ( imgName[ 5 ] ),
                                            new ImageIcon ( imgName[ 6 ] ),
                                            new ImageIcon ( imgName[ 7 ] ),
                                            new ImageIcon ( imgName[ 8 ] )
         private Color bgColor;
         public PizzaImage()
              setBackground(new Color(255, 235, 160));                         
              pzaThin = new ImageIcon( "pzaThin.gif" );                         
              icnLoaded = new ImageIcon( "icnLoaded.gif" );                    
         public void setImage( int img )                                             
              thisImgNum = img;                                                       
         public void paintComponent( Graphics g )                              
              super.paintComponent( g );
              pzaThin.paintIcon( this, g, 0, 0 );                                   
              if( thisImgNum == 0 )
                   topping[ 0 ].paintIcon( this, g, 0, 0 );
              if( thisImgNum == 1 )
                   topping[ 1 ].paintIcon( this, g, 0, 0 );
              if( thisImgNum == 2 )
                   topping[ 2 ].paintIcon( this, g, 0, 0 );
              if( thisImgNum == 3 )
                   topping[ 3 ].paintIcon( this, g, 0, 0 );
              if( thisImgNum == 4 )
                   topping[ 4 ].paintIcon( this, g, 0, 0 );
              if( thisImgNum == 5 )
                   topping[ 5 ].paintIcon( this, g, 0, 0 );
              if( thisImgNum == 6 )
                   topping[ 6 ].paintIcon( this, g, 0, 0 );
              if( thisImgNum == 7 )
                   topping[ 7 ].paintIcon( this, g, 0, 0 );
              if( thisImgNum == 8 )
                   topping[ 8 ].paintIcon( this, g, 0, 0 );
         public void draw()
              repaint();
    }

Maybe you are looking for