Note that there are some explanatory texts on larger screens.

plurals
  1. PODelphi 6: Can native Delphi do smooth graphics like Flash?
    text
    copied!<p>I have a native Delphi TFrame that emulates Roy Tanck's Cumulus Tag Cloud viewer, a WordPress Flash plug-in. What that plug-in does is create a 3D sphere of words that spin around on the surface of a "virtual" sphere. You can see it in action here:</p> <p><a href="http://www.roytanck.com/2008/03/06/wordpress-plugin-wp-cumulus-flash-based-tag-cloud/" rel="nofollow noreferrer">http://www.roytanck.com/2008/03/06/wordpress-plugin-wp-cumulus-flash-based-tag-cloud/</a></p> <p>In my application structure each word has its own TBitmap and to render the sphere I print all the word's bitmaps to a temporary TBitmap and then BitBlt() that temporary TBitmap on to the Canvas of a visible TPaintBox. The render operation occurs on a TTimer timer event that happens every 50 milliseconds.</p> <p>However, no matter how hard I try there is a noticeable "jitter" to the movement of the words, especially in comparison to the silky smooth movement of the Flash player. I thought increasing the frame rate might help and I even tried using a Multimedia timer that updated every 10 milliseconds with proper locking and unlocking of all the Canvases due to the multithreaded nature of the MM timer. Still jittery. The only thing I can figure is that the calculations I do result in discrete pixel locations for each word to render at and that causes jitter. In contrast, and this is supposition, perhaps Flash potentially does dithering to facilitate "between pixel" rendering or maybe does anti-aliasing in real-time and that's why it doesn't jitter?</p> <p>In any case, is it possible to get the silky smooth motion I am looking for using native Delphi code? Or is the only way to do it is to go all the way to something like a Direct3D or OpenGL solution? I don't want to waste time tweaking this thing to death if it's a losing battle. On the other hand, if you have any tips I'd love to hear them. My guess is that if I do have to go the Direct3D/OpenGL route it's a big job and learning curve so if I could find a way to get this done in native Delphi code I'd love that.</p> <p>FOLLOW-UP EDIT: Would printing to a much larger "virtual" bitmap and then using a resampling method like that given here help to print "down" to the actual visible Canvas?:</p> <p><a href="https://stackoverflow.com/questions/1976116/scale-an-image-nicely-in-delphi">Scale an image nicely in Delphi?</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload