Skip to main content

Can Graphics be saved

1 reply [Last post]
java_program_creater
Offline
Joined: 2007-01-04

Hello.

I am working on the GUInterior (news good-looking components) project and now wants accelerate the painting speed. The animation framework does its job by repainting the component mulptiple times per seconds and the AnimatedPainter classes will behave different every step. i think it takes a lot of time to paint the Swing parent component.

is it possible to save the Graphics object to use it later by defining a new variable in the animation Thread, or will the Graphics object change every time??

Is the painting work still visible if you paint directly to that context?? Do i have to update something??

Do you have other ideas in which I can do this??

Abel Corver.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Dmitri Trembovetski

Hi Abel,

You can cache the Graphics object but it is not advisable.
First of all, you will not gain anything from caching.

Profile your application to find out the real bottlenecks
first.

Thanks,
Dmitri

java2d@JAVADESKTOP.ORG wrote:
> Hello.
>
> I am working on the GUInterior (news good-looking components) project and now wants accelerate the painting speed. The animation framework does its job by repainting the component mulptiple times per seconds and the AnimatedPainter classes will behave different every step. i think it takes a lot of time to paint the Swing parent component.
>
> is it possible to save the Graphics object to use it later by defining a new variable in the animation Thread, or will the Graphics object change every time??
>
> Is the painting work still visible if you paint directly to that context?? Do i have to update something??
>
> Do you have other ideas in which I can do this??
>
> Abel Corver.
> [Message sent by forum member 'java_program_creater' (java_program_creater)]
>
> http://forums.java.net/jive/thread.jspa?messageID=255558
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".