Results 1 to 3 of 3

Thread: PictureBox Auto Redraw and refresh

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    74

    PictureBox Auto Redraw and refresh

    In the game I'm working on I have two lables inside a picture box that is the combat screen. The problem is that the picture box has to refresh constantly which causes the lables to flash. Does anyone know of a way that I can avoid this without removing the lablels from the picture box?
    All will fall before the might of the Black Sashi...

  2. #2
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Hi
    The best soln is probably to not use Label controls and instead print directly to the picture box. This will stop any flickering
    eg
    VB Code:
    1. Private Sub Timer1_Timer()
    2.     Randomize
    3.     z = Rnd * 5000
    4.     zz = Rnd * 5000
    5.     Picture1.Line (z, zz)-(zz, z)
    6.     With Picture1
    7.         .CurrentX = 300
    8.         .CurrentY = 300
    9.         [b]Picture1.Print "Label1"[/b]
    10.         .Refresh
    11.     End With
    12. End Sub
    regards
    Stuart
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  3. #3
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    And don't worry if "Print" is not in the functions list, it works

    Just set the CurrentX and CurrentY to the coordinates where you wanna print the text, and use that function to print it.
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width