Save a bufferedimage using 1.4

I am trying to save the image I have tried to convert, but I am running 1.3.1. I cannot upgrade to 1.4 to use the ImageIO class. Does anyone know of a way to save the bufferedimage on marked line?
Thanks,
Scott
import java.io.*;
import java.util.*;
import java.net.*;
import java.awt.*;
import javax.swing.*;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
public class testjpg
public static void main(String[] args)
File theFile = new File("C:/make_thumbs/highres/4runner.jpg");
Image img = new ImageIcon(theFile.getAbsolutePath()).getImage();
int iw = img.getWidth(null);
int ih = img.getHeight(null);
System.out.println("Original dimensions height: " + ih + " x " + iw);
BufferedImage bufferedimage = new BufferedImage(iw, ih, BufferedImage.TYPE_INT_ARGB);
BufferedImage bufferedimage1 = new BufferedImage(bufferedimage.getWidth() / 2, bufferedimage.getHeight() / 2, 1);
for(int i = 0; i < bufferedimage1.getWidth(); i++)
for(int j = 0; j < bufferedimage1.getHeight(); j++)
bufferedimage1.setRGB(i, j, con(bufferedimage.getRGB(i + i, j + j), bufferedimage.getRGB(i + i + 1, j + j), bufferedimage.getRGB(i + i, j + j + 1), bufferedimage.getRGB(i + i + 1, j + j + 1)));
// now take the bufferedimage to disk.
//ImageIO.write(bufferedimage1, "jpg", new File("C:/finalfilename"));
// can't use the above as it is too new of a api 1.4 and newer.
static int con(int i, int j, int k, int l)
return ((i & 0xf0f0f) + (j & 0xf0f0f) + (k & 0xf0f0f) + (l & 0xf0f0f) >> 2 & 0xf0f0f) + ((i & 0xf0f0f0) + (j & 0xf0f0f0) + (k & 0xf0f0f0) + (l & 0xf0f0f0) >> 2) + 0xff000000;

java.util.regex.* strongly rely upon some since-1.4 core classes outside of this package, so you seem to have no lack with custom compilation (not to say of license issues).
Use JRegex:
http://jregex.sourceforge.net
Regards

Similar Messages

  • I have a photo album in my apple tv but can't get the apple tv to use it as a screen saver. it is using older photos

    I have a photo album in my apple tv but can't get the apple tv to use it as a screen saver. it is using older photos

    Is this a software or hardware issue? 

  • After I installed the recent Apple security patch, I can no longer save PDFs when using Safari. And Firefox no longer can open website PDFs. Any suggestions?

    After I installed the recent Apple security patch, I can no longer save PDFs when using Safari. And Firefox no longer can open website PDFs. Any suggestions?

    Dansyacht wrote:
    If the previous Safari suggestion doesn't work try the following:
    In Finder, go to Macintosh HD/Library/Internet Plug-ins and move AdobePDFViewerNPAPI.plugin to the Disabled Plug-ins Folder.  Restart Safari.  If this works you may just want to delete that FUBAR plug-in.
    Thanks.  This was the solution for me.
    Message was edited by: tvdowntown

  • Getting prompted to Save As when using Save option

    We would like to deploy Reader XI with Protected Mode enabled. We have noticed that when using the Save option the user receives a prompt to Save As instead. I understand this is a security feature to basically grant Reader/Acrobat permission to save to this location.
    Issue is that we have in house software that opens the PDF using Reader allowing the user to make markups and then save, but if the user saves the file to a different location this will cause the in house software to fail. Older version of Reader with Protected Mode disabled allows just the save to be used and the original file location to be preserved.
    Is there anyway to white list this Directory so that Reader can save to it without a Save As prompt?
    Only fix I know of currently is to disable Protected Mode but we would like to avoid that if possible
    Thanks

    There is a notation in the documentation that may be relevant.
    "Permissions granted by other features often overlap. For example, cross domain policies, internet access settings in Trust Manager, and certificate trust settings for certified documents sometimes interact so that the most permissive setting takes precedence. Users should TEST THEIR CONFIGURATION prior to deployment."
    Have you checked the possible overlapping features?

  • How do I  save and re-use a fillable form once I have created it? It is a form i will use for multiple medcial clients I see, then print out and put in paper chart, and then do it again for another patient. - I just got Acrobat XI

    I've created a fillable form from a Word document, but how do I save and re-use a a fillable form once I have created it? It is a form I will use for multiple medical patients, printing out the filled in form to put in paper chart (no need to save filled out form), and then fill blank form again for another patient? - I just got acrobat X

    Thanks!
    That should also save the blank form for future re-use, right.?
    Can I also file the blank form in the file system, and then retrieve it as a blank form when I have a next patient need for it?
    Thanks
    Michael

  • How do I save preferences/values using javascript in dashboard widget?

    How do I save preferences/values using javascript in dashboard widget? I apologize if this is a stupid question but I simply cant seem to find a way. For example, if on teh back side of the widget teh user chooses the color of the widget, where or how do I save that value so it is retained the next time the user goes to the dashboard. Also, once saved, how do I read the value?
    Thanks a mil....

    Please look into
    /Developer/Examples/Dashboard/Goodbye World/3-Saving Preferences directory for a comple example.
    Otherwise, wait until the following book is published :-))
    http://www.apress.com/book/bookDisplay.html?bID=10173
    Mihalis.

  • Can you change X Pro default settings to save all PDFs using "smallest file size" job option?

    Is there a way to change Acrobat X Pro's default PDF Save settings to use the settings in Distiller's "smallest file size" job options, or adjust Acrobat's default save settings to a close match?

    In Windows you select the printer in the Start>Printers menu and right click to get the properites. You can then go to the settings tab and select the smallest file size job options. When you do it in the printer settings, you have set the default. Be very careful with this choice. It typically reduces the image resolution and embeds no fonts. If you are not distributing the file, then probably not an issue. However, with distribution you risk many folks not being able to read the PDF because of strange characters and low-res image.

  • How to do SAVE AS DRAFT using java mail api

    Hello,
    I want to know how to do SAVE AS DRAFT using Java mail Api.
    thanks

    Hello,
    I want to know how to do SAVE AS DRAFT using Java
    mail Api.
    thanksI don't think you can. That sounds like a feature of a mail client app itself. The Java mail API is for when you're ready to actually send the thing. Saving drafts is storing them somewhere like you would any other data; nothing to do with the mail API.

  • Any trick to save as PDF using Windows 7 and Safari 5.1.7?

    Is there a reason I cannot "Save As PDF" using Safari on Windows 7 / PC?  Version is 5.1.7
    Thanks

    You've tried turning off all firewall and antivirus software ? If that doesn't work then you could try downloading the 5.1.1 update via a browser :
    original iPad
    iPad 2 wifi
    iPad 2 gsm/sim
    iPad 2 CDMA
    iPad 2 new
    iPad 3 wifi
    iPad 3 gsm
    iPad 3 CDMA
    When it's finished downloading, in your computer's iTunes press and hold the shift key on Windows (command key on Mac) when clicking the Check For Updates button which should let you navigate to the downloaded file.

  • Save as option using javascript

    Hi Experts,
    I am try to write code for "save as" option using javascript.
    could you please help me........

    There is no saveas function in indesign javascript, use save function instead,
    var myFolder = new Folder("~/Desktop/Your_Folder");
    app.activeDocument.save(myFolder.fsName + "\\" + "myIndesignFile.indd");
    Vandy

  • How to save .pdf file using office word and excel

    Can someone help me how to save .pdf files using office word and excel?  I reinstalled my adobe 7.0 pro in my new pc and before I was able to do it but with my old pc.

    For anything after Office 2003, you have to print to the Adobe PDF printer. If you installed AA 7 on OS newer than XP, you may have to do a workaround to get it to work. With later versions of WORD you can always use the MS plugin for creating PDFs.

  • What steps do I take to edit raw files and save for web use, such as Instagram, Facebook, Websites, and emailing?

    What Steps do I take to edit raw files and save for web use, such as Instagram, Facebook, Websites, and emailing?

    When you open a raw file it will open in Adobe camera raw. That is where you can do most of the editing. Then it will be placed inside Photoshop where you can do more if needed.
    Now you can use the save for web dialog to export your image as a png or jpg to use on those sites.

  • How do you create and save icc profiles using photoshop?

    How do you create and save icc profiles using photoshop?

    You don't. Color profiles require specific measurement hardware and software.
    Mylenium

  • Cannot save files or use the undo function in InDesign CC

    As of this morning, I am not able to save files or use the Undo function in InDesign CC. Tried many fixes but nothing has worked. I have a ton of work to get done today -- any solutions for this???

    Im viewing this thread because its just happened to me again... my solution is below.
    Im currently running the latest version of  indesign cc (9.2.1) on my brand new 13" macbook pro. (OSX 10.9.4)
    As noted earlier in this thread, when this happens, before you give up and close in frustration,  EXPORT the file as IDML, and your all good!
    Ive had this issue on several occasions using Indesign CC since October. Here are my 2 'Usual Suspects' when this occurs:
    1. culprit: SUITCASE FUSION 5 – deactivate 'auto activation' from within Indesign Prefs. In some cases, i didn't even restart Indesign (much less my computer) for this to work.
    (menu: INDESIGN/PREFERENCES/ SUITCASE FUSION 5 AUTO ACTIVATION PREFS (bottom of submenu list)  Uncheck the top box,  'Auto Activate....')
    Im assuming this was rechecked to auto-activate after an update. Hasn't happened in a while—but sure enough, the auto-activate box was checked again.
    Its a pain having to manually-activate fonts, but its alot easier than redoing a bunch of work!
    2. culprit: CRASH PLAN (online backup)– actually, ive seen this happen with a couple of backup programs. I don't know that this is for sure an issue, but it did resolve the saving issue earlier this year.  I just pause backup for a few hours, then resume. Seems to be ok.
    Steps i took:
    Quit Indesign CC (AFTER EXPORTING the file as IDML!)
    Pause backup within CrashPlan.
    Restart Indesign CC.

  • Screen Saver does not use selected Screen Saver when activated

    Screen Saver does not use selected Screen Saver when activated. After "Start screen saver" elapse time has been reached, a blank black full screen is displayed. I can activate the selected screen saver by using the hot corners function. Any help with this matter will be greatfully received.

    Hi again sassey,
    You're assuming correctly. Simply change the settings so that your screen saver activates before the sleep settings.
    Hope this solves your problem...

Maybe you are looking for

  • ITunes crashes when importing some CDs

    I am running iTunes 6.0.3 on 10.4.4. This latest version of iTunes has improved my ability to import audio CDs, but I still often see crashes of iTunes when importing into MP3 at 160 kbps (I'd imported long ago at 128kbps). I have tried all the thing

  • Does video output to TV still work on iPhone 4?

    Someone told me they heard that you can no longer connect an Apple video cable to the new iPhones to watch videos on your TV. Anyone know for sure? Thanks

  • What are the steps and how to run payroll for a person?

    Hi all, I have hired a person.  Hired with begda 01/01/2009. I have assigned the person to 0001, 0002, 0006, 0008. For this person how can I run payroll? Help me with the steps from begin of employee hiring to the employee payroll run. So that I can

  • Overclocking decisions (Mainly RAM freq.)

    Hello everybody: This is my first post. Hope to come here often and participate whenever I can. First of all, I'm new to this stuff of overclocking, but it is a very interesting subject. I read the sticky posts on this category, but still some questi

  • Routine code in transformation

    Hi all, For filling Info Object ( ZPLANTYPE) , I am  to fetch  from other DSO, for that I have written code in routine please see below , but I am getting this error  like this ''SOURCE_FIELDS-/BIC/ZCARR_ID" is unknown. It is neither in one of please