BufferedImage transition 1.4.2 to 1.5.0 and 1.6

Hello everybody,
I'm currently writing a application which displays a lot of graphics. But lately I've come upon some problems.
My applications is a JFrame with a two JPanels embedded. One for showing the graphics which is embedded in a SchollPane. I use double buffering to show the graphics (BufferedImage).
The application also has a zoom function because of the huge amount of data plotted in the image.
public void paintComponent(Graphics g)
     super.paintComponent(g);
          Graphics2D g2context = (Graphics2D)g;          g2context.drawImage(buffer,0,0,(int)(buffer.getWidth()*zoom),(int)(buffer.getHeight()*zoom),this);                                        }     
I'll use zoomOut as a example:
private void zoomOut()
zoom -= 0.1;
               setPreferredSize(new Dimension((int)(buffer.getWidth()*zoom),(int)(buffer.getHeight()*zoom)));
               repaint();
               revalidate();
When the application is initialised the zoom variable is set to 1.0 (meaning no zoom in or out). In JAVA version 1.4.2 this all imposed no problems. Everything is drawen like it should have. But when I install java 1.5.0 or 1.6 the problems begin. When no zoom is applied, the JPanel shows not the image but the background color or shows the image but when windows are dragged over it no repaint is applied resulting in lost parts of the image (these parts turn into the standard backgroundcolor of the JPanel). This all is very frustrating. I've read that this problem is due the fact that the JRootPane is made opaque in the new JAVA versions. But when I do setOpaque(false), no change is implied.
Now the most stunning thing has happend. My bufferedImage is of the ImageType Type_INT_RGB. When I changed it to Type_INT_ARGB all the problems were gone. This is not a problem for this application, but I've got another application with the same errors which uses TYPE_BYTE_INDEXED due memory usage (big image) and cannot be changed to TYPE_INT_ARGB. Does someone has a solution to this problem, so that we can use newer version of JAVA. If so could you please explain them in full detail to me??
Thank you!

no solution? nobody?

Similar Messages

  • Erratic transition duration problem - changes to 00:00;01 and stays

    FCP 5.1, Tiger 10.4.11 - FCP Rescue run, preferences dumped manually, FCP 5.1 (crossgrade) re-installed, and problem remains - i.e. Near the end of a 1 hour wedding edit FCP got really weird and I can't recover. While applying my transitions to wrap the edit it began changing the default transition duration time to 1 frame. When I try to change the duration it stays at 1 frame. Trick is, after each of the recovery efforts above the 1 sec default works for 2-3 applications, then reverts to unchangeable 1 frame. There are at least 5 sec on either side of the edit point.
    Please - don't pile on with "clean installs" and check the threads...I'm old, stuck in the backwoods with only dial-up and 10.4.1 discs. If you can help me I appreciate it and if not I'll pull the post. Thanks!

    Hi,
    welcome to the forum,
    Bearing in mind what you said in the last few lines of your post I would suggest to keep a positive and constructive attitude. People here don't usually make random and careless suggestions.
    Based on the amount of info that you provided I can only suggest two things:
    1) Delete all your renders and render everything again
    2) Create a new project and sequence and copy and paste everything.
    Genuinely trying to help basing my suggestions more on intuition rather than deduction.
    G

  • Transitioning from a 4507 to a 7009 - Recommendations and New Issue

    Any input you can provide is greatly appreciated! I am new to this position/employer and want to do the best job possible on this high visibility project. 
    I am responsible for transitioning our network devices from a 4507 to a 7009, while cleaning up, documenting, and designing our infrastructure.
    These devices are trunked together using 2 ports as an etherchannel.
    The 4507 has all our access devices (collapsed core design) attached to it, as well as the WLC, VG's, Cube, and our edge devices.
    The 7009 has all our servers and SAN connections.
    Luckily we have enough spare fiber connections and hardware that I can install newly updated and configured access devices and transition the access connections in an orderly manner while re-cabling/cleaning up the data closets.
    This is a lot of fun!
    Problem:
    I finally came across an issue after moving approximately 60 connections consisting of PC's, printers, copiers, and Cisco IP Phones.
    All of the PC's, phones, and printers were on separate VLAN's and I just recreated the VLAN and an SVI on the 7009 to facilitate connectivity.
    All of the phones, PC's and printers are working well.
    I noticed that whomever set up the copiers did not associate them with a unique VLAN, like all our other devices, and they are connected via VLAN1 to the 4507.
    All the copiers are in the same subnet, 13 devices in total.
    On the 4507 there is a Static route for this subnet, directly connected via VLAN1.
    I connected a copier to the 7009 and attempted to configure a static route similar to what was done on the 4507.
    I received the following error: "*Next-hop cannot be local address in same or different vrf"
    None of the info I found regarding this error helped illuminate (in my head) a path to fixing the problem. So I decided to go with what I know that works.
    Possible Fix:
    My plan is to create a new VLAN and SVI's on both devices that are associated with the current subnet in place. Then I will have to create the VLAN on each access device and assign it to the copiers access ports. This work can only be done after hours and/or on a weekend and my gut tells me there may be a better way.
    Does anyone have a suggestion for fixing this specific issue with the copiers?
    Does anyone have any suggestions in general regarding this entire transitioning project?
    Thanks for your time and take care.
    Rich 

      Not sure why you would even need a static route . A printer is no different than any other device , just put it in the required vlan  defined with the current addressing scheme if you are keeping it as is currently . If you don't want to use vlan 1 choose a different one such as vlan 100 say and create the SVI using the current  address scheme on vlan 1 . 

  • BufferedImage creation slow in JDK 1.4.2

    Hi,
    The creation of BufferedImage of size 400x400 takes 156ms in JDK1.4.2. It used to take less than 10ms in JDK1.3.1.
    Image image = new BufferedImage(400, 400, BufferedImage.TYPE_INT_ARGB);
    In JDK1.4.2, for sizes 363x363 and above, it takes 156ms and
    for sizes under 363x363, it takes close to 0ms.
    Is this a bug in JDK 1.4.2? I noticed similar behavior in JDK1.5 also.
    My machine configuration:
    Windows XP, 512MB Ram, 1.7GHz
    Thanks,
    Bindu

    The arg type of the setter and the return type of the getter must match up or you'll get this exception.

  • How to convert BufferedImage back to Image

    I have an Image from ImageIcon and i want to cut it using BufferedImage.getSubImage(...) and now from BufferedImage i want to turn it to Image again so that i can put in ImageIcon.
    Here is my code:
    URL img = new URL(location);
    ImageIcon imgIcon = new ImageIcon(img);
    Image image = imgIcon.getImage();
    //turn image into bufferedImage via graphic draw
    BufferedImage bi = new BufferedImage(..);
    Graphics g = bi.createGraphics();
    g.drawImage(image,0,0,null);
    bi.getSubImage(...);
    // how to turn bi back to Image newImage
    any ideas??

    More correctly, BufferedImage extends Image as Image is an abstract class and not an interface.
    Shaun

  • Transitions double 1st frame/drop last frame: a solution

    I have found that Transitions in iMovie 5 are problematic. The first frame in a Transition doubles and the last frame drops out. This is not noticeable in a slideshow but can be very noticeable in an exported video.
    Transitions cannot be edited frame by frame unless one exports video out to a camera and then imports it back into iMovie. The original clips and transitions are now seamless clips. One can delete extra frames and then find and import the missing frames from original sources. HOWEVER, this process is incredibly frustrating and time consuming.
    THIS IS WHERE THINGS GET INTERESTING.
    To avoid the above, I thought I would add textless Titles over a few key clips and transitions where the glitching is most obvious. I had noticed that Titles longer than the clip they were inserted into, merge together the clip with its transition and following clip.
    i.e.,
    1. DEselect 'Over black' in the titles window.
    2. Select a title format and then a length longer than the 'glitched' transition.
    3. Split the clip so that the Title can be inserted.
    4. Insert a TEXTLESS Title that spands the clip, transition and into the next clip.
    5. Then edit out duplicate frames and insert missing frames from the the now 'single' clip.
    STILL just a piecemeal. STILL labour intensive.
    THIS IS WHERE IT GETS MORE INTERESTING.
    I tested this on a couple of clips and, LO AND BEHOLD, 'Title-merging' a clip with its transition and following clip results in the duplicated first frame of the transition DISAPPEARING and the previously dropped frame of the transition, REAPPEARING. A fix.
    One could blanket a video with long textless Titles (i.e., 45 seconds at a time with Rolling Credits) to fix the transition glitches.
    I know that this is not a great solution, but it does allow me to export video with the quality I need.
    Is there a better solution? (I find it ironic that years later, iMovie 2.1.2 is still, for me, the most successful of all the iMovie applications.)

    the duplicated and dropped frames move to the beginning and end of the added short (4 seconds, for example) texless title. Using a longer title (10 seconds, for example) fixed also this.
    if I understand your original reply correctly, it is important that the blanket transition ends in the middle of a clip and not a transition.
    In my tests I used a blanket title (did you invent this descriptive word?!) that spans some of the previous clip (I split it 1-2 seconds before the transition so I could add the blanket title), the transition and some (1-2 seconds) of the next clip.
    If it ends in a transition, the transition plays and then the ORIGINAL clip plays, duplicating the first part of the clip.
    I didn't quite follow. I just tried this with a 30 frame transition. Then I added a 1:15 blanket title 1:00 before the transition (so the blanket title ended in the middle of the transition). Result: The first frame of the blanket titles was duplicated and the last frame of the blanket title was dropped. Otherwise it played as expected.
    shift select the clips to establish a total length of the video clips and them add a title that ends just inside the last clip.
    Yes, I did just that to measure how long a title was needed. In my tests it seemed that it was important that the blanket title wasn't very short (<4 seconds) because then the problem frames were just moved to affect the title. Using a longer blanket title (10 seconds) seemed to fix the problem for both the transition AND the blanket title.
    <div class="jive-quote">With a textless title blanketing an entire video, my COMPRESSION TIME to Quicktime is incredibly shortened (1/3 to 1/2 the time).
    That's interesting. I've noticed that simple projects (i.e. not much cuts) export faster than real time to Full Quality .dv. But complex projects take MUCH longer to export as .dv. AFAIR this didn't matter in iMovie 1-4. Maybe the blanket title simplifies the relevant parts of the project?
    [sigh] I wish we didn't need to be aware of the plethora of obscure gotchas and workarounds like this. I don't expect there to be an iMovie HD 5 update anymore. I guess some bugs will be fixed and some brand new bugs will be introduced in v6.
    The same thing happened with iMovie 4 bugs. ...So this time I thought to quickly gather AND report all iMovie 5 bugs to Apple so they could quickly fix them during the first months. ...but it seems that the iLife team just isn't granted enough resources to fix them. Many known old bugs are again just described in the knowledgebase articles.

  • Is there some sort of Shatter Transition in FCP

    I am looking for a transitions that shatters the end of one footage and the beggining of the next footage zooms in. Is there such transition or is there a method to do this. If I have to I can Manually zoom in the footage but I want the transition that shatters.
    Thanks in advance

    I guess a better way to describe it would be like a break through. I want it to look like the secondary footage was breaking through the primary.

  • My transitions aren't applying correctly. With video explanation!

    I've set the default transition as dip to black. I select some clips and apply default transitions. Only some transitions get dip to black applied to them. I have to manually drag dip to black to the other transitions. When I manually do this the transition still works.
    http://www.youtube.com/watch?v=39qBzSXwwg0&feature=youtu.be
    Another video. I have dip to black set at 2 seconds, center at cut. The first transition applied correctly. The second only applied for 1;16 (why?) and not centered at cut. I have to manually adjust this and it ends up working. The third transition is only 0;28 and start at cut (why???). When I manually charge it to 2 seconds center at cut it actually does become 2 seconds centered at cut. There's nothing stopping the 2 second center at cut from working, but Premiere just doesn't apply it.
    http://www.youtube.com/watch?v=-LBomt489cs

    I know it is an older post, but I'm experiencing the same issue. Having to adjust 168 transitions manually is a p.i.t.a and I would expect a professional programm as Premier to handle it better. Ann wrote: If a transition does not have handles it will duplicate still frames (diagonal strips) or set it off center. That is fine, if it would be possible to set the default behaviour to duplicate still frames. This is what would be needed. I understand the concept behind the implementaion, but dip to black doesn't fit the usage of other transitions, therefore it is a weak implementation that doesn't address the different needs of Dip to Black. So the main question is, can the default be set to duplicate frames resp. "Center at Cut" for Dip to Black?
    Adobe's explanation in Ann's link states:
    The pointer changes to indicate the alignment options as you move it over the cut:
    If both clips contain trimmed frames at the cut, you can center the transition over the cut or you can align it on either side of the cut so that it either starts or ends at the cut.
    If neither clip contains trimmed frames, the transition automatically centers over the cut and repeats frames from the first clip, or from the second clip, or from both clips, as needed to fill the transition duration. Diagonal bars appear on transitions that use repeated frames.
    If only the first clip contains trimmed frames, the transition automatically snaps to the In point of the next clip. The transition uses the first clip’s trimmed frames for the transition and does not repeat frames from the second clip.
    If only the second clip contains trimmed frames, then the transition snaps to the Out point of the first clip. The transition uses the second clip’s trimmed frames for the transition and does not repeat frames from the first clip. The default duration of a transition, for either audio or video, is set to 1 second. If a transition contains trimmed frames, but not enough to fill the transition duration, Premiere Pro adjusts the duration to match the frames. You can adjust the duration and alignment of a transition after you place it.
    Therefore using Ctrl+D never places the transition in the center if there are not sufficient frames after the trim. I need to click in the effects control panel and set the clip to center at cut. I normally use an AutoKey macro just to go from cut to cut using the Arrow Keys and then sending Ctrl+D to place the Dip to Black transition. Therefore I would like to have the default behaviour set to "Center at Cut". Is there any way to do this?
    I found out that clicking the Ctrl key changes the duration of a left or right placed transition to the full default duration instead of limiting it to the flesh of the clip. I didn't find any key combination that forces the tranistion to be placed centered.
    Marcus
    Message was edited by: Marcus Koch

  • Pictures not showing up without transition?

    I am currently trying to use iMovie HD 6.0.3 to make a slide show/movie of pictures and whatnot. I have used iMovie before, so have successfully made movies in the past. However, when trying to have certain pictures line up with the music correctly I don't use transitions in order to have them appear suddenly and with no fade-in/fade-out or anything. Without the transitions the picture doesn't appear until the bar is hovering over the picture after it, which makes timing almost impossible.
    I was able to successfully do this on an older version a few years ago, a copy of which I still have on my newer computer. When I opened it, the effect does the same thing, only it didn't previously. I have a disc copy too, so I know I could have pictures appear without transitions in the past.
    Is this a known problem or am I doing something wrong?

    It might not be, but this looks like the same problem described in this thread:
    http://discussions.apple.com/thread.jspa?threadID=2382794&tstart=0
    and the solution probably is the same. The problem has been known to manifest upon upgrade to Quicktime 7.6.6. The solution found to have worked by other posters is to revert back to Quicktime 7.6.4 as described in the above thread.

  • Can't add transitions to either LT files or .mov

    Hi,
    I'm trying to and some transitions for a title sequence, I've created the titles in LiveType, when I either use the LiveTYpe files or rendered out files.
    I can a transition into the first title but no more.
    Any ideas?
    iMac 20" Core Duo   Mac OS X (10.4.6)  

    Do you have enough Media Handles to create
    transitions?
    Open a clip into the Viewer and see where the in/out
    points are, if they are at the very start or end of
    the clip there is no Media Handles available for FCE
    to use for transitions.
    Al
    ~bangs head on desk~ thanks, that's fixed it, some days I can be really thick...
    I guess it's just going to be one of those days today.
    I could have sworn that I'd dropped titles/video clips in and used transitions before without havign set in and out...
    It's working that's what matters.
    Thanks again

  • Transparency in gradients - transition gradient slider still shows the transparent tabs colour

    I`m trying to make a one colour radial blend from one colour to transparent,
    so I make the end tab  0% opacity. transparent,
    however the transition gradient slider at top between the colour and the transparent tab still shows the influence of the transparent, this creates a colour bleed from the transparent tab even if I set it to white,  the left colour fades out into white then transparency. (this is not due to the cream left tab, it happens on any colour sample)
    I want the left colour tab to fade out with no influence in the transition period to the "white transparent" tab, but the transition slider does carry some of the gradation from the white tab... is there a way to delete the white tab all together and have a true transition from the cream to nothing?

    I  just thought of the solution, - use the same colour on both colour stops, and make one transparent.

  • Iphoto transitions exporting to Quicktime

    Working in iphoto 08. "Fit slideshow to music" simply does not work, so I manually adjusted dissolves and display length to have the music and images end at roughly the same time. Exporting to Quicktime seems to ignore all of my transitions and the photos are done displaying with about a minute left in the music.
    Exporting to idvd or imovie creates unacceptable reduced quality of the images. Is there a way to make the iphoto slideshow export exactly how it's playing in iphoto?

    First are you using iPhoto 08 which is version 7 or iPhoto 09 which is version 8?
    Exporting to Quicktime from iPhoto 08 (V7) will not get your transitions as a straight to QT export doesn't support them. With iPhoto 09 (V8) a slideshow export was added that would give you all of the features you had in the iPhoto slideshow.
    Click to view full size
    So if you're at Version 7 you'll need to use a 3rd party slideshow application like PhotoPresenter or use iMovie to get your transitions.
    PhotoPresenter has over 25 animated themes and interacts seamlessly with iPhoto. Some of those themes are demonstrated here: PhotoPresenter Animated Slideshow Themes.
    OT

  • Dip to Color transition with graphic

    I'm using a Dip to Color Dissolve transition between a black screen and a graphic that has colored text with a black background. When using the transition, I get the flash of white color, as intended, but the outline of the graphic is visibile. Dragging along the timeline, I found that this was because the graphic, centered in the screen, changes color more slowly than the rest of the empty space around, making it so that you can see the square outline of the image during the transition.
    Is there a way to fix it so that the graphic and the background change color throughout the transition at the same time, making it clean and unable to see the outline of the graphic?
    My apologies if the explanation is somewhat confusing, I'd be happy to clarify if necessary! Thanks!

    One way is to insert a Slug.
    Click the little A button in the Viewer and select.
    Transitions in FCE require Media Handles to be associated with clips to work like Dip to Colour. Search this forum for more info on Media Handles.
    Al

  • Toggle transitions doesn't work

    Hi,
    I try to make a fade in/ fade out effect using transitions. I
    have 2 states: default state and a detail state.
    When I call the detail state I use a dissolve transition to
    'fade in' the detail state. This works fine.
    But when I go back to my default state the detail state just
    disappears without a fade out.
    Does anyone know what I'm doing wrong?
    This is my transition code:
    <mx:states>
    <mx:State name="UserDetail">
    </mx:State>
    </mx:states>
    <mx:transitions>
    <mx:Transition id="openDetail" fromState="*"
    toState="UserDetail">
    <mx:Parallel target="{csUserDetail}">
    <mx:Dissolve alphaFrom="0.0" alphaTo="1.0"
    duration="1000"/>
    </mx:Parallel>
    </mx:Transition>
    <mx:Transition id="closeDetail" fromState="UserDetail"
    toState="*">
    <mx:Parallel target="{csUserDetail}">
    <mx:Fade alphaFrom="1.0" alphaTo="0.0"
    duration="1000"/>
    </mx:Parallel>
    </mx:Transition>
    </mx:transitions>

    First off, Fade and Dissolve are two different things. I
    think you want to use Fade for both or Dissolve for both. But
    that's just a matter of taste.
    You didn't supply your state details, but I'm betting you
    have an AddChild in there.
    What's happening is the when you go from UserDetail state
    back to the base state, Flex is first going to make the content of
    the state be correct - this means undoing the AddChild and thus the
    contents of the UserDetail state just pops away.
    Change your closeDetail transition to this:
    <mx:Transition fromState="UserDetail" toState="">
    <mx:Sequence target="{csUserDetail}">
    <mx:Fade ... />
    <mx:RemoveChildAction />
    </mx:Sequence>
    </mx:Transition>
    You want the events to happen in sequence: first fade out
    csUserDetail, then remove it. Since the Fade and RemoveChildAction
    apply to csUserDetail you can just put the target on the Sequence
    and leave it off of the Fade and RemoveChildAction tags (or you can
    put it on both of them if you have other targets).

  • Transitions not sticking to images

    Im trying to link two photos with a trasition (page peel to be exact) but for some reason, they're not taking it. It's as if there's a blank space between them, so the transition only sticks to one of the photos and the blank space. This has been happening often and I am positive that there is no blank space between images.
    What does this mean and how can I fix it?

    Im not exactly understanding what this information is (been editing for hours and Im very tired!) but Im pretty sure my problem isnt exactly addressed here. It says that a possible problem might be that the two images dont last long enough for the transition to work, but I've been able to link them before. Suddenly its just not taking.
    Also the site talks about an X? Im not getting that at all, just that when I drag the transition over the two images, half of it kind of hides behind one of the images.

Maybe you are looking for