Creating screenshot without using BufferedImage?

Hi all java gurus!
I'm almost wrecked by searching for a solution for the following problem:
I have a JPanel with some graphs and text on it, drawn by paint(...) method.
So far so good.
Now I want to print this panel. No problem, as long as I print the panel content directly via paint(..) method to printer.
But in my case I need to create a screenshot of this panel (because I wrote a multiple-page-print-preview-dialog controlled by a script language and java objects to print).
I did it by using a BufferedImage object, got its Graphics object and used paintAll(...) to draw the panel to image. Works great!.
But now I get into trouble: To print that image I need to scale it (mostly by factor 0.65), but BufferedIamge objects are of very low resolution so that the printing looks absolutely ugly. Even when I switched on Antialiasing, the result is absolutely not readable.
I also tried to pass the complete JPanel object to printer, but every of the three printers layed it out differently...!!!???
Is there another object that allows higher resolution?
Or is there a way to store a jpanel directly and with high resolution into a jpeg file??
I have no more ideas and was looking all around the (internet)world for a solution since 1 week, but never found anything that fits/solves my problem.
Best regards and thnx for any inspiration
Thoto

i am doing exactly same as you, i used BufferedImage as well, but i dose not face the problem as you.
my method to save as JPeg on JPanel is as follow:
public void saveAsJpeg(int quality, String path){
     BufferedImage bi = new BufferedImage(this.getWidth(),this.getHeight(),BufferedImage.TYPE_3BYTE_BGR);
     Graphics g = bi.getGraphics();
     this.printAll(g);
     JPEGHandler.saveJPG(bi,(float)quality/100, path);
if possible, u may send me the codes to help u
[email protected]

Similar Messages

  • How to create links without using widgets

    I am using a vertical menu via the widget, but want to create a submenu without using the widget. btw, the rollover feature is fun

    To create a sub menu without using the sub menus in the menu widget you can combine the menu widget and the tooltip widget to create your menu.
    There is plenty of examples and widgets that do what you are asking if I understand correctly at the Muse exchange and places like musegrid.com.

  • Help required to create portal without using any vendor specific API's

    Hi All,
    I am trying to develope a portal without using any vendor specific API or tool like Weblogic workshop or Vignette Wizard. I would like to know whether Sun Microsystem provides any API for developing portal. I would also appreciate if I can get few links for developing portal using java API's...
    Thanks in advance...
    Dgk

    Sure Sun provides the tools: it is called the compiler. Now all you need to do is write the code for a portal. But since there are vendor specific solutions available that could make your life a lot easier, writing one yourself is like reinventing the wheel.
    Pardon my mild sarcasm, but avoiding API's not developed by Sun is not the general idea behind the Java platform. You are encouraged to use those API's.

  • IS IT POSSIBLE TO CREATE TRANSACTION WITHOUT USING ACTION BOX?

    HI,
    We are trying to implement CIC NON-TELEPHONY.
    Our requirment is simple we need to create complaint from CIC.
    Is it possible to create a transaction without calling it from action box using default workspaces.
    I mean i will not configure action box at all all i do is create a default work space for complaint which appears when the CIC screen is called up.
    Is it really possible to create this way or is it mandatory that the transaction should be called from action box only to create it?
    Can some one please advice on this we just need to create a couple of transactions from CIC 'cause we are planning to set up a small call centre.
    Though i am not sure of the way it needs to be created i tried to create it with default workspaces ( i mean i did not call it from the action box) but the problem is while i create the transaction in this way i have a problem with partner determination and organization determination they are wrongly determined.
    So, i need to confirm is this way of creating acceptable.
    Awaiting suggestions
    Regards,
    SAM

    Hi Sam,
    As far as I know, the way that you use the Default workspace(Business Activity) with the transaction type as Complaint should be fine. There is no hard and fast rule to only create the Complaints in CIC via Action Box.
    Pertain to the Partner / Org. Determination, when you launch CIC, then as per the configuration, the default workspace(Business Activity) of the transaction type Complaint will be used and at this very begining itself the partner determination(associated with the transaction type) will be executed. And this is what you can see in the workspace as well.
    When you confirm a BP, then as per the customizing maintained in the transaction CRMC_CIC_SEARCH_RULE("Profiles for contact search"), the BP1 and BP2 partner functions will be pushed into the Activity you made as default for the interaction.
    This is how the CIC - with Business Activities & Partner Functions will work. I guess, apart from the way that you had made the default workspace of the transaction type as Complaint, you can also have a look at the above mentioned transaction for Contact searches and according to your need you can change the partner functions.
    Hope this information helps !
    With Best Regards,
    Vinod

  • Steps to create Universe without using Fact Table

    Dear All,
    i am confronting with a problem by creating an Universe.
    The problem is that we do no have any fact table.
    Could you please  explain the steps for creating an universe without fatc table?
    Thanks
    Pat

    The first thing to do is identify the tables in your schema that contain measures. These will be your base tables for contexts.
    Then identify all the tables that relate to each of your candidate fact tables.
    You may identify two related tables, both with facts in, which would give you a fan trap.
    Say you have a schema with only three tables and they are related as: T1 -< T2 -< T3
    T2 and T3 both have measure columns.
    What you would need to do is create an alias of T2 (AT2) and join it to T2.
    You would then have two contexts, T1-< T2 , T2-< T3 and T1-<T2, T2- AT2
    For objects from T2, derive the dimensions from T2 and the measures from AT2.
    Beyond that, it's fairly standard.
    If you have a data schema it is going to be much easier for you.

  • HT2534 im trying to create id without using creditcard

    i have
    created an apple id but when i try to sign in it says that the apple id has not yet been used with the itunes store

    Did you follow the instructions on this page : http://support.apple.com/kb/HT2534 i.e. selecting a free app and creating an account when 'buying' it ?

  • Create index without using temp tablespace

    Hello,
    i have a great table with over 2.000.000.000 rows. Therefor i want to create an index on column1:
    CREATE INDEX "SCHEMA"."INDEX_TABLE1" ON "SCHEMA"."TABLE1" ("STR1")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOCOMPRESS LOGGING
    STORAGE( INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS" ;
    If i execute this my temp tablespace will be used and if its full (max 20gb) the creation will be aborted.
    Where is my fault to create the index?
    With best

    bladepit wrote:
    The table description:
    CREATE TABLE "SCHEMA"."TABLE1"
    (     "STR1" VARCHAR2(20 BYTE),
         "STR2" VARCHAR2(20 BYTE),
         "VAL" NUMBER
    ) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS" ;
    And i want to get the values like this:
    select str1,str2,val from SCHEMA.TABLE1 where str1 = 'TEST1' or str2 = 'TEST1'
    If this is the complete definition of the table, and if (str1, str2) are unique, and this really is the only way you use the table, then it looks as if your STRATEGIC move would be to rebuild the table as a hash partitioned IOT with something like 128 partitions. Since you probably can't do that in the short-term you could create a hash partitioned index on the table (assuming you have paid the partitioning licence) with enough partitions that you can create each one separately. Something like:
    SQL> create index t1_i1 on t1(n1, n2, n3) unusable global partition by hash (n1, n2) partitions 4;
    Index created.
    SQL> select index_name, partition_name from user_ind_partitions;
    INDEX_NAME           PARTITION_NAME
    T1_I1                SYS_P8713
    T1_I1                SYS_P8712
    T1_I1                SYS_P8711
    T1_I1                SYS_P8710
    4 rows selected.
    SQL> alter index t1_i1 rebuild partition sys_p8713 online;
    Index altered.
    -- repeat for each partition in turnRegards
    Jonathan Lewis

  • Can I create Maps without using Mapviewer?

    I want to just write my own Java Application pulling spatial data of type SDO_GEOMETRY from my database. Can I do this? Can anyone ponit me to some examples of straight Java code that does this or some documentation resources.
    Thanks!

    Have you tried the "The Oracle Spatial Java Library (which) enables applications written in Java to access and process geometry objects managed in Oracle Database with Oracle Spatial."
    available at http://www.oracle.com/technology/software/products/spatial/index.html

  • Creating an Adobe .pdf file without using the Adobe printer

    Is it possible to create a .pdf file by using Acrobat or Microsoft Word or any other program without using a printer driver? So far, when I remove the Adobe printer, I cannot create a .pdf file, as it is looking for the printer and printer driver. Is it even possible to create a .pdf without using, or having, a PDF printer of any sort? Any help on this issue would be most helpful. Thanks.

    I was trying to find a way to create PDFs without using the Adobe printer, or any PDF printer. I posed this question to see if there was a way to create a PDF without the aid of a printer or not. I mean, I know how to reinstall the Adobe printer, since I had to to see if there was another way to go about creating without using the printer. I am just curious if there is a way to create a PDF file without the aid of the Adobe printer or other PDF printers.

  • Create report without query wizard

    Hi,
    I want to create report without using query wizard in SAP B1. Can it possible by code?

    Maybe your question is related to this thread :
    Re: Execute report  query using vb.net code

  • How to create different Graphs in SharePoint 2013 without using Excel service?

    Hi All,
    I want to create different graphs in SharePoint without using Excel Service.
    I do not want to create excel and then upload that to SharePoint.
    Any one knows how to do that? Isthere any option to do that?
    Thanks in Advance

    Hi Darsh,
    You can use
    SharePoint chart webpart to display charts. Or you can use any jQuery charting library and feed data using JSOM or REST. Ex. high charts:
    http://www.highcharts.com/products/highcharts
    http://office.microsoft.com/en-us/sharepoint-server-help/sharepoint-lists-vi-exciting-ways-to-display-your-list-data-RZ102425636.aspx?section=3
    Best Regards,
    Brij K

  • How do you create an array without using a shell on the FP?

    I want to be able to read the status of front panel controls (value, control box selection, etc.) and save it to a file, as a "configuration" file -- then be able to load it and have all the controls set to the same states as were saved in the file. I was thinking an array would be a way to do this, as I have done that in VB. (Saving it as a text file, then reading lines back into the array when the file is read and point the control(s) values/states to the corresponding array element.
    So how do I create an array of X dimensions without using a shell on the front panel? Or can someone suggest a better way to accomplish what I am after? (Datalogging doesn't allow for saving the status by a filename, so I
    do not want to go that route.)

    Thanks so much m3nth! This definitely looks like what I was wanting... just not really knowing how to get there.
    I'm not sure I follow all the icons. Is that an array (top left with 0 constant) in the top example? And if so, that gets back to part of my original question of how to create an array without using a shell on the FP. Do I follow your diagram correctly?
    If I seem a tad green... well I am.
    I hope you understand the LabVIEW environment and icons are still very new to me.
    Also, I had a response from an NI app. engineer about this problem. He sent me a couple of VI's that he threw together approaching this by using Keys. (I still think you are pointing to the best solution.) I assume he wouldn't mind m
    e posting his reply and the VI's for the sake of a good, thorough, Roundtable discussion. So here are his comments with VI's attached:
    "I was implementing this exact functionality this morning for an application I'm working on. I only have five controls I want to save, but they are all of different data types. I simply wrote a key for each control, and read back that key on initialization. I simply passed in property node values to the save VI at the end, and passed the values out to property nodes at
    the beginning. I've attached my initialize and save VI's for you to view. If you have so many controls that this would not be feasible, you may want to look into clustering the controls and saving the cluster as a datalog file.
    Attachments:
    Initialize_Settings.vi ‏55 KB
    Save_Settings.vi ‏52 KB

  • How to create new Custom XML Report without using Form Builder

    Hi,
    What are the steps to create new Custom XML Report without using Report Builder ?
    Thanks and Regards,
    Abhi

    Hi,
    Steps we now follow
    1)Create Data Model in Reports Builder
    2)Create xml
    3)Insert xml in Publisher to build Fomat
    4)FTp rdf
    5)Create Data Definition and Template
    6)Create executable and Concurrent Program
    Is there any way we can build reports without use of Report Builder ? By writing PL SQL Package for Before Report and After Report etc ...
    Thanks and Regards,
    Abhijit Rode

  • CREATE XML PUBLISHER REPORT WITHOUT USING RDF

    Hi Every one ,
    Can anybody share his/her expertise on following issue ?
    "How to create XML Publisher Report without using RDF?"
    Your help is appreciated.

    Hi Swapnesh
    YOu do not need to create the XDODTEXE, its seeded for you. You need to do the following:
    1. Create and test the data template
    2. Load the data template to the template manager against a data definition
    3. Create a concurrent program definition that uses the XDODTEXE as its executable
    4. Create parameters (if required) for the CP and DT that match in name
    You're done
    Regards
    Tim

  • How can I create a Glow without using a filter

    I am creating an application for iPhone4, and one of the problems I am having is the lack of filter support.
    I am trying to create a "stroke" around some bitmaps... an example would be a text field that is white on a bright background - I would put a black stroke around it to contract it... there are other needs as well, but this is an example.
    Before, I would just put a glow filter on the text field, tweak the settings and it looked good and did exactly what I wanted.
    But iPhone4 high resolution with gpu acceleration don't support filters - and I can't change those requirements... so any and all bitmap filters are out.
    Does anyone know of a way I can create a glow filter effect without using filters that would not be a major preformance hit for fps and memory?

    Have you tried using tweenMax and code in a glow effect.
    Something like this:
    import com.greensock.*;
    import com.greensock.plugins.*;
    TweenPlugin.activate([TintPlugin]);
    var glowEffect:TweenMax = new TweenMax(mc,0,{glowFilter:{color:0x330000,alpha:1,blurX:5,blurY:5,strength:2,quality:2,ov erwrite:5}});

Maybe you are looking for

  • Adobe Illustrator Export to JPEG (*.JPG) vs ICC Color Profiles vs Behance

    Hi, I work with Adobe Illustrator CC 2014. When I export my projects into *.JPG format (using both: 'Adobe Illustrator > File > Export' and 'Adobe Illustrator > File > Save for Web') I use 'Embed ICC' profile option. Every common image viewer I use (

  • How to do authorization check

    Hi, I am new for EP and study it using EP200. I installed EP and connected it to my IDES ECC 6.0 Now, I configured self registration When I click Register Now... , I got the error message "You are not authorized to perform this action. Contact your s

  • Difficult to transfer saved games by Storm8(How?)

    I bought my wife a new iPad. We backed up the contents and transferred eveything to the new iPad. Eveything worked fine except the Storm8 or Teamlava games like Bakery Story etc. It turns out you can't just backup and restore those apps in a new iPad

  • Password Manager

    I recently removed Client Security because the password manager for internet logins was not working and CSS seemed to be the cause.  I have seen many discussions abount password manager but not any solution that was applicable.  Is there a way to use

  • How to save PDF form to a KM Folder in Portal

    Folks, I have a requirement to save ADOBE Form to KM folder in portal and again access that form for changes. Thanks, Manish