Please help.. !! Can I make an offscreen Image by painting JComponent

Hello friends,
I have a class Sprite which extends JComponent.. and it is overriding paintComponent(Graphics g) and painting image in it.. !!
I just want to know that.. can I make my own offscreen Buffered Image like this..!!
BufferedImage buffer = new BufferedImage(128, 128, BufferedImage.TYPE_3BYTE_BGR);
Graphics g = buffer.getGraphics();
g.setColor(Color.white);
g.fillRect(0, 0, 128 , 128);
for (int i = 0; i < 4; i++) {
Sprite s = (Sprite) stack.get(i);
g.drawImage(s.img, s.getLocation().x, s.getLocation().y, null);
}Will this make my offscreen Buffered Image buffer?
Thanking in advance
gervini

Hello friends,
I have a class Sprite which extends JComponent.. and it is overriding paintComponent(Graphics g) and painting image in it.. !!
I just want to know that.. can I make my own offscreen Buffered Image like this..!!
BufferedImage buffer = new BufferedImage(128, 128, BufferedImage.TYPE_3BYTE_BGR);
Graphics g = buffer.getGraphics();
g.setColor(Color.white);
g.fillRect(0, 0, 128 , 128);
for (int i = 0; i < 4; i++) {
Sprite s = (Sprite) stack.get(i);
g.drawImage(s.img, s.getLocation().x, s.getLocation().y, null);
}Will this make my offscreen Buffered Image buffer?
Thanking in advance
gervini

Similar Messages

  • I forgot my icloud account and my email how can i recover it please help me icloud maker and icloud password and username holder

    i forgot my icloud account and my email how can i recover it please help me icloud maker and icloud password and username holder

    If you don't know your ID, you can try to find it as explained here: http://support.apple.com/kb/HT5625.  Then you can reset the password as explained here: http://support.apple.com/kb/PH2617.  Of course, you can only do this if it's your ID.

  • HT1386 please help me to make synch between my computer and iphone , on the file tab it is not possible to click, thanks

    my dear,
    please help me to make synch between my computer and iphone , on the file tab it is not possible to click.
    appreciate your help and thanks in advance.
    regards
    hesham

    You can't
    Apple has never approved a method to downgrade iOS
    Allan

  • Guys i need to get m itunes account unlocked its stopping mefor making in app purchases please help need to make a purchase within 30 minutes

    guys i need to get my itunes account unlocked its stopping mefor making in app purchases please help need to make a purchase within 30 minutes

    If you've tried to buy something and your've been charged for it (and it's not a temporary store holding charge) but haven't received it then try the 'report a problem' page to contact iTunes Support : http://reportaproblem.apple.com
    If the 'report a problem' link doesn't work then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Please help: Can't download itunes with windows 7 (64 bit).  Keeps freezing at 99%

    I have tried deleting and re-installing itunes and quicktime but it still won't work.  Please help.

    Can someone please respond to my request for support?  I tried the provided correct answer at https://discussions.apple.com/message/11561783#11561783  but it did not work. 
    I also got a MSFT tech support person to remotely look at my machine, for what its worth, he said the registry file is fine and to contact Apple support.
    Any help would be very much appreciated.

  • Can I make a disk image of my macbook pro for backup?

    Can I make a disk image of my macbook pro for backup? I'm using Lion, have 8 g memory and 500 HDD.

    Clone Lion using Restore Option of Disk Utility
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Select Disk Utility from the main menu then press the Continue button.
    Select the destination volume from the left side list.
    Click on the Restore tab in the DU main window.
    Check the box labeled Erase destination.
    Select the destination volume from the left side list and drag it to the Destination entry field.
    Select the source volume from the left side list and drag it to the Source entry field.
    Double-check you got it right, then click on the Restore button.
    Destination means the external backup drive. Source means the internal startup drive.
    DU will also clone the Recovery HD partition automatically at the end of the process.

  • How can i make a simple image viewer in JAVA?

    i know this is a silly doubt...but 'm new to java
    i have to make an image viewer which can also zoom the image
    please help me
    advance thanx

    Create an java.awt.Image object
    Display it in a java.awt.Panel object
    using java.awt.Graphics.drawImage
    some of the drawImage methods let you scale, clip, and flip the image.
    That's AWT. It may be easier in Swing.
    I think this could be written in under 50 lines of code. Maybe under 25.
    Read the tutorials and the API. All will become clear.
    If you're new to java, you might be better off posting to the New To Java forum.

  • Please help me(How to allign an Image.)

    I'm using
    StyledDocument document = (StyledDocument) tp.getDocument();
    Style imageStyle = document.addStyle("StyleName", null);
    StyleConstants.setIcon(imageStyle,new ImageIcon("Images\\image1.gif")
    document.insertString(document.getLength(), "ignored text",imageStyle);codes to append an image to JTextPane and
    Style style = document.addStyle("StyleName", null);
    StyleConstants.setForeground(style, new Color(r, g, b));
    document.insertString(document.getLength(), appendMessage, style);
    codes to append text to a JTextPane.
    But when i append both images and texts ,Images are above the text.
    Here I mean the bottom level of Images are at the same level of texes.
    I want to make images below the texes
    How can i do it?
    If you can give me a little exampl
    I think You can understand my requirement.
    If it is difficult to understand tell me.
    please help me

    I'm using
    StyledDocument document = (StyledDocument) tp.getDocument();
    Style imageStyle = document.addStyle("StyleName", null);
    StyleConstants.setIcon(imageStyle,new ImageIcon("Images\\image1.gif")
    document.insertString(document.getLength(), "ignored text",imageStyle);codes to append an image to JTextPane and
    Style style = document.addStyle("StyleName", null);
    StyleConstants.setForeground(style, new Color(r, g, b));
    document.insertString(document.getLength(), appendMessage, style);
    codes to append text to a JTextPane.
    But when i append both images and texts ,Images are above the text.
    Here I mean the bottom level of Images are at the same level of texes.
    I want to make images below the texes
    How can i do it?
    If you can give me a little exampl
    I think You can understand my requirement.
    If it is difficult to understand tell me.
    please help me

  • Please help. can't get definition around a text. pulling out my hair :(

    hi. i was following a tutorial to give text a 3D effect.
    the tutorial is located here:
    http://www.illustratortechniques.com/3d-text-effect.html
    i am only two steps in and did exactly what was told but my text effect looks different than his. his text has definition so you can make out what it is whereas mine does not.
    the screenshot of the difference is here:
    http://www.macrochild.com/help.jpg
    (mine is on the left. the tutorial is on the right.)
    please help me i did this five times and i can't duplicate that image.

    Hello,
    In the texts 3D dialogue box you need to switch some sort of shading on, either plastic of difuse, or you could put a very small dark stroke around the outside of your text. It's probably the shading though, it's the surface drop down box at the very bottom (or if you have advanced on it's in the middle).
    Regards
    Paul

  • Please Help - Can't send to External Hard Drive

    I am in the project manager - I am copying and sending to new location - E Drive, external hard drive.
    But, when I try it stops and says this:
    "There was a problem... please make sure you have enough disk space..."dude, i got 500gigs and the project is 13 gigs (so that's not the problem) ... then it says: "make sure you have the correct user privileges to complete the operation."
    what?
    This is my software, my license, my computer, and my project. of course I have user privileges.
    Please help...

    There's a chance that nothing's wrong with your drive, and that it's one particular piece of media in your timeline that's choking the project trimmer & causing it to abort with a generic error.
    I'm guessing that you're probably cutting an hour-long DV project. Are any of your clips not DV? Anything ripped from a DVD, perhaps? If you suspect certain clips are tripping you up, try removing them temporarily (make a backup of your master project file, just in case!) & try the trimmer again.
    If you can't make an educated guess, you can fall back on this method: make a copy of your project. Delete half of the timeline; trim again. Does it fail? If so, split the remainder in two, trim again. Keep going until it doesn't fail anymore. In this manner, you'll be able to narrow down what clip(s) is giving you trouble.
    If you do pinpoint a particular clip that won't trim, please let me know what it is. I'd like to take a look...
    Cheers

  • DVDSP3-Can You Make A Disk Image File From DVDSP3?

    *Hello again. I'm just finishing up my first go around w/DVDSP3. I was surprised that when I got to the burning options, that there was no option for burning a disk image file. Is it do-able on this program?*
    *I burned out one disk and tested it on a couple different players, and "finally" it was good. After the burn, the prompt just said "Formatting finished". There was no option to burn another disk, nor could I find any place to bring up a menu, to tell it that I needed 4 disks. Therefore, it was hours just to get 4-15minute dvds burned, as it started the build all over again each time. Thanks again for the help!*
    LarryWest

    In the Format - even the Build and Format too - dialog, you have an option to write the disc to the hard drive.
    If you need to make a copy at a later date (even after you've nuked everything from your hard drives, you can use Disk Utility in OS X to make a disc image from an existing DVD-R, then burn additional copies.

  • Please Help!  I don't want images to "stick" to the outside of CS3!  I want them to float!

    I have CS3 and I like having my images float without "sticking" to anything over the whole screen.  As it is now, they like to grab onto the edge of the application when I move them outside its boundaries.  I did this all the time in CS2 and I like it a lot.  This new thing is very annoying and I want desperately to TURN IT OFF.  Please!  I am asking could someone please tell me how to turn the image stickiness to the edge of the app OFF?  Thanks so much in advance!
    Nothing I've tried thus far has worked and I've lost three days trying to figure it out.  Why is this not a clickable option to turn off in preferences???

    You can't.
    The Mail.app displays all image/photo and single page PDF attachments inline or viewed in place within the body of the message by default - sending and receiving.
    You can control-click on a viewed in place attachment and select View as Icon but the icon for the attached file will remain in the body of the message. Regardless, depending on the recipient's email client and available preference settings, such attachments may appear inline or viewed in place when the message is opened by the recipient (as with the Mail.app when receiving such attachments) or as attached files only which must be opened separately to be viewed for which the sender has no control over.
    This was a minor adjustment for me at first but I now prefer such attachments being displayed inline since I have confirmation that I selected the correct file or file names as attachments before the message is sent.

  • How can I make the tab image instead of text.

    Hi guys,
    How can I make a tab displayed as image instead of text?
    Best Wishes,
    Fateh

    Thanks Jari,
    I use Apex 4.0.2 and the theme is Builder Blue 2. When I click edit tab, I get "Tab Label" that is required field and a region called "images". As I got from you, I cannot utilize images in my case.
    Regards,
    Fateh

  • Itunes has stopped working - Please help - Can't SYNC !!

    I have windows 7.
    I have the latest Itunes.
    My Itunes works fine.
    When I plug in my iphone 4 I tunes works fine.
    Whe I click sync Iphone, it gets to step 3/4 of the sync process and then it says " I tunes has stopped working" underneath that it says "Windows can check online for a solution to the problem". When I clikc view problem details I get:
    Problem signature:
      Problem Event Name:    APPCRASH
      Application Name:    iTunes.exe
      Application Version:    10.4.1.10
      Application Timestamp:    4e4e1904
      Fault Module Name:    QuickTime.qts
      Fault Module Version:    7.70.80.34
      Fault Module Timestamp:    4e13ba08
      Exception Code:    c0000005
      Exception Offset:    00146b30
      OS Version:    6.1.7601.2.1.0.768.3
      Locale ID:    2057
      Additional Information 1:    0a9e
      Additional Information 2:    0a9e372d3b4ad19135b953a78882e789
      Additional Information 3:    0a9e
      Additional Information 4:    0a9e372d3b4ad19135b953a78882e789
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt
    I have already tried uninstalling itunes, quick time and apple support programmes, and then reinstalling all of them.
    Help will be highly appreciated.
    Thanks.

    So sorry - I'm in the same boat!  Someone please help us out!!!!!

  • Please help: can bullets look normal in JavaHelp?

    When I generate JavaHelp (using RoboHelp) and preview, the bullets have prongs sticking out of them, instead of being smooth. Has anyone else encountered this? Is it a RoboHelp problem or a JavaHelp problem? Please help! I have to create compressed JavaHelp, and it's horribly ugly right now.
    Thanks!

    I know of no way to make a 4:3 hi-def movie. Unless you just want to crop off the sides -- but then you'll just have a widescreen video with black bars on the sides!

Maybe you are looking for