Display a large sequence of images like a video.

I want to display a large sequence of images (.jpg) like a video, something like a Component that displays an image and a TimerTask that changes that image every 50 milseconds and repaints:
class SlideShow extends Component
     private Timer timer;
     private TimerTask imageFliper;
     private Image currentImage;
     private Image nextImage;
     private int arraysize;
     private int arrayoffset;
     private int currentposi;
     String fileMask;
     public SlideShow(int offset, int size, String filemask)
          super.setSize(640,480);
          currentposi = arrayoffset = offset;
          arraysize = size;
          fileMask = filemask;
          timer= new Timer();
          nextImage = Toolkit.getDefaultToolkit().getImage(fileMask.replaceFirst("#",leftZero(currentposi,4)));
          imageFliper = new TimerTask()
               public void run()
                    currentImage = nextImage;
                    repaint();
                    if(++currentposi > arrayoffset + arraysize)
                         currentposi = arrayoffset;
                    nextImage = Toolkit.getDefaultToolkit().getImage(fileMask.replaceFirst("#",leftZero(currentposi,4)));
          timer.schedule(imageFliper, 0, 50);
     public void paint(Graphics g)
          g.drawImage(currentImage,0,0,super.getWidth(),super.getHeight(),this);
     public void update(Graphics g)
          paint(g);
     static public String leftZero(int target,int leftcount)
          StringBuffer sb = new StringBuffer();
          int i = (int)Math.pow(10,leftcount-1);
          while(i!=1)
               if(target<i)
                    sb.append("0");
                    i=i/10;
               else
                    break;
          sb.append(Integer.toString(target));
          return sb.toString();
     public static void main(String[] args) 
          Frame f = new Frame("slide show");
          SlideShow s = new SlideShow(1,1000,"intro\\intro#.jpg");
          f.add(s);
          f.addWindowListener(new WindowAdapter()
                         public void windowClosing(WindowEvent e){System.exit(0);}
          f.pack();
          f.setSize(640,480);
          f.setVisible(true);
}but just using the Image class seems to be unefective.
Does anyone kwon a library that does this fast and efective?
or should i just convert the images to a media file and use a media library?
Message was edited by:
nmfmr

Firstly if you're loading images with Toolkit you'll nbeed to use MediaTracker (see the Javadoc for full and clear instructions).
Secondly, be aware of how long it takes to load image data, allocate the memory for it, and decode it. This is where you're going to suffer and it's the fundamental flaw in the plan of simulating video by flipping single frames: it's highly unlikely you'll manage it quickly enough. As above, 50ms is quite optimistic.
You could do your loading up-front and buffer a load of images - there are a few strategies you could use for this. But bear in mind that (a) this is going to be very memory hungry, and (b) if your image load time is greater than your frame display time you're always going to be fighting a losing battle. But it should work for very small animations.
Run yourself some tests: write yourself a simple test class which just loads an image in its main() method using a MediaTracker. It'll tell you how long loading the image takes. Of course, if you're doing it in an applet then you've got all sorts of other factors to consider and the load times will be high.

Similar Messages

  • I would like the time to be displayed in large print on the notification screen. Does any one know how?

    I would like the time to be displayed in large print on the notification screen on iPhone 4s. Does any one know how?

    not 100% sure what you mean
    smileys are a sequence of chars like ;-¶ which the internet site or program like a chat program replace with an image typically a small gif image
    is your problem that you want to save those images to your harddisk?
    is your problem that you wish some other program then facebook to replace the smiley chars with the images that facebook use?
    is your problem that when you type on facebook your smileys are not replaced with the same images as others (in which case you should prob as which signs they type)

  • Displaying a larger image from a thumbnail [was: Question]

    I would like to display a larger image from a thumbnail inserted on the web page. I inserted a rollover image, used the thumbnail as the original and a larger and different jpeg image as the rollover image. However, when the mouse rolled over the thumbnail, the new rollover image (different then the original) was the same size as the original. Is there an easier way to display a larger image from a thumbnail? What am I doing wrong? Thanks
    [Subject line edited for clarity by moderator]

    Could you also provide a CSS solution to opening a non _self page that is the same size as the image displayed on the page.
    Not possible with pure CSS.  Sorry.  Your best option is to use one of the jQuery Lightbox scripts mentioned below.
    http://line25.com/articles/rounding-up-the-top-10-jquery-lightbox-scripts
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Canvas Resize to Square for a large number of images using script. E.g. image is currently 1020 x 600, I would like to change this to 1020 x 600. PLEASE HELP

    Hi All,
    I have a large number of images that I need to resize the canvas sizes to a square, the images are currently in different sizes. For example, if an image is 1020 x 600 I would like to change the canvas to 1020 x 1020 so that the image becomes a square. I am using CS3 and all the images are jpeg's. I have done research on scripts but the ones I have tried have not worked. Please help.
    Thanks.

    Since you do not want to crop your images to a square 1:1 aspect ratio changing the canvas to be square will not make your images square they will retain their Aspect Ratio and  image size will be changer to fit within your 1020 px square. There will be a border or borders on a side or two borders on opposite sides.   You do not need a script because Photoshop ships with a Plug-in script to be used in Actions.   What is good about Plugins is the support Actions.  When you record the action the plug-in during action recording records the setting you use in its dialog into  the actions step.  When the Action is played the Plug-in use the recorded setting an bypasses displaying its dialog. So the Action can be Batch.  The Action you would record would have two  Steps.   Step 1  menu File>Automate>Fit Image... in the Fit Image dialog enter 1020 in the width and height  fields.  Step 2 Canvas size enter 1020 pixels in width and height  not relative leave the anchor point centered it you want even borders on two sides set color to white in the canvas size dialog. You can batch the action.
    The above script will also work. Its squares the document then re-sizes to 1020x1020  the action re-sizes the image to fit with in an area 1020 x 1020 then add any missing canvas. The script like the action only process one image so it would also need to be batched. Record the script into and action and batch the action. As the author wrote. The script re size canvas did not specify an anchor point so the default center anchor point is uses  like the action canvas will be added to two sides.

  • I would like to add content that changes on a calendar basis, such as 'thought for the day". It can then display a different text or image on a nominated day. Can this be done? Robert.

    I would like to add content that changes on a calendar basis, such as 'thought for the day". It can then display a different text or image on a nominated day. Can this be done? Robert.

    OK Thanks Brad.
    I could use Tockify of course, but wanted to create the same things on an existing site.
    I do not know how to copy the code and get it onto Muse, but that’s OK for now. I will work something else out.
    Robert

  • Attached images display too large

    when using mail in os 10.4, if someone sends me a message with pictures attached, they are at a size that you can see the whole picture when you scroll down in the message. if i forward that email to someone, the pictures display too large and you cannot see the whole image in the message. is there a setting for this somewhere?
    thanks

    BDAqua wrote:
    Ah thanks, maybe I was experimenting with too small of pics!?
    Hmm, interesting...
    Mail will remebember the size and will automatically use it the next time you attach an image if you forget to manually change it back.
    And if the last setting was small, the menu may be there, but will have no effect since you cannot Scale up!
    Yes, it works only for downsizing.
    Also, it seems that if the pic is in quoted nesting the size setting has no effect!?
    On Mac OS X 10.5 and later it works regardless of quotation. If it does not on Mac OS X Tiger, it must be a bug that was fixed later.

  • Display images like in images search engines

    I have a list of images that I want to display like the results in yahoo image and google image search engines.But when i use tha datatable component I can just display one column.And after I want to do something after that the user clicks on an image for example displaying it with real size not in thumbnail mode.
    I also tryed using the image browse widget and the yahoo carousel but I dont know how to hand events and how to know which picture is selected.
    Can you please help me.
    Thanks in advance

    fiedlerm wrote:
    I try to display workspace Image in a HTML Region dynamically.
    The Image Source is stored in a hidden Item filled by an application process.
    Region - Source:Always post code using <tt>\...\</tt> tags.
    <img src="#WORKSPACE_IMAGES#Sunny.gif">
    <br></br>
    &P1_ICON_SRC.
    <br></br>The first "hardcoded" Image was displayed.
    The second "dynamic" Image shows the following Text in the HTML - Region:
    <img src="wwv_flow_file_mgr.get_file?p_security_group_id=7856557026011968186&p_fname=Blizzard.gif"> Hidden page items cannot contain HTML mark-up. Look at the page source. When the item is rendered its value is contained in the hidden <tt>input</tt> element's <tt>value</tt> attribute:
    <input type="hidden" name="p_t01" id="P1_ICON_SRC" value="&lt;img src=&quot;wwv_flow_file_mgr.get_file?p_security_group_id=7856557026011968186&amp;p_fname=Blizzard.gif&quot;&gt;">The value must be properly HTML-escaped like this otherwise the browser would see it as tag soup:
    <input type="hidden" name="p_t01" id="P1_ICON_SRC" value="<img src="wwv_flow_file_mgr.get_file?p_security_group_id=7856557026011968186&p_fname=Blizzard.gif">">What exactly are you trying to achieve?
    Options for displaying images dynamically would include putting the required mark-up in an HTML region, only storing the image URI (or parts of it) in the page item, and referencing this using static text substitution. Others would be custom report templates or Dynamic PL/SQL regions.
    If you must store HTML code in session state and access it using static text substitution (not recommended) then use an application item.
    h4. Page Process
    begin
      :P1_ICON_SRC := 'Blizzard.gif'; -- Hidden page item
      :F41327_ICON_SRC2 := '<img src="#WORKSPACE_IMAGES#Blizzard.gif">'; -- Application item;
    end;h4. HTML region source
    <img src="#WORKSPACE_IMAGES#Sunny.gif">
    <br></br>
    <img src="&WORKSPACE_IMAGES.&P1_ICON_SRC.">
    <br></br>
    &F41327_ICON_SRC2.

  • After rotate, display of large JPEG images very slow.

    I am loading and displaying images using JAI and Java2D.
    When I load a large grayscale JPEG image (300 dpi, letter size), it displays fine.
    After a rotate, the next display is incredibly slow.
    Source is a RenderedImage loaded from a JPEG file using:
         FileSeekableStream ss = new FileSeekableStream(file);
         ImageDecoder dec = ImageCodec.createImageDecoder("jpeg", ss, null);
         RenderedImage source = dec.decodeAsRenderedImage(curPage);
    I create a scaled image using:
         interp = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
         ParameterBlock params = new ParameterBlock();
         params.addSource(source);
         params.add(xZoom); // x scale factor
         params.add(yZoom); // y scale factor
         params.add(0.0F); // x translate
         params.add(0.0F); // y translate
         params.add(interp); // interpolation method
    RenderedOp image3 = JAI.create("scale", params);
    And display inside the paintComponent() method of my JPanel-derived class using:
         AffineTransform transform = new AffineTransform();
         transform.translate(shiftX, shiftY);
         Graphics2D G2d = (Graphics2D)g.create(); //copy g
         G2d.drawRenderedImage(image3, transform);
    If I add a rotate step after the scale:
         ParameterBlock paramsR = new ParameterBlock();
         paramsR.addSource(source);
         paramsR.add(TransposeDescriptor.ROTATE_90);
         // Create an operator to turn image.
         source = JAI.create("Transpose", paramsR, null);
    Then the next display for a 300 dpi 8 bit grayscale JPEG file can take up to 60 seconds.
    The bulk of the elapsed time is inside: Graphics2D.drawRenderedImage(image3, transform);
    Any ideas what I am doing wrong here?
    I am relatively new to using Java Advanced Imaging.
    Thanks,
    T.J. Brown

    Sorry, a correction.
    The file is actually JPEG-compressed data inside a TIFF file.
    So the decode step uses:
    ImageDecoder dec = ImageCodec.createImageDecoder("tiff", ss, null);
    JPEG inside a JFIF file is much faster.
    Thanks,
    T.J. Brown

  • RoboHelp 8 HTML WebHelp How to display a larger image of a thumbnail by clicking on or rolling over the thumbnail?

    How would you display a larger image of a thumbnail by clicking or rolling over the thumbnail?

    Hi there
    For a mouseover you would have to add some custom developed JavaScript. You could probably find some pre-made on the web if you poked around.
    Generally speaking, any way you slice it you will be using two images. One for the thumbnail and one for the full sized image. You could employ the popup functionalty to pop up the larger image.
    I used to simply create DHTML drop-downs and insert the large images in the drop-down area.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • XML Report comes up as blank when a very large sequence is run

    Forum,
    We have multiple test sequences which me mix and match to do testing on different producst in our product line. We have no issues when we are working with small sequences ( small sequences : Which generate reports upto 12-50MB ). However when the sequences become large ( ~100-200 tests at one go , we get a blank report with the following text: 
    Begin Sequence:
    No Sequence Results Found
    We notice this typically for report sizes 60MB and more. Is there a limit to how much teststands result collection memory can store ? 
    My predominant report options 
    -- On the fly reporting disabled
    -- XML - expand.xsl selected
    The same set of settings do not make any difference for smaller reports, but give error for larger sequences - So I suspect its something to do with size of report being generated ! 

    I created a simple sequence file which had a 100 Pass/Fail steps using the None Adaptor. These 100 steps in the form of 10 SequenceCall steps each performed 10 Pass/Fail step was placed in a For loop in the MainSequence. The loop was set to run 1000 iterations. The ReportOptions were set for XML horizonal, On the Fly enabled.
    This I set running. Explorer was open at the folder where the result file was being stored. Two files were generated, the actual result file and a temporay file. I also had the Taskmanager open to monitor the performance.
    As the result file got larger, about 20MB, I noticed that the size of the file was first set to zero and the data was written to the file. (It seemed like the file was deleted and generated each step result time). I also noticed that as the file got larger and larger, the storing of the step results was having an effect on the performance of the Test Sequence execution.
    I left this running over night and sometime later the execution crashed. (see attached image). Before closing the dialog, I checked explorer to see what the state of the result file was. The both files was empty.
    I repeated the run but this time the number of iteration was set to 500, again the execution crashed but this time the result file did have some data, rather a lot of data, over 50MBs.
    I tried to open the file to check the contents but unfortunately my PC didn't seem to beable to handle a file of that size, as it was taking a long time to load, so I kill the process.
    I dont think changing the iterations from 100 to 500 had anything to do with the getting the results on the second. I just think the point were it crashed was slightly different allowing the result to be transferred back to the file.
    It would be interesting to find out whats going on the On the fly routine.
    It also seems that On the fly seems no better that normal reports generation.  It also seems pointless generating a very large file of results and that generating smaller files would be the better way to go. Using HTML or XML a top level report file could be used to link all the smaller files together.
    Regards
    Ray Farmer 
    Regards
    Ray Farmer

  • Resizing large quantites of images using image processor - STUCK

    I have upgraded to Photoshop CC. I am attempting to resize large quantites of images using the image processor. I need both the width and height set to an exact number for web use. When I enter the pixel size into the "resize" boxes and click run, the sizes i get are correct on one dimension but slightly off on the other dimension. When I just do one image at a time to these same dimensions it resizes correctly? It appears it only does when selecting large qunatites. Any suggestions?die

    Since you do not want to crop your images to a square 1:1 aspect ratio changing the canvas to be square will not make your images square they will retain their Aspect Ratio and  image size will be changer to fit within your 1020 px square. There will be a border or borders on a side or two borders on opposite sides.   You do not need a script because Photoshop ships with a Plug-in script to be used in Actions.   What is good about Plugins is the support Actions.  When you record the action the plug-in during action recording records the setting you use in its dialog into  the actions step.  When the Action is played the Plug-in use the recorded setting an bypasses displaying its dialog. So the Action can be Batch.  The Action you would record would have two  Steps.   Step 1  menu File>Automate>Fit Image... in the Fit Image dialog enter 1020 in the width and height  fields.  Step 2 Canvas size enter 1020 pixels in width and height  not relative leave the anchor point centered it you want even borders on two sides set color to white in the canvas size dialog. You can batch the action.
    The above script will also work. Its squares the document then re-sizes to 1020x1020  the action re-sizes the image to fit with in an area 1020 x 1020 then add any missing canvas. The script like the action only process one image so it would also need to be batched. Record the script into and action and batch the action. As the author wrote. The script re size canvas did not specify an anchor point so the default center anchor point is uses  like the action canvas will be added to two sides.

  • How do I create new versions of a large number of images, and place them in a new location?

    Hello!
    I have been using Aperture for years, and have just one small problem.  There have been many times where I want to have multiple versions of a large number of images.  I like to do a color album and B&W album for example.
    Previously, I would click on all the images at one, and select new version.  The problem is this puts all of the new versions in a stack.  I then have to open all the stacks, and one by one move the new versions to a different album.  Is there any way to streamline this proccess?  When it's only 10 images, it's no problem.  When it's a few hundred (or more) its rather time consuming..
    What I'm hoping for is a way to either automatically have new versions populate a separate album, or for a way to easily select all the new versions I create at one time, and simply move them with as few steps as possible to a new destination.
    Thanks for any help,
    Ricardo

    Ricardo,
    in addition to Kirby's and phosgraphis's excellent suggestions, you may want to use the filters to further restrict your versions to the ones you want to access.
    For example, you mentioned
      I like to do a color album and B&W album for example.
    You could easily separate the color versions from the black-and-white versions by using the filter rule:
    Adjustment includes Black&white
         or
    Adjustment does not include Black&white
    With the above filter setting (Add rule > Adjustment includes Black&White) only the versions with Black&White adjustment are shown in the Browers. You could do similar to separate cropped versions from uncropped ones.
    Regards
    Léonie

  • How to send files like audio,video,images and text via RMI..

    Hi everyone,
    As I am working under a project, my own, of creating a chat machine, I've thought to make it capable of doing everything that MSN or yahoo MSN can do. Till now I've just been able to send messages and some small icons as expressions. So, my next step will be making my progam able to send even other files like audio, video, images and text to the person on the other machine to whom I'm chatting. But as I don't have any idea on how to start doing it, I want anyone who think he/she can help me to give me the basic logic that is used to do so. I would very much appreciate it. I've used vectors to store the text messages which is visible to all the users using the chat program enabling them to see various messages in it.
    thank you...
    Jay

    Hi,
    Now, I got stuck because the code doesn't seem to work well. For large files with around 40 mb or more size couldn't be sent. I have constructed the code, just rough sketch, as follows:
    ** In the Server Implementation class I've used FileInputStream to read the contents of a file that is sent as an argument to the method.
    ** Similarly, in the client side I've used RandomAccessFile to save the received array of bytes.
    public void sendFile(File f)
       ChatServer cs=(ChatServer)Naming.lookup("rmi://localhost/ChatServer");
       cs.readsAndStoreTheFileInTheServer(f); // In the Server Implementation the contents of the file is read and saved in an array of byte. later method is invoked by the client to get the array of the saved byte.
       cs.message("-Accept-"); // When a client receives this word then a JComponent with accept and cancel button will be constructed from where other clients can save/cancel the sent file.
    }For small size files this code works well but for files more than 40 mb of size it is useless. I wonder if there's any other alternative.
    regards,
    Jay

  • Is there a way set up a tooltip popup that displays alternate text on an image rollover in DW CC?

    I would like to set up a tooltip popup that displays alternate text on an image rollover. I am using Dreamweaver CC. Used to be a Spry widget, but those options seem to be gone. Not looking for anything elaborate, just a simple tooltip message box.

    Hi Daylilybud,
    If you are looking for a tool tip on hovering over the image, try adding attribute  ->  title="Your text" inside your image tag.
    For example <img src="" alt=""  title="Test"> .
    See if this resolves your problem.

  • Problem with importing a large number of images to Lightroom?

    I'm trying to import a large number of images from disk to Lightroom. If I select more that approximately 1500 images (1250 works fine), I get an error message saying "files do not exist". If I reduce the number of files imported, everything works fine. I can import in groups as long as the number selected at any one time is less that the ~1500 limit.
    Has any one had a similar problems? I'm running LR 2.4 64-bit on Win7 RC 64-bit, Q6600 processor, 8 GB RAM.
    Does not seem like this should be a problem. Its a real hassle to my workflow. I'm working on a series of time-laps movies (here is a link to a sample: http://vimeo.com/6375019).

    Thanks for your reply Sean,
    It is an internal disk drive, SATA II interface.I have no other disk/file problems, this is unique to LR as far as I can tell.
    I'm loading files onto disk from a CF card reader outside of Lightroom, then opening LR and telling it to import from disk. I've never had a problem before with imports. Experimenting with number of files, somewhere between 1250 and 1500 is where the problem occurs.
    Been busy making time-lapse videos of the fire in LA, so I'm away from the computer most of the time.
    thanks,
    Dan Finnerty

Maybe you are looking for

  • Where can I find the Oracle Clusterware 11.1.0.7 for Linux x86

    Hello, I am testing upgrading Oracle 11g RAC from 11.1.0.6 to 11.1.0.7 on Linu x86 (RedHat 5.3/OEL 5.3) I haven't been able to find the Oracle Clusterware 11.1.0.7 for Linux x86 download, which is required for the RAC upgrade. Could someone tell me t

  • Why can't I make a disk Image??

    getting Leopard tomorrow. system working great. plan to do an "upgrade installation". backed up all my files (106GB) to an external HDD. so I think I'm ready.... question is - why can't I make a disk image of my "Macintish HD"? it starts to create th

  • Endeca JDBC adapter issue

    Hi, When I ran my baseline with one jdbc record adapter there was no issue. When I added one more JDBC record adapter it fails. I have mentioned the pass through properly itself COLUMN_HANDLER_CLASS     com.endeca.soleng.itl.jdbc.AdvancedJDBCColumnHa

  • Retriving com class error in add-on client machine

    Dear all, i got error com class error when i start the add-on. The add-on working good all  systems except two client system. Thanks & Regards B.Lakshmi narayanan

  • HELP - JavaScript error on Rollover Image

    Hello Everyone, I am really enjoying working with Dreamweaver until errors like the following come up. Could someone please help me!! The error reads: "While executing onLoad in Rollover.htm the following JavaScript error occured: In file "Rollover";