This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to draw a image in background  RSS feed

 
Sivakumar Nachimuthu
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to draw a image(map) in background. i want to know how to do?.Image size is more than 10 MB.
i wrote the below code inside paintComponent().But cursor is blinking between WAIT cursor and default.


[ September 29, 2004: Message edited by: Sivakumar Nachimuthu ]
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take the setCursor calls and the image loading out of paintComponent.
You only need to load the image one time: at construction or via event code.
The cursor changes should go in your constructor–originated image–loading
code (before and after the loading) or in your equivalent event code. The code in
paintComponent should be limited to what is needed to render the image
once it is fully–loaded.
[ September 29, 2004: Message edited by: Craig Wood ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!