|
-
May 25th, 2010, 06:10 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Using bitblt and labels on form flash. Why is that and how do i stop it?
Im using bitblt on a form. the bitblt works just fine. But, the labels i am using flash sometimes... how can i stop this?
-
May 25th, 2010, 07:19 PM
#2
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
It may happen when window gets refreshed/redrawn - try using LockWindowUpdate api function:
Code:
Option Explicit
Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
'somewhere in your code
LockWindowUpdate Me.hWnd
'your main code goes here
LockWindowUpdate False
-
May 25th, 2010, 07:27 PM
#3
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
do i put the LockWindowUpdate Me.hWnd before i do the bitblt? and then the LockWindowUpdate False after its done? i did that, and i put it at the total end and beginning of the code, and it doesnt work.....
Could it be because i am using a timer?
Last edited by Gamemaster1494; May 25th, 2010 at 07:31 PM.
-
May 25th, 2010, 07:41 PM
#4
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
 Originally Posted by Gamemaster1494
Could it be because i am using a timer?
It could be a lot of things - you just try elliminating one at the time...
-
May 25th, 2010, 07:42 PM
#5
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
well, the code you gave me didnt work....
-
May 25th, 2010, 07:56 PM
#6
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
LOL, it's not the snippet I posted - rather what you do that interfers.
-
May 25th, 2010, 08:03 PM
#7
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
.... so... what should i do? xD
-
May 26th, 2010, 01:12 AM
#8
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
Don't use labels. Use .Print, or DrawText API.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
May 26th, 2010, 03:02 PM
#9
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
.... Can they click on that? And, how would i use it to replace the lables? =P
-
May 27th, 2010, 02:51 AM
#10
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
You can keep the label there as a fully transparent area if you like....
In which case you can also use the label's position to draw the text.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
May 27th, 2010, 10:02 AM
#11
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
Yeah. I have it transparent... How do i draw the text where the labels position would be? All i know is
Print "Hi"
No idea on how to make it a certain position...
-
May 27th, 2010, 01:09 PM
#12
Hyperactive Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
How do i draw the text where the labels position would be?
draw the text to the labels position
Code:
label.Left
label.Top
label.Width
label.Height
-
May 27th, 2010, 09:15 PM
#13
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
Okay.... But how would i set it up?
Print "Hi", 31, 31, 40, 38
? how?
-
May 27th, 2010, 09:39 PM
#14
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
.CurrentX = Label1.Left
.CurrentY = Label1.Top
.Print "Hi"
WordWrap would need multiple calls to Print, or a single call to DrawText with the DT_WordBreak const/flag.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
May 27th, 2010, 09:51 PM
#15
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
Okay... I am totaly confused... do i do
With Wordwrap
.CurrentX = 10
.CurrentY = 10
.Print "Hi"
End With
to print it?
Okay. Instead, is there another thing that will stop the label from flashing? Because i would have to go threw all of the code i already have with the labels....
-
May 27th, 2010, 10:11 PM
#16
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
Wordwrap is a property on a label.... That enables or disables wordwrap. Wordwrap is where it wraps text(words) onto a new line. It's not a control. It's not an object.
CurrentX and CurrentY are properties on a form, and picturebox. Print is also a method for form's, and picturebox's.
When do they flash? Regardless, have you tried setting their container's(again picturebox's or form's) AutoRedraw to True?
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
May 27th, 2010, 10:33 PM
#17
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
Yeah. All autoredraw = true...i have the background of the form(using bitblt vbSrcCopy) moving. every so often, all the lables start flashing. not all at once. Different ones at different times...
-
May 27th, 2010, 10:40 PM
#18
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
Yea, you'll want to draw that text manually.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
May 27th, 2010, 10:45 PM
#19
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
....XD I am so sorry. I must be tired or something... I have no idea what you mean. Is there some sample you can give me? It would really help.
All i know how to do is
Print text1.text
Print text2.text
and it does it one line after the other... no specific area, or width, height, etc...
-
May 27th, 2010, 10:52 PM
#20
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
You're printing on a form?
vb Code:
Me.CurrentX = Label1.Left
Me.CurrentY = Label1.Top
Me.Print "Hi"
'[B]OR[/B]
Form1.CurrentX = Label1.Left
Form1.CurrentY = Label1.Top
Form1.Print "Hi"
'Picturebox?
Picturebox1.CurrentX = Label1.Left
Picturebox1.CurrentY = Label1.Top
Picturebox1.Print "Hi"
Or something like:
vb Code:
Private Type tLabel
lX as Long
lY as Long
sCaption as String
bNewLine as Boolean
End Type
Private myLabels() as tLabel
bNewLine could enable an optional check to split the sCaption on vbCrLf or vbNewline, or similar, and to print multiple lines. DrawText API can use a set width, and wrap automagically.
Further more, TextWidth and TextHeight (both of these functions are members of Form and PictureBox) will return metrics for a string passed to them.
Last edited by FireXtol; May 27th, 2010 at 10:59 PM.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
May 27th, 2010, 11:08 PM
#21
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
Oh.... xD i didnt know there was a currentx and currenty of the form. XD thanks. Ill try it out.
-
May 28th, 2010, 06:14 PM
#22
Thread Starter
Fanatic Member
Re: Using bitblt and labels on form flash. Why is that and how do i stop it?
Yeah. It worked Perfectly. Took a bit of adjustment. But it worked. Thanks so much! =D
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
|