How can I create a java.awt.Image from ...

Hi all,
How can I create a java.awt.Image from a drawing on a JPanel?
Thanks.

JPanel p;
BufferedImage image =
    new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
Graphics2D g = image.createGraphics();
p.paint(g);
g.dispose();

Similar Messages

  • How can I create a java bean instance from servlet, at runtime?

    Will anybody help me?
    I want to send bean (class) name to a servlet through parameter and I need servlet to create specified bean instance and run its method that I will send through another parameter, at runtime.

    Thanks. I found answer

  • How can I create a high res image gallery, need to have print res photos for a pressroom section.

    How can I create a high res image gallery, need to have print res photos for a pressroom section.

    If you want Muse to "pass through" your images and not adjust, compress, crop etc - you need to place your images in the lightbox EXACTLY at the right size, pre-cropped and prepped in Photoshop.
    So if your light box is 800x600 the image you're dropping into that must be 800x600 exactly with no effects, rotation etc added to the lightbox frame. This stop Muse fiddling with your images, if they are perfect when inserted and you're not asking Muse to crop, expand, add effects etc. If it's perfect when inserted, Muse SHOULD also leave the resolution alone too, but I have not tried that one, but in theory, it should work.

  • How can I create a Java help file (*.hs)?

    How can I create a Java help file (*.hs)?

    Thanks a lot.
    I know it is rather poorly used, but I still need it for our current software
    Mit freundlichen Grüßen / With best regards
    Hans-Jürgen Hengsbach - Produktmanagement / Product Management (-227)
    Von: Peter Grainge [email protected]
    Gesendet: Dienstag, 29. April 2014 16:48
    An: Hengsbach.Hans-Juergen
    Betreff: How can I create a Java help file (*.hs)?
    Re: How can I create a Java help file (*.hs)?
    created by Peter Grainge <http://forums.adobe.com/people/Peter+Grainge>  in RoboHelp - View the full discussion <http://forums.adobe.com/message/6340535#6340535

  • How can you create a writable PDF document from a PPT presentation ?

    How can you create a writable PDF document from a PPT presentation ? Upper part with the image , lower part with a free space in order to take notes for students during presentation or course.
    Thanks.
    B

    You can make a PDF file out of you notes and handouts but using the Adobe PDF printer.
    Open your PowerPoint Document then go to “File” “Print”
    Select ‘Adobe PDF” Printer
    Under slides, select which way you want to print. Note it will not print to a printer but to a PDF file.
    After then go into printer Properties and Setup PDF properties, do the following: (see second image below)
    Default: PDF/A 1-b
    Adobe Security: none (change as needed)
    Adobe Output folder: Prompt for Adobe file name
    Adobe Page size: Letter (change as needed)
    Check the following check boxes
    View Adobe PDf Results,
    Add Document Information,
    Rely on system fonts only,
    Delete Log files for successful jobs.
    Select OK
    A pop will ask you where you want to save the document. The file extension should be PDF. After giving the file name select okay and the file should popup as a PDF. Down side is if you want to speaker notes included then you will have to do another file, like wise with just screen shots then combine into one PDF document.
    I used Acrobat IX Pro. So to do this you need Acrobat IX or X Pro.
    Hope this will help.
    Tiger26

  • How can I download automatically only new images from my camera?

    Hello,
    I can not download only new images from my EOS 450D-camera with Elements 10-Photodownloafer (Mac os).
    Each time I use Photodownloader it downloads all images , also those that were downloaded preveously
    How can I set photodownloader?
    Thanks for your advices

    I share my card with my wife and she likes to download our images also on her PC, so erasing all images is not an option.
    It seems that earlier version of adobe photo downloader has the feature "copy only new files" , but V10 does not.
    Thanks for your answer
    Mikele
    Op 10-jun.-2012, om 15:33 heeft 99jon het volgende geschreven:
    Re: How can I download automatically only new images from my camera?
    created by 99jon in Photoshop Elements - View the full discussion
    Don’t you format the card in the camera after each download? That will wipe all images and prepare the card for a fresh shoot.
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4480409#4480409
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4480409#4480409. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Elements by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • HT5517 How can have full picture using mirrored image from iPad

    How can have full picture using mirrored image from iPad on my Apple TV airplay

    Welcome to the Apple Community.
    Mirroring won't fill the TV screen. The iPad has an aspect ratio of 4:3 and the iPhone 4S or prior an aspect ratio of 3:2, neither of these will fit exactly into a TV screen which as an aspect ratio of 16:9. The Apple TV will not zoom the mirrored image, because it may well cut off information which is situated at the top or bottom of the screen.
    You may wish to try each of the settings in ‘Settings > Audio & Video > Adjust for AirPlay overscan’ for the best setting that suits you.

  • How can one create a paint color generated from a photo using Kuler?

    How can one create a paint color generated from a photo using Kuler?

    The best way to remove a pattern is to use a Fast Fourier Transform.  There's a free plugin (as well as examples and instructions) here:
    http://dl.dropboxusercontent.com/u/6795661/4N6site/improc/fftplugin/examples.htm
    Using the plugin requires editing the individual colour channels, which PSE does not natively allow.  You'll need the reasonably-priced Elements+ addin:
    http://elementsplus.net/
    Here's a crop at 100% of the result I got:
    The pattern is much reduced.  With some experimenting, you can probably do a little better.
    Ken

  • HT2534 how can i create an account in itunes from Bangladesh ?

    how can i create an account in itunes from Bangladesh ?

    If you go to the artist's/group's page in the store then you should be able to do it e.g. search for the artist in the store, and on the right-hand side of the results page there should be list of content categories that match that search, and below it a link for the artist
    Click on the artist's name to go to a screen listing their items, and at the top right of that screen there should be a 'share' icon'
    Click on that and on the popup you should have an option for 'alert me' (I haven't used it but I assume that it works).
    You can see what alerts that you have, and remove them, by logging into your account via the Store > View Account menu option - on your account's screen there should be an Alerts link

  • How can I create a single background image for a BorderLayout?

    I can create a background with an image file for the individual panel (North, West, Center, East and South) in a BorderLayout, but I've been spinning my wheel for a long while now trying to figure out how to create just one background with a single image file for all of these panels?
    In my application, a panel may contain various buttons, a listbox, a group of checkboxes, a combo box, or a canvas. Even if I used the same image file, when the panels are finally put together, one can clearly see that the end product is the result of a lot of patch works.
    Hope someone has an answer for this. BTW, I'm using AWT because it works with existing browsers without the need for a separate Java plug-in.
    Regards,
    V.V.

    Look at this :
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.awt.image.BufferedImage;
    public class PanI extends Frame
         Image map;
         Panel pan;
         myPan p8,p4,p6,p2,p5;
         BufferedImage I;
    public PanI() 
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);}});
         map = getToolkit().getImage("map2.gif");
         MediaTracker tracker = new MediaTracker(this);
         tracker.addImage(map,0);
         try   {tracker.waitForID(0);}
         catch (InterruptedException e){}
         I = new BufferedImage(1,1,BufferedImage.TYPE_INT_ARGB);
         setBounds(10,10,map.getWidth(null)+8,map.getHeight(null)+27);
         setLayout(new BorderLayout());
         pan = new Panel();
         add(pan,BorderLayout.CENTER);
         pan.setLayout(new BorderLayout());
         pan.setSize(map.getWidth(null),map.getHeight(null));
         p5 = new myPan(5);
         p5.setBackground(Color.red);
         pan.add(p5,BorderLayout.CENTER);
         p8 = new myPan(8);
         p8.setBackground(Color.orange);
         pan.add(p8,BorderLayout.NORTH);
         p4 = new myPan(4);
         p4.setBackground(Color.blue);
         pan.add(p4,BorderLayout.WEST);
         p6 = new myPan(6);
         p6.setBackground(Color.green);
         pan.add(p6,BorderLayout.EAST);
         p2 = new myPan(2);
         p2.setBackground(Color.pink);
         pan.add(p2,BorderLayout.SOUTH);
         setVisible(true);
    public class myPan extends Panel
         int where;
    public myPan(int i)
         super();
         where = i;
    public void paint(Graphics g)
         if (I.getWidth(null) != pan.getWidth() || I.getHeight(null) != pan.getHeight())
              I = new BufferedImage(pan.getWidth(),pan.getHeight(),BufferedImage.TYPE_INT_ARGB);
              Graphics      G = I.getGraphics();
              G.drawImage(map,0,0,pan.getWidth(),pan.getHeight(),null);     
              G.dispose();
         int x1=0;
         int x2=getWidth();
         int y1=0;
         int y2=getHeight();
         if (where == 8)
         if (where == 2)
              y1 =  p8.getHeight()+p5.getHeight();
              y2 =  getHeight()+y1;
         if (where == 4)
              y1 =  p8.getHeight();
              y2 =  y1+getHeight();
         if (where == 5)
              x1 =  p4.getWidth();
              x2 =  x1+getWidth();
              y1 =  p8.getHeight();
              y2 =  y1+getHeight();
         if (where == 6)
              x1 =  p4.getWidth()+p5.getWidth();;
              x2 =  x1+getWidth();
              y1 =  p8.getHeight();
              y2 =  y1+getHeight();
         g.drawImage(I,0,0,getWidth(),getHeight(),x1,y1,x2,y2,null);
    public void update(Graphics g)
         paint(g);
    public static void main (String[] args) 
         new PanI();
    Noah

  • How can I create a bootable DISK IMAGE of my PB Internal Drive?

    I would like to make a bootable image of my Hard Drive but without including any Free Space.
    You see all I need on the image are the OSX and the programs, NOT the 60GB of Free Space. Disk Utility however wants to create a 80gb image which includes 60GB of Free Space.
    I would like to use the Bootable image as a source image to use with the RESTORE function in Disk Utility.
    Regards

    You'll need a second machine or an external HDD with Mac OS X installed on it.
    For purposes of this procedure I'll be calling your machine the 'source' and the second machine or your external HDD the 'target'.
    First either boot the source into target mode by holding down the 'T' key while it boots. Once you see the FireWire icon on the screen, let go of the 'T' key and plug the source into the target. If you're going with the external HDD route, boot your source of off your external HDD.
    Now, select the drive of your source machine, and hit Apple-I to bring up the information pane. Down at the bottom (in the permissions area) you'll see a check box labeled "Ignore ownership..." Uncheck that.
    Open up Disk Utility. Select the source drive and run First Aid and Repair Permissions on it.
    Now, select the File menu -> New -> New Disk Image from Folder. You're going to want to hit that big "New Image" button, but don't. Trust me. It'll only cause trouble for you down the road.
    Select the source drive as the source. You can leave everything else the same and click "Image".
    Select the target as the destination. Click Save.
    Wait for a couple of hours (depending on how much stuff you have).
    When it's done, select the Images menu -> Scan image for Restore.
    Select the disk image you just made and click "Scan".
    When that's done you have a restorable image. Just use the restore tab to restore it.
    I've done this literally hundreds of times and it's worked every single time.

  • How can I create a rotating basketball image in Motion?

    I need to have a basketball rotate and do a full 360 degree. I took an image from Google Images and dragged into Motion and applied the sphere filter. Is that the best 3D looking basketball I can get from a 2D image? Thanks!
    Message was edited by: Host <to correct typo in title, change it to clarify>

    You need an unrolled basketball image and wrap that around a sphere...
    Like this:
    Patrick

  • How can I take a single selected image from a slideshow to pass  to another page?

    I have a slideshow of several images from which a user needs to select one (for example the image that is featured in a lightbox after cicking the thumbnail) and then go to another page for further details on that image, with the same image displayed again, and where I want to embed some html to offer further options based on that selected image. How do I pass the name of the object from one page to another? How do I detect that a user has selected an image?
    I have tried setting each image in the lightbox as a hyperlink to a new page, and also tried setting its caption as a hyperlink, but neither of those ideas seem to work (at least in Preview).
    Any suggestions please? I am working in Muse CC 2014.

    Creating a hyperlink from the text caption should work. Try previewing: File/Preview Site in Browser to test.
    (I tested it using both Preview and File/Preview Site in Browser and it did link to the page I assigned)

  • How can i run a java class file from shell?

    Hi all,
    I've a .class file named "File" that contains Main method, it is in the package "File2".
    How can I run it by shell command?
    PS: "java -cp . file" doesn't work it launch->
    Exception in thread "main" java.lang.NoClassDefFoundError: File2/File (wrong name: File2/File)
    Thanks in advance.

    Just to understand: is File2 ar jar archive or not? If it is a jar archive, have you tried open File2.jar? If File2 is a directory within the current directory, have you tried java -cp . File2/File? I just tested with a set of classes and it works... Let me be precise:
    * Let us imagine you are working in a directory whole path is PathToDir/
    * in this directory you have the classes put in a directory called File2
    * in order to launch File.class then you would have to invoke :
    cd PathToDir/ (just to be sure)
    java -cp . File2/File
    *if you were to do the following then you would have the problem you describe
    cd PathToDir/File2/
    java -cp . File

  • How can I create a list of addresses from the Junk folder?

    I am using TB 24.7 and I have a long list of e-mail addresses in my junk folder. I need to harvest those to add them to my server's black list.
    How can that be done?
    Thanks.

    Trying to filter junk messages based on sender email is hopeless. The sender email changes all the time.

Maybe you are looking for

  • All I want to do is sync one video file from my computer to the iPad

    Hi all- I ripped a "test" mpeg4 video on my home computer that I want to transfer to my iPad. That's all I want to do. I "assume" that this test video has to be placed in a folder somewhere on my main computer's hard drive so that iTunes "sees it" an

  • Is there a desktop app to control apple tv?

    I have an entirely apple home.  Even so, often times the kids have the iPads or iTouch upstairs and the little silver remote for the apple TV is usually lost in the couch.  I find it hard to believe that there isn't an app available on the iMac deskt

  • How can I turn off alternative layouts in the pages panel?

    Hi, For some reason my pages panel as split into two columns, header A4 V and A4 V 2, I assume this are alternate layouts for HTML export or something. How can I turn these options off? I don't need this functionality right now and I've got pages in

  • Reading text on a screen

    Hey everyone. I'm working on a program that will read the text displayed in another program. When a certain keyword appears in the other program's text, my program will log it. The programs would run on a Windows system. Unfortuantely I'm not sure ho

  • Html class with applet tag support ?

    Hello, I would like to load in a swing application, an html file which contains the tag 'applet'. JEditorPane doesn't support it. Anyone know of an another class ? Thanks Nathalie OBADIA