Home

News

Forums

Hardware

CPUs

Motherboards

Video

Guides

CPU Prices

RAM Prices


Sharky Extreme : Forums:


+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Hammerhead Shark nanokooshball's Avatar
    Join Date
    Mar 2004
    Location
    'Burbs of Chicago
    Posts
    1,853

    One More Question in Java (Simple)

    how do i set the background in applet as an image?
    is there liek a one line code?

    rite now all i have is a blue background with
    setBackground(new Color(0,160,255));
    but i want to use an image
    Primary Rig
    Dell Latitude D820 || Intel Core Duo T2300E @ 1.66ghz || 1024mb PC5400 Ram || Nvidia Quadro NVS m110 256mb (Geforce Go 7300) || 80 GB 5400 RPM HD || DVD-RW Combo Drive || 15.4" WXGA Screen


    Secondary Rig
    AMD Athlon 64 3300+ @ 2.64 Ghz || 768 mb PC3200 DDR Ram || Biostar Nforce 4 Socket 754 || ATI Radeon X850 Pro 256mb @ 580 core/1200 mem|| Western Digital 160 GB 7200 HD || 48x DVD-RW

  2. #2
    Tiger Shark Doomah's Avatar
    Join Date
    Jul 2002
    Location
    Rochester, NY
    Posts
    934

    Re: One More Question in Java (Simple)

    Originally posted by nanokooshball
    how do i set the background in applet as an image?
    is there liek a one line code?

    rite now all i have is a blue background with
    setBackground(new Color(0,160,255));
    but i want to use an image
    g.drawImage( ... cover the whole applet ... );

    "PS 3.0 utilizes a wide range of optimizations, from 64-bit frame-buffer blending to looping and dynamic conditionals for rendering multiple light interactions in a single pass without requiring a combinatorical explosion of precompiled shaders."
    -Tim Sweeney

    DNF > HL2

  3. #3
    Hammerhead Shark nanokooshball's Avatar
    Join Date
    Mar 2004
    Location
    'Burbs of Chicago
    Posts
    1,853

    Re: Re: One More Question in Java (Simple)

    Originally posted by Doomah
    g.drawImage( ... cover the whole applet ... );

    ya i tried that.... but my game goes WAY slower if i do that... anyother way?

    I don't want it to always redraw the image
    Last edited by nanokooshball; 05-30-2005 at 04:12 PM.
    Primary Rig
    Dell Latitude D820 || Intel Core Duo T2300E @ 1.66ghz || 1024mb PC5400 Ram || Nvidia Quadro NVS m110 256mb (Geforce Go 7300) || 80 GB 5400 RPM HD || DVD-RW Combo Drive || 15.4" WXGA Screen


    Secondary Rig
    AMD Athlon 64 3300+ @ 2.64 Ghz || 768 mb PC3200 DDR Ram || Biostar Nforce 4 Socket 754 || ATI Radeon X850 Pro 256mb @ 580 core/1200 mem|| Western Digital 160 GB 7200 HD || 48x DVD-RW

  4. #4
    Hammerhead Shark nanokooshball's Avatar
    Join Date
    Mar 2004
    Location
    'Burbs of Chicago
    Posts
    1,853
    anyone?
    need to know soon plz
    Primary Rig
    Dell Latitude D820 || Intel Core Duo T2300E @ 1.66ghz || 1024mb PC5400 Ram || Nvidia Quadro NVS m110 256mb (Geforce Go 7300) || 80 GB 5400 RPM HD || DVD-RW Combo Drive || 15.4" WXGA Screen


    Secondary Rig
    AMD Athlon 64 3300+ @ 2.64 Ghz || 768 mb PC3200 DDR Ram || Biostar Nforce 4 Socket 754 || ATI Radeon X850 Pro 256mb @ 580 core/1200 mem|| Western Digital 160 GB 7200 HD || 48x DVD-RW

  5. #5
    Tiger Shark Doomah's Avatar
    Join Date
    Jul 2002
    Location
    Rochester, NY
    Posts
    934

    Re: Re: Re: One More Question in Java (Simple)

    Originally posted by nanokooshball
    ya i tried that.... but my game goes WAY slower if i do that... anyother way?

    I don't want it to always redraw the image
    I think it's always going to have to redraw/rerender every frame, regardless ... maybe there's some technique out there that I haven't heard about ... Volatile Images might be what something you want?

    Beyond that I'm not sure, you can certainly cut corners to improve performance (reduce the amount of time your applet thread sleeps, reduce background image color depth, etc).
    "PS 3.0 utilizes a wide range of optimizations, from 64-bit frame-buffer blending to looping and dynamic conditionals for rendering multiple light interactions in a single pass without requiring a combinatorical explosion of precompiled shaders."
    -Tim Sweeney

    DNF > HL2

  6. #6
    Hammerhead Shark nanokooshball's Avatar
    Join Date
    Mar 2004
    Location
    'Burbs of Chicago
    Posts
    1,853
    ya i've tried cutting out a lot of code that makes it go slower before i get to this part....

    but my game runs perfectly fast and fine before adding the background image and i've tried adding a lot of other stuff and it doesnt slow it down.... but the moment i add it, there is a significant slow down.... and lowering the thread sleep time does little to help it....

    so do i just add that code for Volatile Images in my Applet?
    Last edited by nanokooshball; 05-30-2005 at 09:16 PM.
    Primary Rig
    Dell Latitude D820 || Intel Core Duo T2300E @ 1.66ghz || 1024mb PC5400 Ram || Nvidia Quadro NVS m110 256mb (Geforce Go 7300) || 80 GB 5400 RPM HD || DVD-RW Combo Drive || 15.4" WXGA Screen


    Secondary Rig
    AMD Athlon 64 3300+ @ 2.64 Ghz || 768 mb PC3200 DDR Ram || Biostar Nforce 4 Socket 754 || ATI Radeon X850 Pro 256mb @ 580 core/1200 mem|| Western Digital 160 GB 7200 HD || 48x DVD-RW

  7. #7
    Ultra Great White Shark!! richardginn's Avatar
    Join Date
    Feb 2001
    Posts
    15,842
    www.myeducational plan.com-come see my plan to fix the USA educational system. I hope this is sig legal. Major Site Design Update on July 18, 2006. On June 18, 2009 passed the 10,000 post mark. December 24, 2009: Major Theme change and more....

  8. #8
    NullPointerException rock's Avatar
    Join Date
    Sep 2000
    Location
    York, PA
    Posts
    6,203
    Have you enabled double buffering for your window? If not, that could help with performance using the drawImage method.

    Open Source is free like a puppy is free.

    It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.

    Understanding Evolution

  9. #9
    Hammerhead Shark nanokooshball's Avatar
    Join Date
    Mar 2004
    Location
    'Burbs of Chicago
    Posts
    1,853
    Originally posted by rock
    Have you enabled double buffering for your window? If not, that could help with performance using the drawImage method.
    .

    already did double buffering... gonna check out that link by richardginn
    Primary Rig
    Dell Latitude D820 || Intel Core Duo T2300E @ 1.66ghz || 1024mb PC5400 Ram || Nvidia Quadro NVS m110 256mb (Geforce Go 7300) || 80 GB 5400 RPM HD || DVD-RW Combo Drive || 15.4" WXGA Screen


    Secondary Rig
    AMD Athlon 64 3300+ @ 2.64 Ghz || 768 mb PC3200 DDR Ram || Biostar Nforce 4 Socket 754 || ATI Radeon X850 Pro 256mb @ 580 core/1200 mem|| Western Digital 160 GB 7200 HD || 48x DVD-RW

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts