Excessively Large image loading

I have a program that is calling a large number of PNG files
from a separate source folder. A few of these images are far too
big (in excess of 200KB) and they refuse to load.
If the image is under 200KB (roughly), the image loads into
the imagebox. If it is higher than 200KB, the imagebox does
nothing, however, clicking any image after that, including ones
that do display, sends the file size too high and my back up
picture (TooBig.png) is loaded instead. I have tried clearing the
image loaded, but I can't seem to get it to stop loading the large
images.

I saved your image to e:/java/test/jpg and this code worked fine for me.import java.awt.Image;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
public class TestImageIO {
   void makeUI() {
      File file = new File("e:/java/test.jpg");
      Image thumb = null;
      try {
         thumb = ImageIO.read(file)
               .getScaledInstance(128, 96, Image.SCALE_SMOOTH);
      } catch (IOException ex) {
         ex.printStackTrace();
      JLabel label = new JLabel(new ImageIcon(thumb));
      JFrame frame = new JFrame("TestImageIO");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setSize(300, 300);
      frame.add(label);
      frame.setLocationRelativeTo(null);
      frame.setVisible(true);
   public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
            new TestImageIO().makeUI();
}db

Similar Messages

  • Slow scrolling after large image loaded

    Hi all,
    Im trying to load a large Jpeg image (11mb, 4096*4096) into a bufferedimage object and draw this on a scrollable panel. However, the load time and scrolling once it has loaded is very slow. Here is the code I use to load the image and draw it
    try {
    File f = new File(mapName_);
    map_ = ImageIO.read(f);
    } catch (Exception e) {}
    public void paintComponent(Graphics g){
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D)g;
    if(map_ != null){
    g.drawImage(map_,0,0,this);
    Also, when I run the program I increase the heap size with the command "java -Xmx128M -jar imap.jar" to avoid out of memory errors.
    Any ideas on how to improve the loading time and scroll speed?
    Thanks

    I have a 9800pro, AMD XP3200 and 1gig pc3200.

  • How to load a large image for display on the Palm PDA

    Hello:
    I have a large image I would like to display on LV for Palm PDA. The documentation states there should be a 64K chunk limitation for VIs to compile on the Palm. Therefore, I decided to break this image up into 2D arrays of less than 64K per subVI. My 3.2 Meg image therefore has about 224 2D array subVIs. My motivation is to somehow use the build array function (with concatenate inputs) to reconstruct the image at runtime. I can compile each 2D array subVI as a test, but my attempt to reassemble and compile is futile. When I try to use the build array with only 8 of these subVIs in a top level VI the compiler complains its still too big of a VI. Using get info, memory for this top level states total ~2
    3K of memory usage.
    So can someone help me with this problem. Is there another way to load this size of an image into memory so I can display it on a picture control?
    BTW, this can build on LV for PocketPC.
    Thank you
    Robert

    Hi Robert,
    You are correct in that one of the limitations of the Palm OS is that files cannot be larger than 64 KB in size (as stated on page 5-3 of the LabVIEW PDA Module User Manual). The suggested workaround is indeed to have a top-level PDA VI that calls subVIs, and this top-level VI can then have a total file size larger than 64 KB.
    My suspicion is that with the picture control on the Palm OS, even if you are breaking up the image into smaller subVIs, the process of building the array to reassemble the picture is still forcing the Palm to allocate memory for each of those 2D array subVIs to place on the top-level VI's picture control
    and thus causing the Palm to complain about not having enough memory. The LabVIEW PDA User Manual also states that "There is a total limit of 64 KB on all front panel array data". Thus, when you are trying to use the build array on the top-level VI, the 64 KB limit on front panel array data is still being exceeded -- even with only 8 of these subVIs.
    The following KnowledgeBase article KB 38EJRHFQ: How Do I Put a Picture or Image on My LabVIEW PDA for Palm Front Panel? states that as a workaround, you can shrink the size of your image by using 4-bit or 1-bit data instead of the standard 8-bit pixmap representation.
    This is really just a limitation of the Palm OS and the fact that there is simply no way of displaying that much front panel information for your picture. Either way, you would need to build up the array of pixels for your bitmap, and for a 3.2 MB image, I don
    't believe there is any way for the Palm OS PDA to display the image in its entire at once.
    Sorry about that...
    Kileen C.
    National Instruments

  • Can't load large image (png)

    I have a sandbox web page with large image (png file 26000x13000, 14MB packed/330MB unpacked). I can open it in IE but firefox display page without image. I have 1,2GB of free RAM, how can I adjust settings to make allow firefox display the image? Currently there is no difference if I use unpacked BMP, it doesn't work as well. I would prefer to stay with PNG since it's only 14MB on disk.

    Is there an error message?
    We've been able to load more than 100MB files.
    Try setting SQLNET.EXPIRE_TIMEOUT=0 in the sqlnet.ora file
    Fenella

  • Optimization on Load Time (Large Images and Sounds)

    Hi,
    I have an all flash website that works by having each portion of it to load and unload in the center of a frame based off the navigation chosen.  Load times on everything but one part of my site are ok.
    The dimensions of the part inside the frame are 968x674.  I know that's relatively large for a flash file, but that can't be changed at this point.
    Within the page there are objects that come up when you find an item on the screen.  Its a dialog box and it shows text, an image, and has a voice over that reads what the text says.  After you're done looking at it, there is an x-button to dismiss the window.  There are 15 of these and they are exported to the actionscript.  I add them in the actionscript via addChild.  I figured this is a huge spot that could be reconfigured, but I'm not sure if it would make much a difference.
    The other huge thing is there is a ton on the screen.  It starts you off in an environment, and when you click 3 different sections, it zooms into that portion allowing you to look for the items you're trying to find.
    There is also a man that talks and animates in the beginning and at the end.  We are planning on taking out the end part and putting a text box up.
    Here is the website..  its a propane safety site for kids.  I know its kind of a weird idea, but it works and people seem to like it.
    www.propanekids.com
    The two parts of the site we are trying to optimize is the main menu when you first are at the site, and the "Explore" section.  (Just click on the cloud on the front page.
    If someone could take the time to give me some new ideas of how I can get these loading times down, I would greatly appreciate it!
    Thanks

    Ok, who ever posted this message is hacking me  and i can't believe you guys are helping
    Date: Thu, 27 Jan 2011 11:07:28 -0700
    From: [email protected]
    To: [email protected]
    Subject: Optimization on Load Time (Large Images and Sounds)
    Hi,
    I have an all flash website that works by having each portion of it to load and unload in the center of a frame based off the navigation chosen.  Load times on everything but one part of my site are ok.
    The dimensions of the part inside the frame are 968x674.  I know that's relatively large for a flash file, but that can't be changed at this point.
    Within the page there are objects that come up when you find an item on the screen.  Its a dialog box and it shows text, an image, and has a voice over that reads what the text says.  After you're done looking at it, there is an x-button to dismiss the window.  There are 15 of these and they are exported to the actionscript.  I add them in the actionscript via addChild.  I figured this is a huge spot that could be reconfigured, but I'm not sure if it would make much a difference.
    The other huge thing is there is a ton on the screen.  It starts you off in an environment, and when you click 3 different sections, it zooms into that portion allowing you to look for the items you're trying to find.
    There is also a man that talks and animates in the beginning and at the end.  We are planning on taking out the end part and putting a text box up.
    Here is the website..  its a propane safety site for kids.  I know its kind of a weird idea, but it works and people seem to like it.
    http://www.propanekids.com
    The two parts of the site we are trying to optimize is the main menu when you first are at the site, and the "Explore" section.  (Just click on the cloud on the front page.
    If someone could take the time to give me some new ideas of how I can get these loading times down, I would greatly appreciate it!
    Thanks
    >

  • Loading large images

    Hi there,
    I'm facing lot of problem while loading large image (25+ MB JPG/TIFF) in editor pane using ImageIO. I always get OuofMemory exception or my machine (p4 2.4ghz/512 ddr) get hangs. Is there any way to load large images within a moment in Java? I have seen one s/w (written in vc++) that do the same. I'm trying to replicate that s/w.
    Is there any 3rd party Java API to do the same? Have you guys develop similar s/w before?
    I've tried many ways: by changing heap size, using ImageMagick, spliting the image, etc. but never get satisfactory results.
    Any help would be appreciated.
    Thanks in advance.
    -tamal

    You can use Java Advanced Image
    http://java.sun.com/products/java-media/jai/downloads/download-1_1_2.html
    this will avoid the out of memory error.
    I use it to read and show 20K*20K pixel images.
    the loading is immadiate.
    If you use javax.media.jai.widget.ScrollingImagePanel (deprecated) class to visulize the image is quite quick.
    Obviouse that if you want to visualize the entire image you will need to wait an approprite time for rescaling it.

  • Safari 7.0.1 does not load large images

    When I use safari and try to load an image with a resolution above, say, 2000x2000, I get a black box, sometimes with a grey area in the corner. The correct image displays for a brief moment, about a half second, but not enough for my viewing pleasure. This usually happens when I click imgur links on reddit, such as this one. I just searched a very large image on google, and was able to load it no problem. I've tried turning off all extensions, but even with no extensions the images do not load. Any advice is much appreciated. Thank you!

    Turning auto graphics off solved the issue for me: http://www.youtube.com/watch?v=QxSlQ-GNbik
    Seems like Safari won´t render large images when you are using integrated grapchis.

  • Load Large Image

    Hi.
    I have jpg image with 6.5Mb, 6000px*4500px.
    I load the picture to "Image" control with the same
    size(6000*4500) and the "Image" control is in the "Panel" control
    in order to enable "Scrollbar" so user can navigate picture.
    However, when user browses flash file, memory increases 150MB.!!!!
    Is there any solution dor issue: huge picture with scrollbar
    for navigate?
    Thanks for any read and reply.
    MA.

    The Flash Player has an image limit size of 2880 x 2880
    pixels, so your image is way too large to show up. Strange things
    will happen to it.
    I encourage you to file an enhancement request to let the
    Flash Player team know that you need the Flash Player to accomodate
    large images.
    Adobe
    Feature Request and Bug Report Form

  • Safari 7.1 won't load large images on MacBook Air. Turning off Auto Graphics is not an option.

    When I try to load a large image with Safari 7.1, I get a black box instead of an image.
    Chrome and Firefox load the image just fine.
    This is a known problem and others have resolved it by turning off Auto Graphics Switching.
    However, my version of MacBook does not have the capability to turn off Auto Graphics Switching under the Energy Saver preferences. (I guess I have the GPU or chip or whatever that doesn't provide that option.)
    Are there any workarounds?
    Here are two threads about the same problem, but the solutions don't work for me:
    safari 7 won´t load large images...
    Safari 7.0.1 does not load large images

    Safari > Preference > Advanced
    Checkmark the box for "Show Develop menu in menu bar".
    "Develop" menu will appear in the Safari menu bar
    Enable Images.
    Make sure that"Disable Images" is not enabled.
    Best.

  • Large image not loading

    I generate JPGs on my server and send them to clients on an intranet (using http://, not file://). Smaller images work just fine. Large images do not using Firefox, even when trying to view the images by themselves in a new tab. Those same images work perfectly fine in IE 8, Chome v22, and Safari 5.
    I tried the suggestions here to no avail:
    https://support.mozilla.org/en-US/kb/fix-problems-images-not-show?as=aaq
    Similar problem found here:
    https://support.mozilla.org/en-US/questions/795933?as=aaq
    Not sure which attribute might trigger the issues, but I know:
    - 901 x 27928 resolution 3.93 MB picture will load
    - 904 x 32767 resolution 4.77 MB picture won't load
    Looks like the image file is uncorrupted because I can click to view the image in FF, right-click to 'View image info', click 'Save As...' for the image, and save it to my desktop. Opens up just fine in Windows. Seems to be a bug in the way Firefox is attempting to display it...

    That image displays fine for me in Firefox on Linux, but I'm not seeing anything in a Windows Firefox version that runs under Wine.
    Even the Tools > Page Info > Media preview panel is blank there, but saving the image is possible.
    <br />
    <pre><nowiki>data:text/html,<img src='http://imageshack.us/a/img12/4543/visualizedp1776ddv27731.jpg'></nowiki></pre>

  • My image is large and loads slowly.  Is there anything I can do besides size it down?

    HI,
    Please go here
    http://www.dahlingroup.com/
    You'll see a large image that takes a few seconds to load. In the web, we know this is far too long. The site is about architecture and the images have to stay big. That being said, I've seen sites where the image sort of comes in pixelated at first, then slowly focuses. Can anyone tell me what technology they are using and where I could get started with that?
    Thanks,
    Stan

    Using regular cable internet it takes 3 to 5 seconds for the page to load first time around or when a refreshed as a new image is called. It is less than a second once in my cache.
    I'm going to guess and question a little here:
    You are using flash on part of the page for the menu. How long does that take to load by itself?
    You are also using php to rotate your images, so the server has to process that request for each time that an image is changed. Can you save those processing times by saving those on the server and so the request can access the already processed page. (There is a way to do that, but I forgot what it is called) Or can you use a different method of rotating the images that would be faster.
    Since the bigPictureBox image that is being displayed is 405x930 px, what is the actual file size and quality of those images as well as the format of the files?
    Using 'Save For Web' in Photoshop almost always gives smaller file sizes that regular 'Save'
    Spliting the images up will only increase the total display time, but will allow a portion to show as the rest are called, but I don't think that will work for rotating as you are doing.

  • Any Way I Can Make My Page's Images Load One At a Time?

    Hi folks,
    I have a page with a stack of large images. It takes several seconds for them all to load, but I was wondering if there's any way I could dictate the order in which all of these images load? This way, the top image would load first, then the the next one down, and so on, leaving little perceivable page load time for visitors.
    It seems like this would be a common necessity for a web page, does anyone know an easy (because I know very little about this) way to do this?
    Thanks!

    One major problem, is that you have scaled the images in DW, and not in a graphics program.   I have your page open in the background and it's been a while loading and it's still not finished  :-)
    eg:  the following images has properties of:
    http://www.selfeffacingtheories.com/web-content/pictures/picpics/holes.jpg
    933px × 699px  but you have scaled it to:  615px × 458px
    Trying to put your page through the Web Optimiser - doesn't show a very good result - it couldn't be tested because it exceed the size requirement.
    http://www.websiteoptimization.com/services/analyze/
    The size of this web page (4264698 bytes) has exceeded the maximum size of 3000000 bytes.
    This is just way too big a file size and seriously needs to be optimised.  The only way to do this is to scale down the images in either Photoshop or Fireworks.
    Why not use a lightbox effect, where you show a much smaller size of the image and then when someone clicks on it they see a much larger version of the image:
    My small demo here: (using the Dreamweaver Lightbox Extension)
    http://dreamweaverresources.com/tutorials/dreamweaver-lightbox/

  • XML scrolling thumbnail, image loader, & Buttons [halfway works]

    Intro:
    I started a flash-based website a few years ago. Back in 2006 I was able to get a xml scrolling thumbnail, image loader to work without a glitch.
    For numerous reasons I had to put the project on hold until now. [one was that my 30 day trial of flash expired and only recently was I able to purchase the Adobe Web Suite CS4 as well as a new computer which could run the apps.]
    Last Friday saw a bump in the road in the development of my site as two, rather straightforward task, turned into something short of a nightmare as I have been unable to get past these two, seemingly, relatively simple task.
    I have posted in 4 other flash forums the issues, in detail, that I am facing - and have quite a bit of interest/views in the topic as the numbers suggest - yet no response/answer as of yet. [Which confirms other messages I have seen which seem to state that working with buttons has become increasingly difficult with the newer version of flash - something Im a bit surprised with actually from Adobe. - I would have thought there would be a palette where you could set parameters...]
    Screenshot of Site/Timeline:
    Before getting into the two questions I have, I would like to post an image of the site as it looks whenever an swf file is saved out, as well as a piece of the timeline in the back for reference.
    Issue #1
    As of now when the swf file is saved out you get exactly what you see above:
    a: A scrolling thumbnail
    b: ...which loads a large image when clicked on it - PEFECT...
    BUT...
    1a: I need for the buttons to load in this action, not for it to just load on its own.
    [i.e., the silk_paintings gallery is what is open, so I need the "silk_paintings" button to call up this action]
    note: Initially I had attacked this problem by taking out the actions layer you see above and applying it directly to the individual buttons with some crude MouseEvent Listener/Handerls... that did not work - at all.
    Im sure it may be "easier" to make an array out of it, but with my coding level it may be "easier" to apply it to the buttons.
    1b: How I currently see it, I would take the xml-list and duplicate it for the number of galleries I have.
    [I would then re-name the xml-list to reflect the name of the galleries they are to represent, i.e. "silk_paintings"]
    [also, I would have to rename the folders to "thumbnails1,2,3, etc., & "images 1,2,3, etc"
    From there I would duplicate the actions and paste it into the buttons, changing the xml-list name to that of "silk_paintings", etc., as well as write in the MouseEvent listener Handler to make it work. [ah, ha, but what is that magic phrase, I have tried to implement various code from other tutorials, and all in vein.]
    Issue #2
    At this point I would be tickled pink just to get this to basic function to work.
    However, once the buttons are working and calling up the xml, etc., then I need the buttons to stay on the semi-transparent blue color it is whenever in the 'hit' state. [note: NOT pictured above.]
    With the way the buttons are currently set up, and with wanting to use scripting to get them to interact with the thumbnail gallery, it will have to be some miraculous code to tell that button what color to stay as whenever its clicked, and of course it going back to white when another button is clicked.
    Conclusion:
    Since this is an Adobe Forum I would like to make a few additional statements in hopes that the developers, etc. may take heed.
    Adobes products are not cheap, and when I went to purchase the websuite I went in as a designer needing a program as not to need to program.
    I understand the flexibility that coding gives, but something as simple as linking buttons should not be in the realms of rocket science. [yes, for many its not...but my brain just does not operate that route despite all the tutorials thrown at me.]
    Again, it would seem that there would be a button panel where you could drag options like scrolling thumbnail slider, loader, and then parameters would come up. [much like Apples iWeb. - but before the argument of one being pro and the other for non-pros, I see it differently. Software should not be the limiting factor in how flexible you can design, or rather ones lack of programming shouldnt be. With all the talented, and I say this in all humility and honesty, programmers working for Adobe, Im sure something could be programmed like what Im asking for.]
    note: Director is a good example, back in 1997 I knew nothing of multimedia and in one week I had assembled a portfolio, clicking buttons, speech, movies, and all. - and no, I dont have the money to buy more software!
    At this moment I am at the mercy of someone who reads code like its a nighttime tale they are telling their kids, and who can see the exact issue I have and can share the appropriate, correct code. [as I have noticed, it has to be on target - naturally - but this target changes with just a slight change in the design.]
    Thank you,
    peace
    Dalen
    p.s.
    The actionscript: [note: This is only the current working/good code that Im trying to get the buttons to call up.]
    stop();
    fscommand("allowscale", false);//keep SWF display at 100%
    var x:XML = new XML ();//Define XML Object
    x.ignoreWhite = true;
    var fullURL:Array = new Array;//Array of full size image urls
    var thumbURL:Array = new Array;//Array of thumbnail urls
    var thumbX:Number = 25;//Initial offset of _x for first thumbnail
    x.onLoad = function(){ //Function runs after XML is loaded
        var photos:Array = this.firstChild.childNodes;//Defines variable for length of XML file
         for (i=0;i<photos.length;i++) {//For loop to step through all entry lines of XML file
              fullURL.push(photos[i].attributes.urls);//Each loop, adds URL for full sized image to Array fullURL
              thumbURL.push(photos[i].attributes.thumbs);//Each loop, adds URL for thumbnails to Array thumbURL
              trace(i+". Full Image = "+fullURL[i]+"  Thumb Image = "+thumbURL[i]);         
              var t = panel.attachMovie("b","b"+i,i);//Each loop, Define local variable 't' as a new instance of 'b' movie clip, given unique instance name of 'b' plus the index number of the For loop
              t.img.loadMovie(thumbURL[i]);// Each loop, load thumbnail image from XML data into variable movie clip
              t._y = 0;//Set Y coordinate of variable movie clip
              t._x = thumbX;//Set X coordinate of variable movie clip based on variable thumbX
              t.numb = i;//Set sub-variable 'numb' inside variable t to hold index number
              t._alpha = 75;//Set the Alpha value of the variable movie clip to 75% - for onRollOver highlight action
              thumbX += 55;//Increment thumbX value so next thumbnail is placed 125 pixels to the right of the one before
              t.onRollOver = function () {//define onRollOver event of the variable movie clip
                   this._alpha = 100;//Set thumbnail alpha to 100% for highlight
              t.onRollOut = function () {//define onRollOut event of the variable movie clip
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onPress = function () {//define onPress event of the variable movie clip
                   this._rotation += 3;//rotates thumbnail 3 degrees to indicate it's been pressed
                   this._x += 3;//Offset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y -= 3;//Offset Y coordinate by 3 pixels to keep clip centered during rotation
              t.onReleaseOutside = function () {//define onRelease event of the variable movie clip
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during rotation
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onRelease  = function () {//define onRelease function to load full sized image
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during
                   this._alpha = 75;//Reset thumbnail alpha to 75%
                   holder.loadMovie(fullURL[this.numb]);//Load full sized image into holder clip based on sub-variable t.numb, referenced by 'this'
         holder.loadMovie(fullURL[0]);//Initially load first full size image into holder clip
    x.load ("silk_paintings.xml");// path to XML file
    panel.onRollOver = panelOver;
    function panelOver() {
         this.onEnterFrame = scrollPanel;
         delete this.onRollOver;
    var b = stroke.getBounds(_root);
    function scrollPanel() {
         if (_xmouse<b.xMin||_xmouse>b.xMax||_ymouse<b.yMin||_ymouse>b.yMax) {
         this.onRollOver = panelOver;
         delete this.onEnterFrame;
         if (panel._x >= 740) {
         panel._x = 740;
    if(panel._x <= (thumbX-10))  {
              panel._x = (thumbX-10)
         var xdist = _xmouse - 830;
         panel._x += -xdist / 7;
    The xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <slideshow>
    <photo thumbs="thumbnails/i_brown_fairy.jpg"  urls="images/brown_fairy.jpg"  />
    <photo thumbs="thumbnails/i_blonde_fairy.jpg"  urls="images/blonde_fairy.jpg"  />
    <photo thumbs="thumbnails/i_flower_fairy.jpg"  urls="images/flower_fairy.jpg"  />
    <photo thumbs="thumbnails/i_red_fairy.jpg"  urls="images/red-fairy.jpg"  />
    </slideshow>
    Attached is a link to the file I made named "index".
    https://rcpt.yousendit.com/706233226/5e7b4fe0973dacf090b5cbae32c47398
    I would have liked to have included the following files but was limited due to "you-send-it" not uploading folders.  Files not included: [but functioning] : xml list - images [folder] - thumbnails [folder]
    Again, Thank you
    Dalen

    The issues with the buttons calling up the scrolling thumbnail panel have been resolved, as well as keeping the buttons in their hit state once clicked, thanks to Rob.
    Those that have been following this thread, or stumble upon it in their searches later, may appreciate to see the final solution to this particular issue.
    [Hopefully I will be able to update this thread with a url in the future to show the site in operation, which may help somebody with their project in the future if its set up similarly.]
    Alas, it would be nice if future versions of flash had a more direct, flexible, user friendly method for creating navigation.
    [We may see development beyond the flash ads which everyone seems to loathe... and more creativity with flash in terms of games, web interactivity, &  animation.
    Below are 2 sets of code:
    a] the first is located within the first frame of the first button, and has some extra variables in it that the additional buttons call upon...
    b] the second is the code applied to every other button.
    stop();
    fscommand("allowscale", false);//keep SWF display at 100%
    var x:XML = new XML();//Define XML Object
    x.ignoreWhite = true;
    var fullURL:Array = new Array();//Array of full size image urls
    var thumbURL:Array = new Array();//Array of thumbnail urls
    //  .......  CHANGE
    var thumbX:Number;// = 25;//Initial offset of _x for first thumbnail
    // make an array of all of the instance names of each button object...
    // only do this once
    var buttonsList:Array = new Array(shadesOfGrey, silkPaintings);
    shadesOfGrey.isLatched = false;
    // the rollover function... repeat for each button
    shadesOfGrey.onRollOver = shadesOfGrey.onDragOver=function ():Void {
         if (!this.isLatched) {
              this.gotoAndStop(2);
    // the rolloff function... repeat for each button
    shadesOfGrey.onRollOut = shadesOfGrey.onDragOut=shadesOfGrey.onReleaseOutside=function ():Void {
         if (!this.isLatched) {
              this.gotoAndStop(1);
    // the mouse press function... repeat for each button
    shadesOfGrey.onPress = function():Void  {
         resetAllButtons();
         this.isLatched = true;
         this.gotoAndStop(3);
    shadesOfGrey.onRelease = function():Void  {
         x.load("shadesOfGrey.xml");// path to XML file
         thumbX = 25;
    function resetAllButtons():Void {
         for (b in buttonsList) {
              buttonsList[b].isLatched = false;
              buttonsList[b].gotoAndStop(1);
    x.onLoad = function() {//Function runs after XML is loaded
         //  resets the position of the panel on each new load
         panel._x = 740;
         //  .......  CHANGE  removes the existing movieclips from the panel before any new load...
         for (c in panel) {
              if (typeof (panel[c]) == "movieclip") {
                   removeMovieClip(panel[c]);
         var photos:Array = this.firstChild.childNodes;//Defines variable for length of XML file
         for (i=0; i<photos.length; i++) {//For loop to step through all entry lines of XML file
              fullURL.push(photos[i].attributes.urls);//Each loop, adds URL for full sized image to Array fullURL
              thumbURL.push(photos[i].attributes.thumbs);//Each loop, adds URL for thumbnails to Array thumbURL
              //trace(i+". Full Image = "+fullURL[i]+"  Thumb Image = "+thumbURL[i]);
              var t = panel.attachMovie("b", "b"+i, i);//Each loop, Define local variable 't' as a new instance of 'b' movie clip, given unique instance name of 'b' plus the index number of the For loop
              t.img.loadMovie(thumbURL[i]);// Each loop, load thumbnail image from XML data into variable movie clip
              t._y = 0;//Set Y coordinate of variable movie clip
              t._x = thumbX;//Set X coordinate of variable movie clip based on variable thumbX
              t.numb = i;//Set sub-variable 'numb' inside variable t to hold index number
              t._alpha = 75;//Set the Alpha value of the variable movie clip to 75% - for onRollOver highlight action
              thumbX += 55;//Increment thumbX value so next thumbnail is placed 125 pixels to the right of the one before
              t.onRollOver = function() {//define onRollOver event of the variable movie clip
                   this._alpha = 100;//Set thumbnail alpha to 100% for highlight
              t.onRollOut = function() {//define onRollOut event of the variable movie clip
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onPress = function() {//define onPress event of the variable movie clip
                   this._rotation += 3;//rotates thumbnail 3 degrees to indicate it's been pressed
                   this._x += 3;//Offset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y -= 3;//Offset Y coordinate by 3 pixels to keep clip centered during rotation
              t.onReleaseOutside = function() {//define onRelease event of the variable movie clip
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during rotation
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onRelease = function() {//define onRelease function to load full sized image
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during
                   this._alpha = 75;//Reset thumbnail alpha to 75%
                   holder.loadMovie(fullURL[this.numb]);//Load full sized image into holder clip based on sub-variable t.numb, referenced by 'this'
         holder.loadMovie(fullURL[0]);//Initially load first full size image into holder clip
    // this one function scrolls the panel for all of the buttons, it gets the
    // size of the panel when the images are loaded by any given button...
    stroke.onEnterFrame = function() {
         if (this.hitTest(_xmouse, _ymouse, false)) {
              if (panel._x>=740) {
                   panel._x = 740;
              if (panel._x<=740-panel._width+mask._width) {
                   panel._x = 740-panel._width+mask._width;
              if ((panel._x<=740) && (panel._x>=740-panel._width+mask._width)) {
                   var xdist = _xmouse-830;
                   panel._x += -xdist/7;
    Of note is the change to how the movie clips are measured... this change in and of itself has really helped to make the thumbnail panels operation more efficient.
    Below is the script for each additional button: [Having issues with the forums not letting me post additional code, so I will put the remaining code in a reply below.]
    cont.

  • Displaying large images

    On blog or news item pages etc. it would be common to display
    an image as no more than a certain width, regardless of the actual
    image size, simply for fast loading and consistent visual
    presentation. However, I would like users to be able to see the
    image full size if required.
    The obvious approaches are when clicking on the image, to
    either show it full size in the current browser window or to create
    a new window to show it, probably using JavaScript to open a window
    the same size as the image.
    Both have their pros and cons and the other issue is that it
    is always annoying to click on an image only to discover that the
    original was no bigger anyway!
    Does anyone have any thoughts on how best to handle images?
    Thanks.

    > On blog or news item pages etc. it would be common to
    display an image as
    > no
    > more than a certain width, regardless of the actual
    image size
    This is mistaken. A large image will fetch as its native size
    regardless of
    how you display it on the page.
    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
    ==================
    "UsuallyConfused" <[email protected]> wrote
    in message
    news:f7i90a$lns$[email protected]..
    > On blog or news item pages etc. it would be common to
    display an image as
    > no
    > more than a certain width, regardless of the actual
    image size, simply for
    > fast
    > loading and consistent visual presentation. However, I
    would like users to
    > be
    > able to see the image full size if required.
    >
    > The obvious approaches are when clicking on the image,
    to either show it
    > full
    > size in the current browser window or to create a new
    window to show it,
    > probably using JavaScript to open a window the same size
    as the image.
    >
    > Both have their pros and cons and the other issue is
    that it is always
    > annoying to click on an image only to discover that the
    original was no
    > bigger
    > anyway!
    >
    > Does anyone have any thoughts on how best to handle
    images? Thanks.
    >

  • Working with large images

    i need to work with very large images (3000x3000 pixels) and they take a lot of memory (50MB). thing is that they don't use a lot of colors but they are loaded in memory with 24bit color model.
    it is jpeg image and it is decoded to buffered image with standard jpeg decoder. i want to use buffered iamge because it is very simple to work with, however, i need to find a way to reduce memory consumption.
    is it possible to somehow use different color model to reduce color count to 256, which is enough for me. i am clueless about imaging and i simple haven't got a time to get into it. i need some hints about this. i just want to know is it poosible (and how) to reduce size of BufferedImage in memory by decreasing it's number of colors.
    i was thinking about using gif encoder, but it works with images, not bufferedimages and conversion takes lot of time and is not a solution.
    thanx!
    dario

    You can create a byte indexed BufferedImage. This uses just 1 byte per pixel.
    Use
    public BufferedImage(int width,
    int height,
    int imageType,
    IndexColorModel cm)
    with
    imageType == BufferedImage.TYPE_BYTE_BINARY
    and create a color palette with
    new IndexColorModel()

Maybe you are looking for

  • Applescript help with true or false script

    I'm in need of a applescript that will run two different scripts based on the outcome of an existing file. I have a folder called Status. Inside this folder is a simple text file called Good.rtf I would like a script that would run one or the other s

  • Trouble with Adobe Bridge CS5.5 for Mac Lion Photo downloader

    Hi, I am having trouble with  CS5.5 Bridge's photdownloader when I am trying to choose a folder location. Im using Lion / Mac When I try to choose say an external drive or another folder location it will freeze up and stay on "Choose" the button flas

  • CME Directory list

    Hi all, I'm racking my brain with this one. I typed http://192.168.10.252/localdirectory into a web browser and was hoping to get an xml view of my CME phone directory instead I get an XML browser error: “The XML page cannot be displayed Cannot vie

  • Change employee name in the future

    If you change an employee's surname to take effect from a future date, the system shows this change with immediate effect in the PA30 and PA40 screens. The users want to see the name as of the system date. I have seen this issue before quite a few ye

  • IPod Touch now seems to be real sensitive.

    Hello, I've had my IPod Touch since March of last year, I got it for my birthday. About a week ago I was on the bus listening to music on it on my way home, and all of a sudden the music paused; I thought I accidently pulled my headphones out, but th