Hoiw to create a thumbnail image which doesnt refer to the original

I have a large buffered Image, I want to create a smaller version of the image and then release the memory taken up by the larger image
Image smallImage = largeImage.getScaledInstance(size,size,Image.SCALE_FAST);This creates a small image but I think it is just a view over the larger image, how can I create it as standalone so I can release the memory used in the large image.

Yes thats done the trick, code as follows:
private static Image resize2D(Image srcImage, int size)
        int w = srcImage.getWidth(null);
        int h = srcImage.getHeight(null);
        // Determine the scaling required to get desired result.
        float scaleW = (float)size / (float)w;
        float scaleH = (float)size / (float)h;
        System.out.println("Image Resizing to size:"+size+"w:"+w +":h:"+h+"scaleW:"+scaleW+"scaleH"+scaleH);
        // Create an image buffer in which to paint on.
        BufferedImage bi = new BufferedImage(size,size,BufferedImage.TYPE_INT_ARGB);
        // Set the scale.
        AffineTransform tx = new AffineTransform();
        tx.scale(scaleW, scaleH);
        // Paint image.
        Graphics2D g2d = bi.createGraphics();
        g2d.drawImage(srcImage, tx, null);
        g2d.dispose();
        return bi;
BufferedImage newImage = resize2D(origImage, 200);
origImage.flush();
origImage=null;

Similar Messages

  • It is not unusual for me to have a half dozen + copies of a single image. I am not creating these additional images which appear spontaneously myself so system must be  causing them. I have Elements 12 and operating system Windows 7.

    I have Elements 12 and operating system Windows 7. It is not unusual for me to  have a half dozen + copies of a single image. I am not creating these additional images myself, so must be the system. Deleting (including from the hard drive) does not help. Can anyone help please?

    1- The only way for picture files to be automatically added to the catalog is to allow the 'watch folders' option in the file menu and not choosing to have the organizer warn you of any addition. If those files are already in the catalog they should be ignored, only new files should be added.
    2- Otherwise, there is a downloader option to ignore duplicates when you import from camera or card reader to avoid importing several times from the same card.
    The Organizer considers files are duplicate when they have the same 'date taken' and size in Kb.

  • How do I get an image which is larger than the page to scroll?

    I am new to CSS and CS4 and my problem relates to a gif image which is larger than the page.I cannot get the image to scroll either vertically or horozontally. This image is of a family tree graph and I cannot reduce it's size any more otherwise it would not be ledgeable. I want the image to scroll vertically underneath the fixed header. I am using a twoColHybLtHdr template. Also when I have corrected this problem will the CSS then apply to all further pages and could that cause other problems?
    Thanks in anticipation

    Thank you for your advice. I have been adjusting the CSS settings in the Container and the Main Content. I have now achieved both scroll bars, that cover all pages. The problem I have now is getting the Bottom (horizontal) scroll bar onto the bottom of the browser window. If I set the height as auto or inherit then the scroll bar stays at the bottom of the page, so you have to scroll down to find it. I can set the height in px and this is fine for one window resolution but it doesn't automatically reposition for the various different resolutions, is this possible to achieve? Can anyone please help me resolve this last obstacle

  • When playing a slide show there are many nonvisible photos.  They appear as "image cannot be edited. The original is offline."  Where is it and how can I get it back into my photo library?

    How can I get all my images to show in my photo library?  When playing a slide show some of my photos have a message "Image Cannot Be Edited.  The original is offline." 

    What version of iPhoto?
    Are you running a Managed or a Referenced Library?
    A Managed Library, is the default setting, and iPhoto copies files into the iPhoto Library when Importing. The files are then stored in the Library package
    A Referenced Library is when iPhoto is NOT copying the files into the iPhoto Library when importing because you made a change at iPhoto -> Preferences -> Advanced. (You unchecked the option to copy files into the Library on import) The files are then stored where ever you put them and not in the Library package. In this scenario you are responsible for the File Management.

  • After updating my iphone 5s to 7.1 ... the keyboard is crashing and it takes too long to respond, what is the solution? if there any link from which we can download the original 7.1 firmware for A1533 Version?

    After updating my iphone 5s to 7.1 ... the keyboard is crashing and it takes too long to respond, what is the solution? if there any link from which we can download the original 7.1 firmware for A1533 Version?

    Restoring the iPhone will reload its firmware.
    Plug the iPhone into (the current version of) iTunes on your computer.
    Let it sync.  Then choose "Restore" from the iPhone's summary page in iTunes.

  • How to determine which Aperature Library is the original?

    I purchased an Imac a couple of years ago and switched to Aperature to help eliminate duplicates.  I spent time bringing them in a little at a time as not to duplicate.  I have moved what I thought was the master copy to an external drive so that it would not take up all the space.  I show eight copies of Aperature when I click option & then Aperature.  Please help me determine which is the main copy as they all have different version and original numbers.  I am so confused and was just trying to break it down so that I could manage it in even years at a time so that I could organize faces.  Not even really sure what version means as opposed to original.  I hope with some guidence I can finally get this right.  Thank you in advance if you understand where I am coming from

    My short guide here may help you understand the parts of Aperture better, which in turn will help you ask specific questions.
    I advise all users of Aperture to read and understand the first seven chapters of the User Manual -- it's available on-line, as well as via "Help➞Aperture Help" -- as they provide a tour of the interface.
    You are going to have to do some work.  I can tell that you are confused -- Aperture, assuredly, is confusing at first -- but I can't tell what you are asking.  You need to distinguish, in your questions, between the files you imported (Aperture calls these "Originals" after you've imported them) and the Images in Aperture (Aperture refers to these as both Images and as Versions).  Every Image has an Original.  The Original (remember, it's a file) can be stored inside the Aperture Library package, or outside the Library package.  These distinctions are covered in both of the resources mentioned above.
    If nothing makes sense, post back and we'll see how we can help you.
    --Kirby.

  • Forwarded images are much smaller than the original

    Something new has happened. After 10 years of Mail I am just experiencing this phenomenon. When I forward an email with pictures or illustrations attached, the forwarded images are about 75% the size of the original. In many instances that takes the readability away. Does anyone have an idea how I can fix this or what causes it? Thanks.

    What size is set in the New Message widow in Mail?
    Uploaded with plasq's Skitch!
    Regards
    TD

  • I have to create an external defination which can refer the ED of IDOC .

    Hi Expert ,
    I have a scenario in which the source side is idoc and target side is mesaage header + idoc strucure .then we have to send the IDOC XML along with the header field to target .I am facing the problem in creation the target structure . My target strucure is :
    ED_CommonMessage
        <Header>
             <field1>
             < field2>
         <field n>
    </Header>
    <payload>
    <idoc str...>
    </Payload>
    I have created the XSD for header and in that under payload I am refering the IDOC XSD . I have also icluded the IDOC XSD . In Altova its coming fine .   In IR (external defination) i am exporting both the XSD (the IDOC and the Main one) . Again on IDOC ED source I am writng the main ED name also Moreover in the Main ED External Referneces the name of IDOC ED is also coming . But when in message mapping  I am opening the Main ED then the idoc structure is not coming there .only the idoc name is coming other details are missing.
    PFA the XSD which I am importing as Main ED.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mns="marksspencer.com/is/2009/schemas/envelope/" targetNamespace="marksspencer.com/is/2009/schemas/envelope/" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:include schemaLocation="BLAORD_BLAORD03_ZMDE_BLAORDEXT01.xsd"/>
         <xs:element name="MnSDocument">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="mns:Header"/>
                        <xs:element ref="mns:Payload"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Header" type="mns:HeaderType">
              <xs:annotation>
                   <xs:documentation/>
              </xs:annotation>
         </xs:element>
         <xs:complexType name="HeaderType">
              <xs:sequence>
                   <xs:element name="MessageId" type="xs:string">
                        <xs:annotation>
                             <xs:documentation>A unique identifier of the message provided by source application and should be of format.  Format should be "SourceSystemName-SystemDefinedUID"</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="CorrelationId" type="xs:string" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation>Application defined correlation id - used for request response interfaces only</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="CreatedTimestamp" type="xs:dateTime">
                        <xs:annotation>
                             <xs:documentation>The timestamp of when the message was created</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="SourceApplicationName" type="xs:string">
                        <xs:annotation>
                             <xs:documentation>Name of the sending application</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="InterfaceId" type="xs:string">
                        <xs:annotation>
                             <xs:documentation>Reference to the RICEF IRI value assigned to the interface</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="InterfaceName" type="xs:string">
                        <xs:annotation>
                             <xs:documentation>Reference to the name assigned to the interface in the RICEF.</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="PayloadName" type="xs:string">
                        <xs:annotation>
                             <xs:documentation>Name of the payload type present in the message.</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="BatchMessageCount" type="xs:int">
                        <xs:annotation>
                             <xs:documentation>Number of GBOu2019s or Common Data Models present within the message.</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="BatchRecordCount" type="xs:int">
                        <xs:annotation>
                             <xs:documentation>number of individual business records within the batch e.g. total number of purchase orders.</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element ref="mns:IntegrationExtension" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation>extension area for the integration processing only</xs:documentation>
                        </xs:annotation>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="IntegrationExtension" type="mns:IntegrationExtensionType">
              <xs:annotation>
                   <xs:documentation/>
              </xs:annotation>
         </xs:element>
         <xs:complexType name="IntegrationExtensionType">
              <xs:sequence>
                   <xs:any minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="Payload" type="mns:PayloadType">
              <xs:annotation>
                   <xs:documentation/>
              </xs:annotation>
         </xs:element>
         <xs:complexType name="PayloadType">
              <xs:sequence>
                   <xs:element ref="mns:ZMDE_BLAORDEXT01" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>
    Regards.
    Saurabh Sharma

    Hi Saurabh,
    What is your target sytem?
    And how you fill up the below header fields in target structure, I mean will they have fixed values or dynamic.....
    <Header>
    <field1>
    < field2>
    <field n>
    </Header>
    Regds,
    - Gujjeti.
    Edited by: Praveen Gujjeti on Mar 19, 2009 3:25 PM

  • Creating a dropdown list which is depending on the selections from 2 other dropdown lists

    Hi,
    I'm new to LiveCycle and JavaScript and I was hoping someone could help me with this form I am creating.
    This is what I want it to do:
    I have a dropdown list named 'Area' which drops down to 3 options.  Once the form filler selects an area, they will then select an option from dropdown list 2 which is named 'Brand'  (there is up to 5 options), I then I want dropdown list 3 named 'Address" to have all of the address of the area and brand selected.
    Is this possible?
    Thankyou for your help!!

    Hi,
    here is an example for three dropdowns with dependencies.
    You have to copy this code in the change-event of the fist dd:
    Number and Letter are the entries in my example in the first dd. You have to adapt to your entries. Then you have your object names change in the script.
    DropdownListe2.addItem("123"); - this phrase you could use several times (in your example 5x for the second dd)
    switch (xfa.event.newText)
        case "Number":
            DropdownListe2.clearItems();
            DropdownListe3.clearItems();
            DropdownListe3.rawValue = null;
            DropdownListe2.addItem(" ");
            DropdownListe2.addItem("123");
            DropdownListe2.addItem("456");
            DropdownListe2.selectedIndex = 0;
            break;
        case "Letter":
            DropdownListe2.clearItems();
            DropdownListe3.clearItems();
            DropdownListe3.rawValue = null;
            DropdownListe2.addItem(" ");
            DropdownListe2.addItem("A");
            DropdownListe2.addItem("B");
            DropdownListe2.selectedIndex = 0;
            break;
        default:
            break;
    This code you have to copy in the change-vent from the second dropdown:
    switch (xfa.event.newText)
        case "123":
            DropdownListe3.clearItems();
            DropdownListe3.addItem(" ");
            DropdownListe3.addItem("123_aa");
            DropdownListe3.addItem("123_bb");
            DropdownListe3.selectedIndex = 0;
            break;
        case "456":
            DropdownListe3.clearItems();
            DropdownListe3.addItem(" ");
            DropdownListe3.addItem("456_aa");
            DropdownListe3.addItem("456_bb");
            DropdownListe3.selectedIndex = 0;
            break;
        case "A":
            DropdownListe3.clearItems();
            DropdownListe3.addItem(" ");
            DropdownListe3.addItem("A_1");
            DropdownListe3.addItem("A_2");
            DropdownListe3.selectedIndex = 0;
            break;
        case "B":
            DropdownListe3.clearItems();
            DropdownListe3.addItem(" ");
            DropdownListe3.addItem("B_1");
            DropdownListe3.addItem("B_2");
            DropdownListe3.selectedIndex = 0;
            break;
        default:
            break;
    Here you will find an example:
    https://workspaces.acrobat.com/?d=WjPa976zd1Ekdahx9r9kUw
    Hope it will helps you,
    Mandy

  • How to get rid of an image which is stuck to the background of the phone screen.

    while i was watching  a youtube motions suddenly all stopped and the picture stuck hindering all the operation such as phoning or checking the addresses.........how can i do?

    Hello sapho and welcome to the BlackBerry Support Community Forums.
    Have you done a device reboot yet by pulling the battery? If not, remove and reinsert the battery to reboot.
    If you are still having this issue after the reboot you will need to reinstall your device software.
    Backup your device data and follow the steps in KB11320 and check your browser before restoring your data.
    Let me know how you make out.
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • If i plug my ipod into my new mac which doesnt have all the music that i previously put on my iPod, will i lose all that music if i sync with the new music on my itunes?

    my old computer crashed a while ago, before i was able to transfer my music to my new mac.....i have all the music on my ipod but im worried that ill lose all my music when i sync it with the itunes and new music. i know the purchased items will get transferred but im worried about losing all the other music?

    Follwo these instructions to not lose anything
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • Directory (original) got created and I now want that information in the original desktop file - how do I do this?

    Bad migration up from Snow on a MacPro to Maverick on a Mini so am trying to revert back to Snow on my MacBook Pro.  Along the way, Maverick created a second file called Desktop (original) which I'm stuck with back in Snow on the MacBook Pro.  The regular Desktop file is emply and I'd Like to repopulate it with the contents from the Desktop (original) file, then discard that file. 
    Also, when I got done with the mess, I've been shorted in the MacBook Pro Snow my email files for the years 2011-2014.  I can locate them in Maverick but getting them out has been been tough. HOWEVER, I still have those same files on my older MacPro Snow comupter and need to know the best way to transfer them from the Old Snow Pro computer to my newer Snow BookPro computer.  Hookups and additional hard disks to assist aren't a problem it's just the formatting that has to be done to keep all smooth.  In other words, I think I have the hardware covered, it's just the software movements I'm concerned about. Thanks.   Baronial

    You can reset the action Firefox is set to use for certain file types - we have 2 KB articles explaining how to reset these settings:
    [[Managing file types]] (section "Changing download actions")
    [[Unable to download or save files]] (section "Change file type settings")
    Please let us know how above works out, and if we can be of further assistance.

  • What does image cannot be edited. The original is offline.

    I was trying to edit a photo in an album and got an error message in right panel: Image Cannot be Edited; Original is offline.  What does that mean?

    Is it just one photo, several or all?  Check iPhoto's Advanced preference pane to see how it's configured:
    If you find you're running a Referenced library the missing originals may be gone for good.  You can search for them by name (from the thumbnail) on your hard drive to see if they are misplaced.  I'd download and use  Find Any File for that as it can search areas that Spotlight can't.
    If it's only one or a couple select the thumbnail of one of them and use the File ➙ Show in Finder ➙ Original menu option to take you to where the file should be inside the library.  This is just to confirm that it's not there. 
    OT

  • I have a replacement Note 3.  My Vodafone SIM, which worked fine in the original, fails in the replacement.  When I try to access Settings, the menu briefly flashes, then the phone reverts to the home page.  Will a Factory Data Reset fix this?

    Hi,
    I have a Note 3 and a Vodafone SIM that are not playing well together. 
    The history is:
    I got my Note 3 over 2 years ago.  We visited Italy 2 years ago and I bought a Vodafone sim at a Vodafone outlet.  Everything worked perfectly during that trip and a subsequent trip to France.
    Last October, I had to replace the Note 3 because the camera was failing.  I had insurance, so the insurance company sent me a refurbished Note 3. When I tried to use the SIM last December, the Note 3 had problems. When I put the SIM in and started the Note 3, the phone recognized the sim (but gave me an error that, according to Verizon, is spurious).  I could make phone calls but I could not access the data network.  In order to access the data network, you have to go into Settings. More Settings, Mobile Networks and set the Access Point Name.
    With the replacement Note 3, I cannot access Settings.  As soon as I try to access Settings (with the Vodafone SIM installed), the Settings menu appears and then immediately the home screen comes up.  After working with Verizon for over an hour, I was able to get into Settings and set the access point name by booting into Safe mode.  But as soon as I rebooted into 'normal' mode, Settings failed and I could not access its menu (to turn on wifi, for example).  There are a couple of other apps that did the same thing - but I cannot remember which ones.
    I have talked to Vodafone - they have no clue.  I talked to a Samsung rep I ran into at Best Buy, he thought the Vodafone SIM might be corrupted.  And now a Verizon tech I talked to last week thinks it is a firmware problem on the phone and I should do a Factory Data Reset.
    Have you ever heard of this problem?  What do you think might be causing it?
    Thanks for your help.

    On2CO,  I'm glad you have reached out to us today. Thank you so much for the very detail description on what is going on with the device. Sounds like there might be an issue with an application that might be causing these issues. The reason I say that is, when the phone is in Safe Mode you are able to access the Settings screens with no issues. While in Safe Mode that does block all 3rd party applications from running on the phone. I would suggest on trying to back up the device and perform a factory reset: http://spr.ly/6-182Vuo (you would want to make sure to uncheck Automatic Restore in step 3). Once the reset is complete try to see if you can get into Settings. Then, I would recommend on adding 3rd party applications back on to the device one by one to see if we can find what app might be causing this issue. Please keep us posted if you have any further questions or concerns.   KevinR_VZW Follow us on Twitter @VZWSupport If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • Hi, I have a mac, and all my music i put into imovie 11 used to play but now it doesnt. All the original sound on the videos play fine, its just the music.Can anyone help its rly urgent cz i need it for an assignment tomorrow

    All the music used to play but not anymore please can i have some help??

    I have the same problem now. It used to play the music when I emailed or post on Youtube.
    It only plays in the  Trailer now.
    Also I can not find the movie I created in my events anymore. I can only see it on Trailer. How can I get it on my event, If I want to edit the movie?

Maybe you are looking for

  • "Field Catalog not found" ...problem in ALV reporting !!

    Hi, When i execute my report program where in I generate a Selection screen, I am able to select the values in the selection screen. Once I click on the execute button I get the message "Field Catalog not found"... The elabore message is "Field Catal

  • HP Laserjet 1320 and OS 10.4.4

    Ok, my print queue keeps stopping the job. I have downloaded the latest drivers, reset the print system, rebooted, restarted the printer, tried a different USB cable, even tried a different 1320 all to no avail. HELP! I'm about to pull my hair out.

  • Lenovo Twist - How do you copy Win 8 Pro onto recovery partition?

    I upgraded my Lenovo Twist (3347-4HU) from Win 8 to Win 8 Pro with Windows Media Center (WMC).  How do I copy the newly purchased operating system and WMC to my HDD recovery partition so that if I ever have to do a restore, it will restore Win 8 Pro

  • How to find EOF in BPEL File adapter

    Hi All, I am using file adapter in BPEL(SOA 11G) to read a csv file. The CSV file is very large so we have are processing the files in batched of 20000 records.I am inserting the records form CSV file to a staging table and after that I am invoking a

  • Win32 API to get cluster List from domain

    Hi ,   we are using NetServerEnum API to retrive the list of cluster from domain. But it failed with error 2127 on windows 2008 server and the cluster /list command also failed with same error. But if we pass domain name to cluster .exe then it works