|
-
Jan 16th, 2003, 10:32 AM
#1
Thread Starter
Hyperactive Member
How to stop the shape from flickering(A Shape control is used)
Hello Every1,
I have a peuliar problem for u guys. Follow closely the code given below......
Dim x1 As Single, y1 As Single
Dim draw As Boolean
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
x1 = X
y1 = Y
draw = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If draw = True Then
Shape1.Left = x1
Shape1.Top = y1
Shape1.Width = X - x1
Shape1.Height = Y - y1
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
draw = False
End Sub
The shape sizes according to our mouse, the only problem is the shape flickers. Can any1 stop that flickering. I'll be really happy if any1 can do it for me. Thank u...
PS: I have tried changing the AutoRedraw & ClipControl options on & off. They dont help...
If Not VB Then Exit
------------------------------------------------
visit me @ http://mzubair.50g.com/
-
Jan 16th, 2003, 10:39 AM
#2
Have you tryed to use the move method??? If that don't help you, you may want to use an other method like BitBlt or something...
-
Jan 17th, 2003, 04:31 AM
#3
Member
 ppl saw this
Die, ***** Die !
-
Jan 17th, 2003, 06:34 AM
#4
Then maybe BitBly should be it. More difficult, but probably gets the job done....
-
Jan 17th, 2003, 12:11 PM
#5
Member
 ppl saw this
Die, ***** Die !
-
Jan 17th, 2003, 12:14 PM
#6
BTW...what are you trying to do. Maybe we can tell you an other way of doing it if you told us what you are trying to do....
-
Jan 17th, 2003, 01:15 PM
#7
Originally posted by anjulpa
move wont help
move actually is supposed to be faster than assigning the properties one by one.. so if it is flickering because of the speed of the PC (because it doesnt flicker on this p4 2.0 machine) then using .move might help...
-
Jan 17th, 2003, 01:17 PM
#8
That was what I thought too....thanks Kleinma for backing me up..
-
Jan 18th, 2003, 12:08 AM
#9
Member
move actually is supposed to be faster than assigning the properties one by one.. so if it is flickering because of the speed of the PC (because it doesnt flicker on this p4 2.0 machine) then using .move might help...
That is but if he's making a game there wont be much of a difference. flickering would reduce but not die out, if using anything less than 1 GHz.
 ppl saw this
Die, ***** Die !
-
Jan 18th, 2003, 07:08 AM
#10
It aslo depends on the size of the shape. But I'm not so sure if he is making a game. I want to here what he is doing...
-
Jan 18th, 2003, 08:27 AM
#11
Ex-Super Mod'rater
Even if it is a game you'll need every bit of speed possible, mind its better if you only have one picture box and bitblt all your images to it rather than having loads of picture boxes, one for each image. Picture boxes like to use lots of memory.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 18th, 2003, 08:49 AM
#12
Originally posted by Electroman
Even if it is a game you'll need every bit of speed possible, mind its better if you only have one picture box and bitblt all your images to it rather than having loads of picture boxes, one for each image. Picture boxes like to use lots of memory.
If you had read his post, you would have seen that he is not using pictureboxes, but a shape. And of course if it is a game, he will need all the speed he can get. It's games that are pushing the PC to it's limit....
-
Jan 18th, 2003, 08:58 AM
#13
Ex-Super Mod'rater
opps my fault. Mind still sort of applies, if you use a picbox to cover the working area then blt to it, probably only be an advantage if you've got a lot of shapes tho. Even on my PC the shape control flickers tho when you move it (2.5GHz).
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 18th, 2003, 09:11 AM
#14
Yes I know. That is why I asked him to tell us what he was doing, so we maybe could tell him a bether way to do it. So I guess we just have to wait and see....
-
Jan 18th, 2003, 09:11 AM
#15
Member
Originally posted by Electroman
Even if it is a game you'll need every bit of speed possible, mind its better if you only have one picture box and bitblt all your images to it rather than having loads of picture boxes, one for each image. Picture boxes like to use lots of memory.
In that case better if he uses bitblt and not move for his game .
 ppl saw this
Die, ***** Die !
-
Jan 18th, 2003, 09:13 AM
#16
Or DirectX... ...I think we just have to wait and see what he want to accomplish...shall we???
-
Jan 18th, 2003, 09:17 AM
#17
Member
lets see, maybe its only a shape that moves, for kids in a kindergarten...lol
 ppl saw this
Die, ***** Die !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|