• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Plot zooming and double buffering

 
Rancher
Posts: 5035
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a plot program that displaces nodes and connecting lines. The nodes represent WayPoints in a region of the globe.
I initially scale the plot so that all of the nodes will show. Normally all the nodes are in a region, say the Caribbean Sea.
The Lat/Long of the WPs are converted to pixels and mapped into the display.
When I ZoomIn by X2, I change the number of pixels per degree of Lat/Long by X2 and then redraw the plot. I also allow the plot to be repositioned by click and drag with the mouse. The zooming works up to about 16X, which is adequate.


The problem is there is a small amount of flickering because I don't double buffer the image.
When I tried double buffering, I ran into problems with the createImage() method call trying to create TOO large an image after zooming in several times, The JVM runs out of space!

My question: How do I draw the WP and connecting lines when zooming?

Am I misusing the createImage() method? I'm having it create an image the size of the total zoomed area. This fails when the size of the area becomes too large!

Is there a way to use translate() or the clip area?

Why does the original Graphics context allow me to draw a plot up to about 16X with no problems?

Thanks,
Norm
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic