Using Fx as a library to create and save image

Hi,
I wrote an FX desktop app to create an vector image and saved as png. I would like to use this FX program like a library.
For example, to use it in glassfish managed bean to generate image and saved to a directory. Can this be done? I am wondering how to call FX, pass in parameters, generate and safe the graph WITHOUT firing up as a desktop app.
Just want to use FX to create an image in buffer image, save and return me a link to that image. Java calling javxFX to produced the required image.
I already wrote a working FX. Hopefully it works without having to write another apps to do the job.
Appreciate any help or advise.

This feature is [url http://javafx-jira.kenai.com/browse/RT-14038]planned, but not yet publicly supported. It appears to have been scheduled for Lombard, the version after 2.0. If you need this feature now, there is still a hack available: Image conversion between AWT and FX

Similar Messages

  • Load, create, and save image as thumbnail

    Duke Dollars to earn ... :)
    Hi,
    I want to create a very simple jsp page where I can upload an image through the filechooser and display the uploaded image on the page. When hitting a save button I want to save the image as a thumbnail on the webserver.
    If anyone has suggestions on smooth, clever code that will do this for me, it will be highly appreciated. And answers with code will be awarded.
    Regards
    Malin

    see if this can help you out...
    import com.sun.image.codec.jpeg.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    public class Thumbnail {
    public static void main(String[] args) throws Exception {
    if (args.length != 5) {
    System.err.println("Usage: java Thumbnail inputFileName " +
    "outputFileName width height quality"); //quality 0-100
    System.exit(1);
    // load image from INFILE
    Image image = Toolkit.getDefaultToolkit().getImage(args[0]);
    MediaTracker mediaTracker = new MediaTracker(new Frame());
    mediaTracker.addImage(image, 0);
    mediaTracker.waitForID(0);
    // determine thumbnail size from WIDTH and HEIGHT
    int thumbWidth = Integer.parseInt(args[2]);
    int thumbHeight = Integer.parseInt(args[3]);
    double thumbRatio = (double)thumbWidth / (double)thumbHeight;
    int imageWidth = image.getWidth(null);
    int imageHeight = image.getHeight(null);
    double imageRatio = (double)imageWidth / (double)imageHeight;
    if (thumbRatio < imageRatio) {
    thumbHeight = (int)(thumbWidth / imageRatio);
    } else {
    thumbWidth = (int)(thumbHeight * imageRatio);
    // draw original image to thumbnail image object and
    // scale it to the new size on-the-fly
    BufferedImage thumbImage = new BufferedImage(thumbWidth,
    thumbHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D graphics2D = thumbImage.createGraphics();
    graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
    graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);
    // save thumbnail image to OUTFILE
    BufferedOutputStream out = new BufferedOutputStream(new
    FileOutputStream(args[1]));
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    JPEGEncodeParam param = encoder.
    getDefaultJPEGEncodeParam(thumbImage);
    int quality = Integer.parseInt(args[4]);
    quality = Math.max(0, Math.min(quality, 100));
    param.setQuality((float)quality / 100.0f, false);
    encoder.setJPEGEncodeParam(param);
    encoder.encode(thumbImage);
    System.out.println("Done.");
    System.exit(0);

  • I have a new mac book air and somehow iPhoto was installed twice.  Also, a second library was created and it became the default library.  I attempted to switch to the original library but it won't open.  what can I do to revert to the old library?

    I have a new mac book air and somehow iPhoto was installed twice.  Also, a second library was created and it became the default library.  I attempted to switch to the original library but it won't open.  what can I do to revert to the old library?

    Both iPhotos open to a default library (#2) which has 300+ photos,  I attempted to "switch to library" under the file tab in iPhoto and tried to choose "other library" which had most of my photos.  When I attempt to open it, it doesn't do anything.  I can see it and there are 2 libraries but it won't open.
    Have you tried to open your old iPhoto library by double-clicking it directly, instead of using the File menu?  That should work, if you are running iPhoto '11 and the library has been created by that version or an older version.  DO you get an error message, if you select the library directly in the Finder?
    I checked and it is the latest version of iPhoto.
    Is it iPhoto '11, version 6.0.5? "Latest version" is ambiguous, because it will depend on your system version.
    Where is your iPhoto Library stored?

  • How to create and save playlist using JMF?

    Hello i m new to JMF. Can anyone tell me how to create and save a playlist of media files using JMF.
    also how can i play .DAT files using JMF?
    Does JMF supports AVI,Asf files?

    Hello i m new to JMF. Can anyone tell me how to create and save a playlist of media files using JMF.
    also how can i play .DAT files using JMF?
    Does JMF supports AVI,Asf files?

  • 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

  • How to create and save a file in flex web application ?

    Hi,
          I want to create and save a file form flex web application. Is it possible ?
    I have done some googling and found that its only possible through file referece, which needs some serverside implementation be called.
    Is it not possible with file reference to create and save file directly ?
    Can any one suggest how to over come this.
    Thanks in advance.

    Alex,
    code written with the Flex Builder 3 libraries will certainly run in Flash Player 10. However, what you need is not so much the capabilities of FP10 but the library functionalities of the Flex 4 package. And I think that Flex 4 code will only run in FP10 and not 9 (but haven't tested this as at work we have not yet been permitted to upgrade, so there is not a lot of point going for Flex 4!).
    Richard

  • Is it possible to create and save a .PDF without any compression to the resulting .PDF?

    I need an uncompressed file so I can use the resulting PDF to do a find/replace. Can't do it with compression.
    Thanks
    JDRHC1115

    Dave,
    Thanks for the reply. Of all the suggestions I've received this seemed to
    be most promising. I gave it a try and the problem is that when I attempt
    to save as optimized a message box pops up and says I have to save my
    document first. Low and behold when I save it, compression occurs. Even
    when I select the options you suggest I'm left with a compressed document.
    I'm using Acrobat Pro X
    Jeff
    From:   Dave Merchant <[email protected]>
    To:     Jeff Ross <[email protected]>
    Date:   01/06/2011 09:35 AM
    Subject:        Is it possible to create and save a .PDF
    without any compression to the resulting .PDF?
    You don't want the UncompressPDF plugin - that's designed to split out the
    COS objects but doesn't remove the Flate encoding (plus if you've never
    compiled a plugin before, it's not really the time to learn).
    Instead, simply save your PDF file using the PDF (Optimized) file type,
    click the Settings button and under "Clean Up" - "Object compression
    options", choose "Remove compression". Turn everything else off if you
    want to retain the PDF content exactly as it was before.
    Your document-level scripts will then be in the file as plain text.

  • Create and save custom transition

    Hi, I made a custom transition in FCP using video filters and keyframes and would like to save it to be able to use it again. Is there any way in FCP to create and save transitions? What files actually are the transitions included in FCP?

    I did a search and now I know, that the filters and transitions are written in FXScript languge. For those who're interested, there's an official Apple Using FX Script pdf ( http://developer.apple.com/documentation/AppleApplications/Conceptual/Using_FXSc ript/UsingFXScript.pdf ) and a really nice website with FX Script reference - http://www.fxscriptreference.org/ ...

  • How does APEX create and save new files. What extension does it save in?

    Hi can someone help me with this question?
    How does APEX create and save new files. What extension does it save in?
    Cheers!
    VJ

    It's really too bad we can't see VJ's face when the concept sinks in. This is one of my favorite moments when teaching APEX classes. Most people love it, some people don't. If nothing else it really proves the power and performance of the Oracle database. Each page view can generate 40+ queries, yet on the average system this takes less than .04 seconds.
    Keep in mind there are no undocumented features or "Oracle Internals" that the APEX team uses to achieve this performance, just sound database design. With every feature they add they evaluate how it will be used and design the tables and indexes to most efficiently answer the query. Sometimes this means going against "purist" normalized principals.

  • Using iTunes why can you not backup and save your voicemail?  Guide me through this step by step if possible.  If alternate method MUST be used then provide same.  Truly appreciate this.

    Using iTunes why can you not backup and save your voicemail?  Guide me through this step by step if possible.  If alternate method MUST be used then provide same.  Truly appreciate this.

    Create and delete iPhone, iPad, and iPod touch backups in iTunes - Apple Support  - link doesn't state that voicemail is part of the backup
    iCloud: iCloud storage and backup overview  states that VVM is part of the icloud backup.
    You can also contact your cell phone provider - as voicemail is a carrier feature.

  • How to Create and Save a workbook on Enterprise Portal

    Hi,
    I need to find out how I can create and save a workbook (for a query) in Enterprise portal. Can we save a work book and run it in the same format?
    Thanks

    Hi,
    refer below thread
    Re: How do you save the Workbook as View when the workbook do not have quer
    also see sap help
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/f3fa40badbf36fe10000000a1550b0/frameset.htm
    Thanks

  • SAP Query (SQ01) - create and save queryies

    Hi Expert;
    We wanted to implement SAP query reporting (SQ01) tool, and already developed custom HR infoset and user groups and transported to QAS.  We experienced the problem that we can not directly "save" any queries in SQ01. We pretty much have the client opened up and set at "Changes without automatic recording".  But keep getting a "transport object create" dialog upon "save" query.  But in Adhoc (PQAH), we don't encounter same problem.    We wanted our users be able to create and save any queries directly without creating any local objects. Is there another setting that needs to be set? 
    Thanks for any information that you can provide.  Points will be awarded.
    Helen

    Hello Helen,
    in SQ01 you can save queries like in HR Ad Hoc Query (or Infoset query as it is called outside HR).
    However this is only possible in the "Standard Area" not in the "Global Area". However as Ad Hoc Query is based on the SQ0x basics it only hides this effect.
    If you are doing HR specifics you should consider the documetnation on the special HR switches:
    http://service.sap.com/~form/sapnet?_SHORTKEY=01200252310000076208&
    In general if you are new to the topic you should consider the courses BC407 for Query Basics and HR580 for reporting in HR.
    Also to get a feeling for the different types of reporting with the InfoSet Query you can look at the following documentation:
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/a8/2e7237a323427ee10000009b38f8cf/frameset.htm
    HR Reporting Tools -> Sap Query -> InfoSet Query -> Calling InfoSet Query.
    Or you can book a special training if you need a contact let me know your email adress
    Best regards,
    Michael

  • Create and save a .pdf file

    Afternoon!  I am creating a pdf utilizing the cfdocument tag and it works great.  It opens and displays well.  My question is, is there a way to automatically save that generated pdf on the server without opening it?  My end goal is to run a scheduled task every week that creates and saves a pdf automatically.

    <cfdocument format="pdf" orientation="landscape" filename="YourPDFName.pdf" overwrite="yes">
    it will save a copy of the pdf in the same folder as the <cfdocument> is run from, the problem I got is it wond display the pdf at creation time, all that is returned to my screen is the letter "z"
    so may be best to fun the code in a loop and one time add in the filename and overwrite paramaters, if you dont need it displayed, then your gold.
    Craig Wiseman

  • Part 04 - Creating and Importing Images | Classroom: Basic Site Layout and Navigation in Dreamweaver | Adobe TV

    Learn how to create and prepare images to incorporate into your website design.  Save them in web friendly JPG or PNG formats while maintaining a good balance between quality and small file size. Import them into Dreamweaver and make some initial adjustments to layout and alignment.
    http://adobe.ly/zL64GN

    This third lesson needs to be updated. The "ALIGN" buttons in Properties are now missing in CS6 because it's obsolete in HTML now...

  • My boss cannot create a new subfolder by pressing "new folder" until he's already saved the file to his desktop. A "read only" error appears the first time. Is there a way to create and save to subfolder directly? It's Mavericks/Macbook Pro

    Hi, when my boss wants to save a new file in a new subfolder, he presses "new folder" but cannot create a new one because a “read only” error box appears. Once he saves the file to his Desktop he clicks on “save as” again and then he can create a new subfolder by pressing “new folder.” Is there a way to create and save to a subfolder directly without having to first save somewhere else?

    Your server file handling has nothing, and really nothing to do with Adobe software. If files don't get locked for (over-)writing and/or lose connection to the program opening them, then your server is misconfigured. It's as plain and simple and that. Anything from "known file types"/ file associations not being set correctly, MIME types being botched, crooked user privileges and file permissions, missing Mac server extensions, delayed file writing on the server, generic network timeout issues and what have you. Either way, you have written a longwinded post with no real value since you haven't bothered to provide any proper technical info, most notably about the alleged server. Either way, the only way you can "fix" it is by straightening out your server and network configuration, not some magic switch in Adobe's software.
    Mylenium

Maybe you are looking for

  • To exit from the while(1) loop

    Hi all , I have a simple question that if in a callback function of a command button, i use a While(bLoop) loop , where bLoop is a boolean variable initially set to TRUE, then how can i break or exit from this while Loop by using a control on the fro

  • Cs6 bridge not showing thumbnails for raw file

    Just upgraded to CS6 cs6 bridge not showing thumbnails for raw files. Can see thumbnails in CS5.1 bridge  and LR 4.2 which fortunately i did not uninstall. Bummer since I am up against a hard deadline. Really Sucks

  • Cs6 starting panels and very slow application

    When I start InDesign, the 'starting panels' part of the startup process hangs for some time. After about 2-3 minutes though, the app will load. However, when I'm loaded, switching from one pallette to another (for instance, pages to layers) takes -

  • What is the relation between Smart Card and Java Programming?

    Kindly ingnore the message as this is just a test message by Mihir Mehta

  • Help!!Windows Crashed...iTunes gone Backing up from iPhone?

    Hi guys, My Windows crashed and hence i lost the data from the iTunes Library and the Contacts.I had synced my iPhone to the iTunes before the crash. I got all fixed and now i have a running windows machine with iTunes installed but it does not have