Load a specific image in an array

Hi,
In my photo gallery, I have an array of images that load sequentially using 'next' / 'prev' buttons. The code fades out the current swf, recognises when the new external swf has fully loaded, then fades in:
this.pathToPics = "portfolio/100_design/";
this.pArray = ["1.swf", "2.swf", "3.swf", "4.swf"];
this.fadeSpeed = 40;
this.pIndex = 0;
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.image_holder);
MovieClip.prototype.changeImage = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
this.onEnterFrame = fadeOut;
MovieClip.prototype.fadeOut = function() {
if (this.image_holder._alpha>this.fadeSpeed) {
this.image_holder._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.image_holder;
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.image_holder.getBytesLoaded();
t = this.image_holder.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
MovieClip.prototype.fadeIn = function() {
if (this.image_holder._alpha<100-this.fadeSpeed) {
this.image_holder._alpha += this.fadeSpeed;
} else {
this.image_holder._alpha = 100;
this.onEnterFrame = null;
This works beautifully when scrolling images sequentially. However I also have buttons 'menu1', 'menu2', 'menu3', 'menu4'...
Is there a way on 'menu2', I can do the following:
- fade out the current swf
- load '2.swf' into _root.image_holder and fade in
- ensure the 'next' / 'prev' buttons recognise the position of the current swf relative to the array (so when 'next' is pressed '3.swf' loads)
Thanks!!!

Everything I try comes back with the following Output statement:
Error opening URL 'file:///Macintosh%20HD/Users/andrew/Desktop/Website/NaN'
I have tried to make a new function (in bold) but am completely lost. I appreciate this is tricky for you at this stage. Hopefully you can shed some light!
this.pathToPics = "portfolio/100_design/";
this.pArray = ["1.swf", "2.swf", "3.swf", "4.swf"];
this.fadeSpeed = 40;
this.pIndex = 0;
// d=direction; should be 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.image_holder);
MovieClip.prototype.changeImage = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
this.onEnterFrame = fadeOut;
MovieClip.prototype.image2 = function() {
this.pIndex = 2;
this.onEnterFrame = fadeOut;
MovieClip.prototype.fadeOut = function() {
if (this.image_holder._alpha>this.fadeSpeed) {
this.image_holder._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.image_holder;
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.image_holder.getBytesLoaded();
t = this.image_holder.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
MovieClip.prototype.fadeIn = function() {
if (this.image_holder._alpha<100-this.fadeSpeed) {
this.image_holder._alpha += this.fadeSpeed;
} else {
this.image_holder._alpha = 100;
this.onEnterFrame = null;

Similar Messages

  • Performance Issue : Why does ADF Taskflow Portlet (JSF bridge portlet) loading ADF Specific images, css, js everytime from portlet producer with dynamic URL with portlet_id and context parameters?

    Hi All,
    We have used WSRP Portlet in Webcenter Portal Page. The Portlet is created using JSF Bridge out of ADF Bounded Taskflow.
    It is causing Performance issue. Every time static content like js, css and images URLs are downloaded  and the URL contain portlet_id and few other dynamic parameters like resource_id, client_id etc.
    We are not able to cache these static content as these contains dynamic URL. This ADF Specific  images, js and css files  are taking longer time to load.
    Sample URL:
    /<PORTAL_CONTEXT>/resourceproxy/~.clientId~3D-1~26resourceId~3Dresource-url~25253Dhttp~2525253A~2525252F~2525252F<10.*.*.*>~2525253A7020~2525252FportletProdApp~2525252Fafr~2525252Fring_60.gif~26locale~3Den~26checksum~3D3e839bc581d5ce6858c88e7cb3f17d073c0091c7/ring_60.gif
    /<PORTAL_CONTEXT>/resourceproxy/~.clientId~3D-1~26resourceId~3Dresource-url~25253Dhttp~2525253A~2525252F~2525252F<10.*.*.*>~2525253A7020~2525252FportletProdApp~2525252Fafr~2525252Fpartition~2525252Fie~2525252Fn~2525252Fdefault~2525252Fopt~2525252Fimagelink-11.1.1.7.0-4251.js~26locale~3Den~26checksum~3Dd00da30a6bfc40b22f7be6d92d5400d107c41d12/imagelink-11.1.1.7.0-4251.js
    Technologies Used:
    Webcenter Portal PS6
    Jdeveloper 11.1.1.7
    Please suggest , how this performance issue can be resolved?
    Thanks.
    Regards,
    Digesh

    Strange...
    I can't reproduce this because i have issues with creating portlets... If i can solve this issue i will do some testing and see if i can reproduce the issue...
    Can you create a new producer with a single portlet that uses a simple taskflow and see if that works?
    Are you also using business components in the taskflows or something? You can try removing some parts of the taskflow and test if it works so you can identify the component(s) that causes the issues.

  • Loading a specific image using servlets

    Hello,
    I have a question regarding a servlet and my HTML. In my HTML page I should load/ reaload some GIF images that are being dynamically created on the serves: drawn with Java 2 D and afterwards GIF encoded. response.setContentType("image/gif");
    GifEncoder encoder = new GifEncoder(img, out);
    in the servlet GraphicServlet.java, for example.
    In my HTML page I want to load this image that is being formed on the server. Here's that piece of code:
    <td><A HREF="http://localhost:8080/servlet/mypackage.myServlet?Nothing! onMouseover="ddrivetip('Click to draw a selected shape', 'yellow', 250)";
    onMouseout="hideddrivetip()">
    <img WIDTH=375 HEIGHT=250 BORDER=0 src="<%
    if (request.getParameter("string")!=null)
    out.print((String)request.getParameter("string"));
    else
    out.print("http://localhost:8080/servlet/mypackage.GraficServlet?undo");
    %>" ISMAP/></a></td>
    The thing is that I want to load in HTML page in a table the image splitted on the the server. Every cell of the table is a part of the image. My question is how I can do that? Assign an id to every part and load that? What parameted should I pass between the HTML page and the server in order to be able to do that? How can I do in order to be able to reload in the browser only that piece of image that suffered modifications?
    Thank you in advance.
    Dani

    Hello,
    I will try to explain in a better way.
    At the present moment the application behaves as it follows:
    1.The Server creates the image and encodes it into GIF
    2. Html displays this image as a server side image map
    3. The image is dynamically umpated in the browser, being modified by user interactions, and modifications are sent to the server
    4. On the server I am splitting this image in subimages (for example, a grid of 4 equal tiles)
    What I'm indending to do is:
    1. What I am trying to do is display in a table in the browser the subimages, each cell holding one part of the entire image, and I don't know what parameter I should use and how, as a selection of the sub-image.
    Here's the fragment where I am loading the entire image in the browser. I don't know how I should modify that in order to be able to load the certain parts on the original images in a table, in my HTML page.
    <td><img WIDTH=375 HEIGHT=250 BORDER=0 src="<%
    if (request.getParameter("string")!=null)
    out.print((String)request.getParameter("string"));
    else
    out.print("http://localhost:8080/servlet/mypackage.GraficServlet?undo");
    %>" ISMAP/></td>
    Thank you, once again.

  • Loading images from an Array generated from XML

    OK, this is my first day trying to use AS3 and I'm kind of
    confused on how to load an image onto the screen and then be able
    to resize it, scale it, etc..
    I'm loading up to 5 images in from an XML file that will be
    generated on a server. (right now I'm just using a test.xml file).
    Normally I would load the images into dynamically created
    movie clips (whatever0_mc through whatever4_mc generated by code in
    AS2). But I can't seem to get anything working.. I've looked on the
    internet and read through some information but I'm still just
    REALLY confused... this is what I have so far. To make it easier on
    me in the future, I've put different code on different layers so I
    can look at it closer.. I've separated the code into the different
    layers they're on here:
    First Layer:
    import flash.events.Event;
    import flash.net.URLLoader; // URL Loader Import for Images
    import flash.net.URLRequest; // URL Requests Import for
    Images
    import flash.display.Loader; // Loader
    import flash.events.ProgressEvent; // Progress for Loader
    import flash.text.TextField; // Imports for Text Fields
    import flash.display.Sprite; // Imports Sprite stuff for
    loaded Images
    import flash.display.Bitmap; // Imports stuff to display a
    bitmap
    Second Layer:
    var imgLoader:Loader = new Loader(); // Initialize Image
    Loader
    // Listeners for the Image Loaders //
    function showPreloader(evt:Event):void {
    trace("-- ** showPreloader ** --");
    addChild(loadProgress_txt);
    function showProgress(evt:ProgressEvent):void {
    trace("-- ** showProgress ** --");
    var totalLoaded:Number = evt.bytesTotal;
    var currentLoaded:Number = evt.bytesLoaded;
    var thePercent:Number = (currentLoaded * 100) / totalLoaded;
    loadProgress_txt.text = thePercent + "%"; // Show bytes
    loaded
    function showLoadResult(evt:Event):void {
    trace("-- ** showLoadResult ** --");
    Third Layer:
    // Setup Variables //
    var imageArray:Array = new Array();
    var galleryTitle:String;
    var numPhotos:Number;
    var gallerySubmitter:String;
    // XML Info //
    XML.ignoreComments = true;
    XML.ignoreWhitespace = true;
    var galleryXML:XML;
    var xmlLoader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest("test.xml");
    xmlLoader.load(request);
    xmlLoader.addEventListener(Event.COMPLETE, XMLComplete);
    function XMLComplete(evt:Event):void {
    trace("-- ** XMLComplete ** --");
    var loader:URLLoader = evt.target as URLLoader;
    if (loader != null){
    galleryXML = new XML(loader.data);
    galleryTitle = galleryXML.children()[0].attributes()[0];
    numPhotos = galleryXML.children()[0].attributes()[1];
    gallerySubmitter = galleryXML.children()[0].attributes()[2];
    trace("galleryTitle: " + galleryTitle);
    trace("numPhotos: " + numPhotos);
    trace("gallerySubmitter: " + gallerySubmitter);
    for(var i:Number = 0; i<numPhotos; i++) {
    imageArray.push(galleryXML.children()[0].children()
    .attributes()[1]);
    } // for(var i:Number = 0; i<numPhotos; i++)
    trace(imageArray.toString());
    trace("loading: images\\gallery\\" + imageArray[0]);
    var imgRequest:URLRequest = new
    URLRequest("images\\gallery\\" + imageArray[0]); // Request the
    Image into the Loader
    imgLoader.load(imgRequest);
    imgLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
    imgLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult);
    } else { // if (loader != null){
    trace("loader is not a URLLoader!");
    } // if (loader != null){
    } // function onComplete(event:Event):void {
    // End XML Info //
    Can anyone point me in the next direction?
    thanks...

    When you used the IMAQ create VI you specified each image to use the same name of "image".  Each image has to have a unique name.  I edited your VI to give a unique name for each image and I was able to view three different images in three different viewing panes.
    Attachments:
    Image Array Reworked.vi ‏19 KB

  • Loading only last image

    This code is loading the xml correctly, populating the mainClipArray correctly, but only adding the last image to the stage.
    I think it is not waiting for completeClipLoad() to complete.  I tried removing :void from the function to see if waiting for a return would do it, but no luck.
    Any ideas?
    CODE:
    var myXML:XML;
    var xmlLoader:URLLoader = new URLLoader();
    var mainClipArray:Array = [];
    var counter:int = 0;
    var myLoader:Loader = new Loader();
    xmlLoader.load(new URLRequest("portfolio.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, completeXMLLoad);
    function completeXMLLoad(e:Event):void{
        myXML = XML(e.target.data);
        var len:int = myXML.portfolio.unit.length();
        for(var i:int = 0; i<len; i++){
            counter = i;
            mainClipArray[i] = new pane();
            //Load small image
            var smallfilename = myXML.portfolio.unit[i].small.filename;
            myLoader.load(new URLRequest(smallfilename));
            myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeClipLoad);
            mainClipArray[i].x = i * 15;
            addChild(mainClipArray[i]);
    function completeClipLoad(e:Event):void{
        trace("made it in");
        mainClipArray[counter].addChild(myLoader);
        trace("added child");

    Delaying the progress isn't going to help if you still have only one loader.  I would say that you could move the var myLoader:Loader = new Loader(); line inside the loop so that you have a new loader instance for each loading occurence, but then you would also need to adjust the completeClipLoad function to use the event target (e.target) instead of "myLoader".  But that still wouldn't resolve matters completely because you have that counter variable that will be working as fast as the for loop, with the loop likely finishing before the first item gets loaded... and since your completeClipLoad also makes use of that variable, you'll end up with only the last pane object being used.
    If you want to control the order of loading and retain the code in the one place (the other suggestion offered above having the code inside the pane could also be a viable approach), then a better strategy is to to use a programmed loop rather than a for loop, where only one loading occurs at a time and the completion of one loading triggers the next to begin.  Something like (this is just an outline form)...
    counter = 0;
    imgArray;
    function completeXMLLoad(e:Event):void{
         ... // process all the xml into the imgAray
        loadSmallImage(); // start by loading the first image only
    function loadSmallImage(){
         // create loader instance
         // assign load complete listener
         // load imgArray[counter]
    function loadComplete(e:Event) {
         // process the loaded image in a new pane
         // increment counter
         // if counter is < imgArray.length -> loadSmallImage();

  • Display image from byte array

    Hello Everybody,
    I need to display an image given in a byte array, how can I show this image in a JFrame?
    1. I tryied saving the image in a .jpg file,
         File file1 = new File("Path to my destination image");2. then I use a FileOutputStream to save the image in the path:
            FileOutputStream fos1 = new FileOutputStream(docu);
            fos1.write(ImageInbyteArray);
            fos1.close();3. Once I have the image in a file I'm trying to load it using a JButton, but the JButton doesn't display the image. I think that for some unknown (at least for me ;-) reason the file isn't still available to be used in the ImageIcon, this is my code:
            imgIconDocu = new ImageIcon("Path to my destination image");
            jBtnDocu = new JButton(imgIconDocu);What's wrong here?
    Thanks a lot

    Does the byte array contain a JPEG image? Where did
    you get the contents of the byte array?yes the array contains the JPEG image, I have a database in PostgreSQL, and the images are stored in blob in the database. I have to call a service in the server and in return it gives me the 3 images as byte arrays, that's the reason I only have the byte arrays. so I tryed saving the images as jpeg files in my hard disk to show them, but it appears that they are not available to show them in Swing after saving them. I can only show the images if I close my application and start it again :-(
    I tryed flushing and closing the FileOutputStream after the writting process (fos.write(bytearrayImage);
    fos.flush();
    fos.close();)
    Y also tryed:
    fos.write(bytearrayImage);
    fos.close();
    fos.flush();But it doesn't work either :-(
    What do you recommend me?.
    Thanks a lot,
    Johnny G L

  • How can i load a specific CSS style sheet for Safari?

    Okay, So I have some structure issues when viewing my website on Safari compared to Firefox. Is there a way to put a code in the <head> tag to load a specific CSS style sheet for Safari like you can do with IE?
    Thanks.

    I took a screenshot of your page from Firefox (shown below).  I assume you're seeing the same problem in Safari.  If you increase text size one click, the keyboard image drops below the #contact division.
    1) Height is a restiction in all browsers except IE.  Avoid  using height values on containers with text in them.  If needed to show  a background image, use the min-height property.
    2)  Fix your code errors. Some browsers are very sensitive to errors.
    3)  Your #content lacks cohesion. You need 3 columns, each with a width in pixels.  Or simply use a 3-column table.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • URGENT : Please HELP : Loading a first image too slow

    Hello,
    I want to load an image to save it just before in a JPG format so as to obtain finally a byte[] array of this JPG image result.
    So, to do it, I tried to load my Image from different ways but I have always a strange comportement... My problem come from the reading :
    First, I use the imageio classes...
    FileImageInputStream fiis = new FileImageInputStream(file);
    BufferedImage input = ImageIO.read(fiis);
    And then, I use the oldest method :
    Image image = new ImageIcon(file.getAbsolutePath()).getImage();
    BufferedImage input = new BufferedImage(image.getWidth(panel), image.getHeight(panel),BufferedImage.TYPE_INT_RGB);
    and also :
    Image image = new ImageIcon(file.getAbsolutePath()).getImage();
    BufferedImage input = toBufferedImage(picture);
    But finally, I understood my problem is that the first time I load an image (no matter the format, JPG, BMP, TIFF... or other) the loading phase is very slow and lasts at least 30 sec. But then, every loading that I do will gonna be really fast. (No more than 1 sec.) It's look like if the first time there was a kind of dinamical alocation or something like that.... but I tried to find some configuration parameters to set it... But without success. :-(
    If someone could have an idea to suggest me... it would help me very much.
    Thanks in advance for your help,
    Anthony

    Please someone can help me ?!? A suggestion ?
    I have tried today one more time to resolve this issue... but without success... Anything I do with the loading of an image... by imageio or other ways... it's still the same problem... the first time I load an image, it takes me 40 - 50 sec to load it and after this first load, it is very fast with others... and with every formats. It's not a question of format but of memory allocation, I think... but I'm not sure...
    PRECISION : I work with an applet, is there something to configurate to allocate some memories or another thing ?!?
    Thanks in advance for your help, I really need it just right now... I have to finish this job extremly fast !!!
    Regards,
    Anthony

  • 2 questions - change image size within print cell, and saving print template w/ specific images

    Hi,
    Searched the forums for the answer to these but couldn't find much.
    1. Is there a way to change the image size within a cell (under print module). For example, zoom in 140% on a a specific image but still have it within the original cell size?
    2. Say I create and fill in an elaborate print template with my images - is there a way to save the FILLED IN version of the template to edit at a later time? For example if I wanted to load it back up w/ all the original images layed out in the print template, but maybe change a few and resave as jpeg?
    Thank you!

    Hi
    I'm not sure but maybe you can use a rectangle to hold the .ai image, resize the rectangle and fit proportionally the image inside it
    hope this help
    Eli

  • Question about loading and using Images.

    I know how to load an image and to draw it onto a canvas etc etc. However my question is to do with the efficiency of loading multiple images (possibly the same image!) and using them together. I have multiple objects, all instances of the same class, which all draw themselves onto a screen in different positions. However they all use the same 3 images (depending on an internal state).
    So if I create 5 of these objects and each object calls to load the same image using something along the lines of:
    url = this.getClass().getResource("MyImage.png");
    normalImage = Toolkit.getDefaultToolkit().getImage(url);Does this mean that in the memory there are 5 exactly the same copies of this image? Or does java do something clever and use one image that they would all reference? I suspect I will have 5 in memory but I wanted to ask about this before going and making an imageManager class where I load all the images and just use getMethods in that when drawing. I will not be preforming any transforms or anything on any of the images so they can all literally be the same image but simply drawn in multiple positions on the one canvas.
    (note: I am using active rendering to draw these images myself and then blit it to the screen ...).

    Use ImageIO rather than Toolkit--with Toolkit you need to use a MediaTracker to ensure you have your image loaded before you try to use it.
    If you load an image and then do this:
    MyImage1 = MyImage;
    MyImage2 = MyImage;
    MyImage3 = MyImage;
    There are 4 references to the Image in MyImage. If you don't specifically use a method that gives you a new Image, usually, you are getting a refrence to an image already loaded in memory.

  • Loading file of BMPs into one array

    Hi, 
    For some reason I am having trouble loading a batch of BMP files into one 2D array.  I have attached the VI I have been messing with for some time now... (as well as a couple sample BMPs if someone wants them)
    I want to take each BMP in a folder, extract the 2D array and put it into one array.  Each new image's 2D array goes on the row after the previous image.
    Any help for this seemingly simple problem?
    Solved!
    Go to Solution.
    Attachments:
    loadBMPs.vi ‏13 KB
    DataBMP.zip ‏3 KB

    1) You are correctly finding the filenames... but what are you doing with the single path? That's only going to store the last one in the loop... and you don't connect it to the BMP vi. 
    2) You should just do everything in the for loop. 

  • Need help loading base64 encoded image.

    I've got an applet that saves an image into a database by posting a base64 encoded version of the image to an ASP page. Basically, I convert the image to an array of bytes, then encode it and post it to the page. Now, my problem occurs after I read the base64 string from the database and try to display it. When the application is started up, it is supposed to read the image and load it into the canvas of the applet, but I get a NullPointerException when I call displayImage because the fgImage has -1 width and height. If anyone has done this before and has any hints or tips, that would be great. Otherwise, take a look at my code and see if you can find something wrong. Thanks!
    public void loadBase64Image(int[] newPixels) {
    System.out.println("loading new image...");
    try {
    if (newPixels == null) {
    byte[] imgPixels = new byte[this.getWidth() * this.getHeight() * 4];
    URL loadURL = new URL(fgImgURL);
    URLConnection imageCon = loadURL.openConnection();
    imageCon.setDoOutput( true );
    imageCon.setUseCaches(false);
    DataInputStream imageIn = new DataInputStream( imageCon.getInputStream() );
    BASE64Decoder decodedImage = new BASE64Decoder();
    imgPixels = decodedImage.decodeBuffer(imageIn);
    imageIn.close();
    int w = this.getWidth();
    int h = this.getHeight();
    int imgPix[] = new int[w * h];
    int index = 0;
    for(int y=0; y<imgPix.length;y++){
    imgPix[y] = imgPixels[4*y]
    | (imgPixels[4*y + 1] >> 8)
    | (imgPixels[4*y + 2] >> 16)
    | (imgPixels[4*y + 3] >> 24);
    imgMemSrc = new MemoryImageSource(w, h, imgPix, 0, w);
    else
    imgMemSrc = new MemoryImageSource(this.getWidth(),this.getHeight(),newPixels,0,this.getWidth());
    // Update the fgImage to the current OSC.
    if (fgImage != null) fgImage.flush();
    fgImage = Toolkit.getDefaultToolkit().createImage(imgMemSrc);
    displayImage(fgImage, this.getWidth(), this.getHeight());
    catch (Exception e){
    System.out.println("BASE64 LOAD ERROR (" + e.getClass() + ": " + e.getMessage() + ")");

    Docs for URLConnection
    "A URL connection can be used for input and/or output. Set the DoInput flag to true if you intend to use the URL connection for input, false if not. The default is true unless DoOutput is explicitly set to true, in which case DoInput defaults to false."
    You have setDoOutput(true), so doInput is by default set to false according to the docs. I would make the change to also setDoInput(true) as well and see if it works.
    public void loadBase64Image(int[] newPixels) {
       System.out.println("loading new image...");
       try {
          if (newPixels == null) {
             byte[] imgPixels = new byte[this.getWidth() * this.getHeight() * 4];
             URL loadURL = new URL(fgImgURL);
             URLConnection imageCon = loadURL.openConnection();
             imageCon.setDoOutput( true );
             imageCon.setDoInput( true ); // Make sure you add this line
             imageCon.setUseCaches(false);
             DataInputStream imageIn = new DataInputStream( imageCon.getInputStream() );
             BASE64Decoder decodedImage = new BASE64Decoder();
             imgPixels = decodedImage.decodeBuffer(imageIn);
             imageIn.close();
             int w = this.getWidth();
             int h = this.getHeight();
             int imgPix[] = new int[w * h];
             int index = 0;
             for(int y=0; y<imgPix.length;y++){
                imgPix[y] = imgPixels[4*y] | (imgPixels[4*y + 1] >> 8) | (imgPixels[4*y + 2] >> 16) | (imgPixels[4*y + 3] >> 24);
             imgMemSrc = new MemoryImageSource(w, h, imgPix, 0, w);
          else
             imgMemSrc = new MemoryImageSource(this.getWidth(),this.getHeight(),newPixels,0,this.getWidth());
          // Update the fgImage to the current OSC.
          if (fgImage != null)
             fgImage.flush();
          fgImage = Toolkit.getDefaultToolkit().createImage(imgMemSrc);
          displayImage(fgImage, this.getWidth(), this.getHeight());
       catch (Exception e){
          System.out.println("BASE64 LOAD ERROR (" + e.getClass() + ": " + e.getMessage() + ")");

  • How to load a tif image in flex

    Hi All,
    Is it possible to load a tif image in flex. If it's possible
    anyone guide me or send me some code snippets regarding how to
    display a tif image in flex.
    Regards,
    Dharma

    "flexdharma" <[email protected]> wrote in
    message
    news:ga2d96$p8h$[email protected]..
    >
    Hi All,
    > Is it possible to load a tif image in flex. If it's
    possible anyone guide
    > me or send me some code snippets regarding how to
    display a tif image in
    > flex.
    Convert it to the much more web-friendly png format.

  • How to load a boot image to cisco aironet 1140 series after missing boot image

    Hi all,
    I need a solution for this. When i switch my cisco aironet 1140 , it s blinking with red light .and gives a message "no boot image to load".
    When i tried next time, by pressing escape it shows this message that i have mentioned below.
    ap:
    ap:
    using  eeprom values
    WRDTR,CLKTR: 0x83000800 0x40000000
    RQDC ,RFDC : 0x80000035 0x00000208
    using ÿÿÿÿ ddr static values from serial eeprom
    ddr init done
    Running Normal Memtest...
    Passed.
    IOS Bootloader - Starting system.
    FLASH CHIP:  Numonyx P33
    Checking for Over Erased blocks
    Xmodem file system is available.
    DDR values used from system serial eeprom.
    WRDTR,CLKTR: 0x83000800, 0x40000000
    RQDC, RFDC : 0x80000035, 0x00000208
    PCIE0: link is up.
    PCIE0: VC0 is active
    PCIE1: link is NOT up.
    PCIE1 port 1 not initialized
    PCIEx: initialization done
    flashfs[0]: 1 files, 1 directories
    flashfs[0]: 0 orphaned files, 0 orphaned directories
    flashfs[0]: Total bytes: 32385024
    flashfs[0]: Bytes used: 1536
    flashfs[0]: Bytes available: 32383488
    flashfs[0]: flashfs fsck took 16 seconds.
    Reading cookie from system serial eeprom...Done
    Base Ethernet MAC address: 28:94:0f:d6:c8:62
    Ethernet speed is 100 Mb - FULL duplex
    The system is unable to boot automatically because there
    are no bootable files.
    C1140 Boot Loader (C1140-BOOT-M) Version 12.4(23c)JA3, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Compiled Tue 18-Oct-11 14:51 by prod_rel_team
    ap:
    So , now my question is how to load the boot image ? From where will we get this ? OR
    I m also having another Cisco aironet 1140 , Can i get bootimage from that . Kindly let me know the solution from genius ?

    Take a look at this link as it should have the info you need
    https://supportforums.cisco.com/docs/DOC-14636
    Sent from Cisco Technical Support iPhone App

  • How to load a background Image on a JDialog object

    Hi All, Actually i am new to java programing and i am stuck in this problem. I am developing a java application which is dialog based (using JDialog objects) and i want to load a background image on my dialog. I hope this could be done and i really appreciate your help because i must deliver this project and this is a user interface requirement.

    Try something along the lines of this: Create a new class called BackgroundImagePanel and have it extend JPanel.
    Have an attribute in the class for your image, and a method to set it.
    Override isOpaque() to return true.
    Override the paintComponenet method as such:
    public void paintComponent (Graphics g) {
    super.paintComponent(g);
    if( image == null ) return;
    Icon icon = new ImageIcon(image);
    icon.paintIcon(this, g, x, y);
    Add this panel to your JDialog and then add other component to this panel.
    You might have to tweak this a bit, but it should get you close...
    Bill

Maybe you are looking for