DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004

    Question 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.


  2. #2
    Join Date
    Nov 2003
    Alameda, CA
    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."

  3. #3
    Join Date
    Apr 2004
    Thanks, Marco, I will try that!

Similar Threads

  1. Replies: 13
    Last Post: 05-23-2005, 05:22 PM
  2. Replies: 0
    Last Post: 02-18-2005, 06:40 AM
  3. What is the graphics object
    By Michael Culley in forum .NET
    Replies: 1
    Last Post: 05-05-2002, 12:02 PM
  4. Two More Graphics Questions
    By Rob Lowney in forum .NET
    Replies: 3
    Last Post: 07-20-2001, 03:31 PM
  5. Replies: 3
    Last Post: 03-12-2001, 08:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.