BufferedImage doesn't draw every gif

hi all,
I create a buffered Image which should show 2 different gifs (not animated). my problem is that it draws only one of them. I don't think that it has to do with the gif itself because I tried the same drawing without buffering and everything could be seen.
private BufferedImage bufferedBG;
setBG();
private void setBG() { 
Image linieH = getToolkit().getImage(getClass().getResource("img/bg_linieH.gif"));
Image linieV = getToolkit().getImage(getClass().getResource("img/bg_linieV.gif"));
setBackground( Color.WHITE );
bufferedBG = new BufferedImage( 676 + OFFSET_X, 578, BufferedImage.TYPE_INT_ARGB );
Graphics2D g = bufferedBG.createGraphics();
g.drawImage(linieH, 100,200, this);
g.drawImage(linieV, 150,300, this);
public void paint( Graphics g ) {
Graphics2D g2 = (Graphics2D) g;
g2.drawImage( bufferedBG, null, 0, 0 );
any ideas?
thanks
gammloop

I strongly suspect that what we have here may be confusion about user space and device space..
The Graphics2D instance in your image class DOES NOT share coords with your paint(Graphics g)
instance! Its x, y start is 0, 0 and bears no relation to the position on-screen of the component you are
trying to paint...

Similar Messages

  • Randomly when I plug my Iphone 4s into Itunes it will tell me that it can't detect my phone and that I need to restore it. It doesn't happen every time, but maybe every two weeks.

    Randomly when I plug my Iphone 4s into Itunes it will tell me that it can't detect my phone and that I need to restore it. It doesn't happen every time, but maybe every two weeks.I restore it and then it works for a while, but then a couple weeks later I'll plug it in and I get the same message again. It's very frustrating because even though I have all the settings to save to cloud, my apps and data don't all come back.

    Thank you both. I suppose I should have prefaced my question with the concern that I've read a number of other posts from people who have had a similar issue and when they tried to follow the directions, they ran into a multitude of other problems. As you might imagine, I'm hoping to avoid the creation of new problems as I try to solve this one. Thanks again.

  • Just recently getting error message when downloading podcasts.  Says "The iTunes Library file cannot be save.  You do not have enough access privileges for this operation."  Doesn't happen every time.  Using Windows 7.  What can I do?

    Just recently getting error message when downloading podcasts.  Says "The iTunes Library file cannot be save.  You do not have enough access privileges for this operation."  Doesn't happen every time.  Using Windows 7.  What can I do?  The files seem to be there but I don't know if they are being backed up to cloud.

    Hi, DickmoAZ.  
    Thank you for visiting Apple Support Communities.
    This sounds like a permission issue most likely with the iTunes Media folder.  Here is an article that will help you troubleshoot this issue.
    iTunes: Missing folder or incorrect permissions may prevent authorization
    http://support.apple.com/kb/ts1277
    Cheers,
    Jason H.

  • Drawing moving GIF images?

    Is it possible to draw moving gif images on a simple Frame applet?
    I made an image drawer class for my applet and i can draw simple 2d images.
    Here is the basis of my GameSprite class;
        public byte[] pixels;
        public int width;
        public int height;
        public GameSprite(String imageName, int requestIndex) {
         try {
                    // Removed code, it's zipInputStream, but it can be used just as ./image.jpg etc
         javax.swing.ImageIcon icon = new javax.swing.ImageIcon(fileBytes);
         width = icon.getIconWidth();
                     height = icon.getIconHeight();
                     pixels = fileBytes;
         } catch(Exception e) {
              e.printStackTrace();
        public void drawSprite(int x, int y) {
         try {
              Image image = Toolkit.getDefaultToolkit().createImage(pixels);
                                    //Removed code here
              graphics.drawImage(image, x, y + 7, width, height, observer);
         } catch(Exception e) {
              e.printStackTrace();
        }If i try to draw an animated gif image it dosn't move.
    Thanks for any help.

    In Java you need to override the paint method in AWT and paintComponenet method in SWING to do graphics/animation. If you go to an offscreen rendering, then you can paint to the graphics context of an image you use for a drawImage in your paint/paintComponent...
    If you where overriding a Panel in AWT you would override paint:
    public void paint(Graphics g){
      g.drawImage(im, 0, 0, this);
    }Then where you are maipulating your graphics you would do something like this:
    //code snippet
    Graphics g = im.getGraphics();
    //make what ever changes to im by manipulating the graphics context g
    repaint();

  • Drawing JPEGs/GIFs directly on JFrames

    Hey all,
    Is it possible to draw an image DIRECTLY onto an instance of the JFrame class, rather than writing a subclass of a component? I suspect that a solution to my problem might have something to do with the getGraphics() method of JFrame.
    Mike.

    Have you looked into your own suggestion? Doesn't the Graphics object returned from getGraphics() provide a drawImage() method?

  • PSD file import. Premiere doesn't show every picture?

    Hey guys, I'm new to all this, so please go on and show me the right direction if I'm wrong here
    I'm working on a project since a few months and I'm using the same Premiere File and the same PSD file since then.
    Of course I'm changing the PSD a few times to, so I can actually put in more pictures in Premiere and do stuff with them!
    But now, as my PSD file got a bit larger, much more folders, much more pictures, Premiere doesn't want to show me
    every single picture!! What is wrong? Do I do something wrong now? Is it really because of the psd file being a bit bigger now?
    If you need anymore information don't hesitate to contact me!
    Greetings and happy eastern!
    Mustafa

    thanks for the advice JSS1138!
    That is highly frustrating if I save every single picture, but if I haven't any choice I have to do that.
    Is there any other option?

  • ITunes crashes and doesn't respond every time I open it.

    iTunes worked fine when I had it with my first iPod. I then lost this one and got a new one and since then whenever I open up iTunes it works for about 10 seconds and then fails to respond. I then have to CtrlAltDel to exit the programme where every time it says "this programme is not responding"
    I have tried uninstalling and re-installing iTunes but with no joy.
    Any help on this matter would be greatly appreciated! Thanks!

    You have to update your QuickTime. iTunes is codependent on QuickTime and if you have the most recent version of iTunes and an older version of QuickTime then iTunes will not function properly, go figure. I discovered that QuickTIme does not always update with iTunes and therefore requires you to separately update QuickTime.

  • IMovie HD doesn't play animated .gif's

    why doesn't it play them? all I get is a still of the first frame, no animation. Can anybody clue me in? If you want the files to play with, they're here:
    http://perfectionconstruction.com/test/naruto.html

    Hi
    To move projects to external hard disks can be near to fatal.
    Eternal hard disk
    • *SHOULD BE* a FireWire one - USB/USB2 performs badly
    • *HAS TO BE* - Mac OS Exstended formatted
    (Usually not but UNIX/DOS/FAT32/Mac OS Exchange which doesn't work)
    (Even so if it's bought at Apple Store - a bad thing)
    If so You need
    • Other Space to move Your project to
    • Lennart Thelander repair kit
    If You re-format Your hard disk - IT WILL BE ERASED - Totally
    Yours Bengt W

  • I use apple TV to watch Netflix.  How can I stream the movie, so it doesn't stop every few minutes?

    Why does the Netflix not streaming all at once, instead of every few minutes, interrupting the movie.

    Welcome to the Apple Community.
    Intermittent problems are often a result of interference. Interference can be caused by other networks in the neighbourhood or from household electrical items.
    You can download and install iStumbler (NetStumbler for windows users) to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items.
    Refer to your router manual for instructions on changing your wifi channel or adjusting your multicast rate.
    There are other types of problems that can affect networks, but this is by far the most common, hence worth mentioning first. Networks that have inherent issues can be seen to work differently with different versions of the same software. You might also try moving the Apple TV away from other electrical equipment.

  • My iCalendar syncs between my iPad and my iPhone, but doesn't sync every entry with iCloud on my PC.  Any thoughts on how to fix this?

    I live by my iCalendar and when I pulled it up on my PC this evening, I've noticed that only certain entries are syncing with my iCalendar (on my PC).  For example, my work schedule is present on my PC, iPhone, and iPad, but my class schedule is only present on my iPad and iPhone.  I have my settings adjusted so that every event/entry is to sync, and I just plugged my iPhone into my computer to sync it as well but to no avail.  
    Any thoughts on what I'm doing wrong? 
    Thank you!

    Welcome to the Apple Community.
        1.    First check that all your settings are correct, that calendar syncing is checked on all devices (system preferences > iCloud on a mac and settings > iCloud on a iPhone, iPad or iPod).
        2.    Make sure the calendars you are using are in your 'iCloud' account and not an 'On My Mac', 'On My Phone' or other non iCloud account (you can do this by clicking/tapping the calendar button in the top left corner of the application ), non iCloud calendars will not sync.
        3.    If you are sure that everything is set up correctly and your calendars are in the iCloud account, you might try unchecking calendar syncing in the iCloud settings, restarting your device and then re-enabling calendar syncing settings.

  • Flash player 11.0 flickers/doesn't draw whole frames

    Hello,
    I'm currently running Flash Player 11.0.1.152 on Arch Linux 64-bit, with nVidia driver 285.05.09. I'm coming across a lot of Flash videos where terrible flickering occurs. The frame rate is very good but it seems like some of the frames themselves are only partially drawn (you can see a screenshot here**) which makes the whole video flicker terribly. I've also seen it places like here (particularly the loading screen, but you can also see it to a lesser extent in the video on the front page). Places like Youtube and Blip.Tv work fine.
    Fiddling with hardware acceleration or quality settings doesn't fix it, however simply opening the settings box has a temporary effect: the flicker disappears entirely for as long as the box is there. Upon closing the settings box, flicker immediately resumes. Scrolling the box mostly offscreen resumes flicker, too.
    I primarily use Firefox 7.0.1, but there's no change when using Chromium.
    After upgrading to 11.2 the video plays silky smooth, however I've found the beta is still too unstable for general use, so I can't simply use that. Is there something I can do to fix 11.0 while waiting for the beta to stabilize?
    I've also included a paste dump of my GLXinfo if that will help in any way.
    Thanks for your time!
    **Note that if you wish to check the video itself, the flicker isn't immediately apparent from the start, however clicking the first red dot that skips to Part One will drop you straight into a flickery part.
    EDIT: I found out that when my video card is forced into its highest performance setting, flickering is greatly reduced though doesn't disappear entirely.

    What is your operating system, version & edition?
    What is your web browser?

  • Itunes doesn't show every song i have

    Eeya guys,
    I'm experiencing a problem with itunes. When i start up my itunes and typ in the album of my newly downloaded minimal tracks. It only shows like 60% of the songs that are in there. So i tried to manually add them to the library by pressing "add to library" then click the desired song. But it won't add it. When i look in the directory where the itunes library stores it songs it also doesn't show the song. So i might be able to add them by coping the file from my music folder to my library folder, but my question is: why does itunes does this and maybe there are more songs which i don't know about that it also doesn't show. Hope someone got a solution for me, thanks

    Well, I have one episode of Top Gear series 14 and I want to buy the rest of the series but I don't want to buy each episode individually as it costs more. If I click the button to buy the whole series will I get I get the discount off from the episode that I already have and will it download all the episodes apart from the one that I already have.

  • Drawing multiple .gif images

    Hello, I am creating a Card class and a Deck class, and I have .gif images for each card. I am trying to create a CardDisplay class to test my images. The Card/Deck classes work fine, but I am running into problems getting the images to display. What I have is a JFrame and I use a JLabel for each .gif image. When I add the JLabel to the contentPane, it is still only showing a blank window. Can someone give me any guidance as to how to go about this? Also, I am assuming once I get it to display 1 gif, it will display the remaining 51 in the same place. What I am trying to do is to display them all in a row.. well 4 rows of 13 cards that is. Thanks in advance,
    dub stylee

    Also, just wanted to add that this is not for school. I am doing this for a personal exercise using swing components. I made a card game when I was taking java 1 class, but now I am trying to familiarize myself with the use of graphics. Thanks to anybody who can help.
    dub stylee

  • I bought a brand new Ipod touch on 12/30/12. it was white and the home button doesn't work every time... ANy ideas?

    Help please

    I would make an appointment at the Genius Bar of an Apple store.  You can also try here:
    fix for Home button

  • Midi keyboard doesn't work every once in a while

    This is the most strangest thing I have encountered so far. Everything is working, putting notes into Logic via my midi controller. All of a sudden, it stops working. I try to play notes on the keyboard but nothing, no response. I can play them fine with the mouse on the virtual keyboard (on one of the instances - Kontakt 3), but not via my controller. I don't push any buttons by accident either for it to stop working.
    I close the project, reopen it, but nothing. I restart the computer but nothing. If I open a new project THEN it works. I have it set on midi channel 1. Sometimes I switch it to omni and it starts working. But not lately.
    What is the problem here?
    Thanks.

    What make and type is it?

Maybe you are looking for

  • Itunes cannot open because another user is using it, please ask them to clo

    I'm on a network with my sister and little brother, but none of us will be using itunes and when I try to get in it, it says that "Itunes cannot open becuase it is currently being used by another user, please have them close out to continue" or somet

  • OnKeyUp/onKeyDown does not react to Escape

    This bit of code copied from a tutorial works fine except Escape key reacts only if any other key was pressed before. If after loading the file Esc is the first key pressed it does not react no mater how many times it is pressed. In other application

  • Configure Soap Adapter for compress, gzip.

    HI to all experts, do anyone know how can configure a soap adapter with the parameter for compress, gzip. i found a document which explain so: localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean XMBWS.XMLEncoding Content-Type charset iso-8

  • IPhone 5 red 1 in settings app

    I have recently upgraded form an iPhone 4 to the iPhone 5. Everything has been downloaded from my 4 without any problems. However, I have a red 1 in the settings application that I cannot get rid of. I have checked everything in the settings and noth

  • Is run WS_MANUAL_WEBI_AFTER_IMPORT harmful for correct working webservices?

    Hi guru's, After implementing HRSP's recently we had the error "Virtual interface not found" when accessing the endpoint. Fortunately we found the solution in the discussion groups of SCN; running the report WS_MANUAL_WEBI_AFTER_IMPORT. For the near