|
-
Aug 12th, 2002, 07:28 PM
#1
Thread Starter
New Member
Flickering image problems
I'm trying to replace my cursor with a gif file that uses transparencies. I don't want to use custom cursors or icons for reasons of being limited to the amount of colors or size of the custom cursor.
I have it working somewhat. However, my graphic is flickering and I need to know how to make it stop.
my code is below.
Module code:
Type POINTAPI
x As Long
y As Long
End Type
Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long
Form code:
Option Explicit
Dim z As POINTAPI
Private Sub Timer1_Timer()
GetCursorPos z
imgHand.Left = z.x
imgHand.Top = z.y
End Sub
Any ideas on how to make it stop flickering? I don't have any experience with the bitblt command and don't know how to use it otherwise I'd probably use that route.
-
Aug 12th, 2002, 07:38 PM
#2
Thread Starter
New Member
well, I have other problems also. The graphic is appearing under controls such as buttons. I need it to appear on top of them. Not sure how to do that.
-
Aug 13th, 2002, 01:47 PM
#3
Try this...
VB Code:
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hWnd As Long) As Long
Private Sub LockWindow(lHandle As Long)
LockWindowUpdate lHandle
End Sub
Private Sub UnlockWindow()
LockWindowUpdate 0
End Sub
Private Sub Timer1_Timer()
LockWindow(Form1.hWnd)
GetCursorPos z
imgHand.Left = z.x
imgHand.Top = z.y
UnlockWindow
End Sub
-
Aug 13th, 2002, 04:10 PM
#4
Thread Starter
New Member
Nope, that doesn't work either. The image still flickers and it doesn't appear on top of the other controls.
I think I'm going to end up using a regular cursor, which really sucks. I'd rather have the eye candy.
I did find some code using bitblt that worked great. Only problem with that code is that it caused the CPU utilization to run at 100% when the application was running. Can't have that.....
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
|