Three brief graphics questions ...
VB6Pro/WinXP. Graphics newbie.
1) I'm trying to make a playing card graphic smoothly slide across the screen by adjusting the .top and .left properties of the image control (this is the way you do it, yes?). I'm having trouble slowing it down so it doesn't blaze from point A to point B. I've tried using the system timer to make an appropriate delay between location updates, but I can't seem to use an increment that is small enough. I've also tried the old basic way of using:For T=1to50000:Next T, and this works closely enough, but different systems will display the flying card at different speeds, yes? What is the acceptable (professional) way to put in a delay of this type in VB?
2) The same card above, when made to move very fast, leaves a white trail behind it using a pic box, but not when using an image control. Why?
3) The same card above, when using the image control visually 'flashes' as it is being "dealt" and a white horizontal line briefly appears across the middle of the graphic. I realize this must have something to do with the speed at which the graphic is being repainted, but can I do something to eliminate it?
Come on, how do you guys get those graphics to slide so smoothly? Any help appreciated.
I have absolutely no problems using the Timer control...
For the human eye an interval of 30millisec or shorter is enough to have smooth animation, just find the right "step" to use when moving the image at each interval, with few trials you should get the right combinaton.
Just add a timer control in you application, set the enabled property to false and the interval to 30. Enable the timer when the image needs to be shifted and in the timer event set something like
timer.enabled = false
myImage.left = myImage.left + stepLeft
myImage.Top = myimage.top + stepRight
timer.enabled= (check if the image needs more shift)
"There are two ways to write error-free programs. Only the third one works."
Thanks, Marco, I will try that!
Last Post: 05-23-2005, 06:22 PM
By semidieu in forum .NET
Last Post: 02-18-2005, 07:40 AM
By Michael Culley in forum .NET
Last Post: 05-05-2002, 01:02 PM
By Rob Lowney in forum .NET
Last Post: 07-20-2001, 04:31 PM
Last Post: 03-12-2001, 09:34 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center