Forcing an image to be cached

my images are cached only after the second time they're drawn. that first, not accelrated render causes a little pause in my app.
is there a way by which i can make the image cached already before it's first appearance?
i know i can do if i use a VM argument that sets the accel threshold to zero, but that is not what i want, since it only works for d3d, and i don't want to add more vm arguments beside the one that enables opengl...

That doesn't work (it doesn't force the image to re-render).
The only way I managed to get it to work is create a dummy image using CreateImage(), get a Graphics object from it, and ImageIcon.paintIcon() the image I want to re-render into the dummy image. Still, it seems like a waste.
If you find another way, please let me know.

Similar Messages

  • Is there a way to view images in your cache?

    Is there a way to view images in your cache?

    Not sure what you mean.
    Do you want to increase the limit because i don't think there is a limit. If there is tell me cause i don't no. I no you can do the opposite.
    http://www.macupdate.com/info.php/id/10482

  • How to force write-behind store on cache node shutdown?

    Hi,
    I built a small pilot project based on Coherence and now I test it for failover. I found replication issues with Distributed cache in the following scenario:
    - start cache node 1 (JVM instance 1);
    - connect Extend client to it and get 1 object from cache (only 1 object in the cache - loaded by CacheStore from DB);
    - change the object and put it back (I use EntryProcessor for this);
    - start cache node 2 (JVM instance 2);
    - stop cache instance 1 (write-behind store wasn't invoked yet: write-delay = 2m);
    - load/change the same object on node 2; all changes done on node 1 are lost.
    My expectation was that cache will replicate its data between nodes when new member joins cache cluster. The backup count = 1 by default, right?
    What should I do in order to prevent such behavior? Is it possible to force write-behind store on cache node shutdown event?
    Thanks, Denis.
    My cache-config, just in case:
    <cache-config>
    <caching-scheme-mapping>
    <cache-mapping>
    <cache-name>AccountCache</cache-name>
    <scheme-name>account-distributed</scheme-name>
    </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
    <distributed-scheme>
    <scheme-name>account-distributed</scheme-name>
    <service-name>DistributedCache</service-name>
    <serializer>
    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
    <init-params>
    <init-param>
    <param-type>String</param-type>
    <param-value>account-pof-config.xml</param-value>
    </init-param>
    </init-params>
    </serializer>
    <backing-map-scheme>
    <read-write-backing-map-scheme>
    <scheme-name>AccountDatabaseScheme</scheme-name>
    <internal-cache-scheme>
    <local-scheme>
    <!--scheme-ref>default-eviction</scheme-ref-->
    <eviction-policy>LRU</eviction-policy>
    <high-units>0</high-units>
    <expiry-delay>30m</expiry-delay>
    </local-scheme>
    </internal-cache-scheme>
    <cachestore-scheme>
    <class-scheme>
    <class-name>com.roox.bss.cache.store.AccountCacheStore</class-name>
    <init-params>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>dburl_</param-value>
    </init-param>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>user</param-value>
    </init-param>
    <init-param>
    <param-type>java.lang.String</param-type>
    <param-value>password</param-value>
    </init-param>
    </init-params>
    </class-scheme>
    </cachestore-scheme>
    <write-delay>2m</write-delay>
    <write-batch-factor>.5</write-batch-factor>
    </read-write-backing-map-scheme>
    </backing-map-scheme>
    </distributed-scheme>
    <proxy-scheme>
    <service-name>ExtendTcpProxyService</service-name>
    <thread-count>10</thread-count>
    <acceptor-config>
    <tcp-acceptor>
    <local-address>
    <address>localhost</address>
    <port>9098</port>
    <reuse-address>true</reuse-address>
    <reusable>true</reusable>
    </local-address>
    </tcp-acceptor>
    <serializer>
    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
    <init-params>
    <init-param>
    <param-type>String</param-type>
    <param-value>account-pof-config.xml</param-value>
    </init-param>
    </init-params>
    </serializer>
    </acceptor-config>
    <autostart>true</autostart>
    </proxy-scheme>
    </caching-schemes>
    </cache-config>

    solved with autostart=true

  • How does one force an image to a defined color palette?

    I'm trying to limit the colors displayed in an RGB image but I'm not sure how to go about doing. I have a palette of 454 colors (so indexed color is not an option) and I would like to force my image to that color space. This may seem like an odd request, but there's actually a (theoretically) logical reason for it: in a nutshell, I have a swatch palette that corresponds to colors of a particular brand of thread and I want to fit the image's colors to the nearest thread color. While I might be able to do that by eye, I have 454 choices to choose from (laborious!) and I'd prefer to automate the process by letting Photoshop's adaptive color conversion algorithms do their magic.
    Or am I overlooking something obvious?
    I appreciate any suggestions or assistance!

    Charles,
    I went ahead and cobbled together a script from other's code to generate a directory full of 100x100 72dpi jpg swatches from a CSV list of names, R, G, and B values. I fed the 454-file directory to MacOSaix and I'm letting it do it's thing. Thanks for the suggestion!
    I doubt it will be of any value to anyone, but here's the script, just in case:
    #target Photoshop
    function main() {
         if (isOSX()) {
              var csvFile = File.openDialog('Select a CSV File', function (f) { return (f instanceof Folder) || f.name.match(/\.csv$/i);} );
         } else {
              var csvFile = File.openDialog('Select a CSV File','comma-separated-values(*.csv):*.csv;');
         if (csvFile != null) {
              fileArray = readInCSV(csvFile);
              var columns = fileArray[0].length;
              //alert('CSV file has ' + columns + ' columns…');
              var rows = fileArray.length;
              //alert('CSV file has ' + rows + ' rows…');
              if (columns == 4 && rows > 0) {
                   generateSwatches(csvFile);
              } else {
                   var mess = 'Incorrect CSV File?';
                   isOSX ? saySomething(mess) : alert(mess);
         } else {
              var mess = 'Ooops!!!';
              isOSX ? saySomething(mess) : alert(mess);
    main();
    function generateSwatches(csvFile,directory) {
         var docRef = app.documents.add();
         with (docRef) {    
    //         for (var i = unusedSwatches.length-1; i >= 0; i--) {
    //              unusedSwatches[i].remove();
               var directory=csvFile.path;
              for (var a = 0; a < fileArray.length; a++) {
                   var filename = fileArray[a][0] +".jpg"; // First Column is name for file                     
                   r = parseFloat(fileArray[a][1]); // Second Column is Red
                   g = parseFloat(fileArray[a][2]); // Third Column is Green
                   b = parseFloat(fileArray[a][3]); // Forth Column is Blue
                   if (r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255) {
                        SaveJPEG(filename, directory, r, g, b);
                   } else {
                        var mess = 'Color values are out of range?';
                        isOSX ? saySomething(mess) : alert(mess);
    function readInCSV(fileObj) {
         var fileArray = new Array();
         fileObj.open('r');
         fileObj.seek(0, 0);
         while(!fileObj.eof) {
              var thisLine = fileObj.readln();
              var csvArray = thisLine.split(',');
              fileArray.push(csvArray);
         fileObj.close();
         return fileArray;
    function saySomething(stringObj) {
         var speakThis = 'say "' + stringObj + '" using "Fred"';
         app.doScript(speakThis, 1095978087); // AppleScript
    function isOSX() {
      return $.os.match(/Macintosh/i);
    function SaveJPEG(filename, directory, r, g, b){
          // create doc
       app.preferences.rulerUnits = Units.PIXELS
       var doc = app.documents.add(100, 100, 72, filename,);
        // define your fill color
       var color = new SolidColor();
       color.rgb.red = r;
       color.rgb.green = g;
       color.rgb.blue = b;
       var imagefile = new File(directory+"/"+filename);
       jpgSaveOptions = new JPEGSaveOptions();
       jpgSaveOptions.embedColorProfile = true;
       jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
       jpgSaveOptions.matte = MatteType.NONE;
       jpgSaveOptions.quality = 12; //JPEG quailty (1-12)
          // fill layer
       doc.selection.selectAll();
       doc.selection.fill(color);
        activeDocument.saveAs(imagefile, jpgSaveOptions, true ,Extension.LOWERCASE);
       // close document
       doc.close(SaveOptions.DONOTSAVECHANGES);
    (Is this overkill and wildly unnecessary? Of course it is.)

  • How can I force an image to open fully on screen within action?

    In PS CS5 when I open an image with height dimension in range of 1405-1411 or 1873-1882, the image opens half off the bottom of the screen.  Width does opt seem to matter.  
    I assume this is a bug, but until fixed I am trying to work around.
    For manual editing the vertical fit screen button or zooming out causes the image to come on screen, but is neither of these display options will record in an action. 
    When an image is opened half off screen, a Place command does not place accurately for these images.  Thus an action that includes a Place does not run correctly for these images. 
    So either I want to find a setting (nothing in preferences that I can find) to force the image to open on screen, or find a command that will run in an action that causes image to come on screen, while not interefering with images that open normally.                     

    The insert menu item command, which I had overlooked (perhaps because it is grayed out to virtual invisibility until action is actively recording), solved the problem.
    Thanks.
    FYI I had tried all the screen mode options.  Made no difference.  
    Also FYI a screenshot.  A little less than 1/2 of the image is off screen

  • When i put firefox in offline mode, and then click on pages saved in history , it can't load any pages or any images. i put cach size to 250mb but the problem is the same, it saves history for two months, but can't load pages.

    when i put firefox in offline mode, and then click on pages saved in history , it can't load any pages or any images. i put cach size to 250mb but the problem is the same, it saves history for two months, but can't load pages.

    Hi there,
    When I inspect your site in browser tools, I'm getting 404 errors from your page:
    [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (jquery-2.0.3.min.map, line 0)
    [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (edge.4.0.0.min.map, line 0)
    BarnardosIreland wrote:
    I would have thought that publishing should give a complete package that doesn't need any further edits to the code and can just be directly ftp'ed to the web - is this correct?
    In general, you are correct - but also your server does need to be properly configured (and those errors above lead me to think it may not be) to serve the file types that your uploading - but it could be something else entirely. Can you zip up your composition folder, upload it to your Creative Cloud files, set it to share, and then post a link here so I can download it? If you'd rather not share it publicly, can you PM me with a link to your composition files?
    Thanks,
    Joe

  • HELP: Images in Library/Caches/Desktop

    I REALLY have to recover an image which I believe is now in the folder Library/Caches/Desktop/ and has ".dpCache" as extension (and don't know how it got there since it was regularly on my desktop and disappeared from anywhere else in the computer). I read a post in the forum dated two years ago, where somebody said it's impossible to recover such files. But this photo is very important for my job. I was wandering if somebody out there knows of any new way, developed in these last two years, of opening up and saving these items. If you do, please be "simple", I'm not an expert!
    THANK YOU!
    Viva
    (if i'm in the wrong section of the forum
    please redirect me...thanks again!)

    it's impossible to recover an image for a cache file like that. your only hope (since you clearly don't have a backup) is data recovery software like Data Rescue II or FileSalvage.

  • Page-embedded Javascript and uploaded images are not cached.

    Hello All,
    I was reading in Wiki APEX and I found this line mentioned as cons: "Page-embedded Javascript and uploaded images are not cached".
    The question that I have posted many questions here how to enable the cache for Images and Javascripts but didn't get it right, is the wiki info right about the cache for images and JS?
    thanks,
    Fadi.

    Look at the bottom of this page as well [http://carlback.blogspot.com/2007/12/apex-and-3rd-party-js-libraries.html]
    Patrick Wolf
    Carl,
    the only drawback with #WORKSPACE_IMAGES# and #APP_IMAGES# is that it doesn't get cached by the browser. So each page request will transmit the hole file again. A caching option for the "Static Files" in the Shared Components would be nice :-)
    About lazy loading with the #WORKSPACE_IMAGES#. I could think about a mod_rewrite rule which translates the additional file request of the JS library into a valid request for APEX.
    Carl Backstrom
    In 3.1 we emit a last modified header now for uploaded files so that should help with browser caching.
    I wonder if anything's changed since then.
    Kofi

  • Forcing a browser to ignore cache and display current version of a page

    I just uploaded some revised pages to my site. When I went to view them online, the older pages displayed instead of the new ones - since the older ones were in my browser cache (same thing happens in both I.E. and Firefox).  Going into I.E.'s Tools menu and deleting Temporary Internet Files  fixes the problem on my machine, but if Joe Blow viewed my site recently, then checks again today, he's seeing the older versions - correct?  So my question is, is there something I can do to my pages to force browsers to always display the latest version? Or is this something that can only be done locally by a visitor to the site (who, of course, won't have a clue that he's looking at an obsolete page and needs to delete his cache)?

    no-cache meta tag has been around for a long time and may be that's enough for some cases, however it's worth noting:
    It's not a "right" approach and therefore this meta tag is not a valid HTML5 (and should fail when you validate)
    Therefore browsers may/should ignore it (although it may still work) 
    It will not prevent caching other than at the browser level, i.e. you still receive a cached copy from proxy servers
    All other dependent files (scripts, styles, images etc) will still be cached
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • How can I recover images from my cache after firefox has dumped or overwriten them?

    I am well versed in how to extract image sfrom my browsre's cache. My cache is toggled to allow 50MB of storage space. What happens to the files that are cleared after this limit has been reached? Can I recover data i.e. photos, that has been lost in this way?

    If Firefox is forced to remove something from the cache in order to store something else, it is overwritten. I doubt that trying to recover that file will succeed.

  • Any way to retrieve this image from my cache? When saved it only saves as a 1.7KB blank file.

    I'm trying to retrieve an image from Firefox's cache but so far have had no luck in doing so. The picture was hosted on imageshack and I had it open in a window but when I refreshed the page several hours later it was gone. I refreshed the page several more times, tried messing with the url to see if that did anything, but no luck. I haven't cleared anything on Firefox so I'm hoping there's some way I can recover it from the cache.
    I followed the instructions on this page: http://groups.google.com/group/mozilla.support.firefox/msg/73bab3fb55ac5b42
    However, when I right clicked the URL and chose "Save Link As..." it only saved a 1.7KB file that none of my photo editing programs can recognize or open. I've tried going to cache entries for other image links and saving them and when I choose Save Link As for those they save just fine, and in full size, so I'm not sure why this one won't work...I'm using Offline Mode so I'm not sure why the picture no longer being hosted online should make a difference one way or the other. I'm just hoping that my act of refreshing the page and nothing being there didn't overwrite the cache file and thus erase the cache'd image.
    So is there any hope of retrieving this picture or is it gone for good?

    Hi.
    Once the image in question is replace with another one, the old one is erased. That is to say, if you open an image, say www.domain.com/image.png, and it's a 200x200 image, then you close it, it's still on cache, and you can access it through the cache. But if the image is changed in the server, that same exact url, and you access it again, at you see a 250x200 image (just an example), then the 200x200 is gone forever.
    Your hope is that you never accessed the same URL again, so the old cache wasn't erased. If you know the url of the image, simply select offline mode (File > Work Offline, I think) and access its url. It will load the cached version and not check for the online one. Only if there is a cached version, of course.
    I hope this helps.

  • Open original image instead of cached image

    While the title in itself is rather self explanatory, I'll elaborate somewhat. The current state of opening sent images means opening the cached version - the file name is wrong in that case, and often times the cached image is in wrong format or size, perhaps even compressed too much; Which might not be the preferable action for a large number of people. Could we possibly get a toggle in Options, or even default left-clicking images to opening the actual image, rather than the image cache?

    Hi Gramps,
    Sorry for this late response. I tried the method you pointed to, but it did not work properly, but I got to doing what I wanted to by changing the .css for the classes and also making a new class in the SpryValidationTextField.css etc.and then applying it in the source code among the span tags.
    I have a new question, but will post it separately.
    zabberwan

  • Not able to retreive Images stored in cache directory of android device

    Hi,
         I have created a ADF mobile application where in I invoke getpicture to utilise the camera feature. The images taken are getting stored in cache folder of the application ./data/<app name>/cache
    .Using the ADFmf utilities , i am able to navigate to that folder and when i try to read or copy the images  it is failing
    1234434.jpg (No such file or Directory).
    Can anyone help me resolving this issue.

    I tried changing the directory  as following in java class:
    File trgDir = new File("/tmp/myTarget/");
    File srcDir = new File("/tmp/mySource/");
    FileUtils.copyDirectory(srcDir, trgDir);
    but unfortunately  Adf mobile application does not support "File Utils. copy Directory" library
    so is there any way to circumvent this problem.
    Any help would be appreciated 

  • Force open images in new tab instead of downloading it.

    Some webpages force download of images either with change of the image mime type or (I think) with javascript.
    Is there any way to force all jpg/png/gif files to open in new tab when given a direct link to it.

    Sounds that you have previously set an automatic download action for the application/force-download MIME type.
    *http://kb.mozillazine.org/File_types_and_download_actions
    *https://support.mozilla.org/kb/Managing+file+types

  • WD ALV: Image in server cache does not appear in Excel

    Hello WD Experts!
    I have a Web Dynpo ALV table with material master data. One column contains the image of the product or a "sorry, no picture" image, if no specific material image exists.
    The images are not available as MIME objects, hence I load the images from an external source and push them into the server cache using the method cl_http_server=>server_cache_upload( ... ). The lifetime for the cache is defined with 600. The "sorry, no picture" -image is a MIME object.
    All works fine... except for the download to Excel. Only the "sorry, no picture" -image appears. The others gets replaced by a placeholder icon which looks similar to those frequently seen in emails or slow web pages.
    Why don't the cached images get downloaded to Excel???
    Best Regards
    Bodo

    Has to be programmed manually because WD ALV does not read from server cache

Maybe you are looking for

  • LCM in SAP BO 4.0 Webi not using new Universe version

    Hi I am trying to use LCM in SAP BusinessObjects 4.0 sp5. After moving a universe from a development server to a production server using LCM (promotion management) everything seems to work as advertised: connections stay the same on my production box

  • Error when publishing report to remote crystal 2008 server

    In attempting to publish a report to a remote crystal server (see code below) I get this exception.  Since the server is on a remote host, it doesn't make sense to me to set the BOBJHome property or pass the file path.  This is why I am using the add

  • Form to send e-mail

    Hello! I wonder if someone could help me with the following. I am developing a form , and all the data entered in that form will be sent to different people , depending on the information of the form. The way that I have done it is with an html form

  • Why does my iPad keep losing the Internet?

    I keep having to reboot my iPad as it keeps on dropping its connection to my wireless network. Other devices, iPhone, laptop etc don't have this problem so I don't think it is a problem with the network, can anyone help?

  • Having problems trying to make a DVD off a footage I shot....

    Hello folks, I shot a footage of my cousin's baptism, now I am imported everything in Imovie HD, what it does on the right side it cuts all the clip so what I do is take all these clips put them in the timeline... now let's say I just want to burn it