Wow, Thats nice. It almost looks as if I'm doing something scientific when I run that. Though when they start taking up a lot of screen space, it gets a bit.... whats the word..
boring i think will have to do.
There we go. Got it deleted.
Still, running it gives me a temporary, fleeting glimpse of a screen shot with two ovals placed, then it instantly becomes a black window.
Originally posted by NotLKH There we go. Got it deleted.
Still, running it gives me a temporary, fleeting glimpse of a screen shot with two ovals placed, then it instantly becomes a black window.
Private Declare Function RoundRect Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function AlphaBlend Lib "msimg32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal widthSrc As Long, ByVal heightSrc As Long, ByVal blendFunct As Long) As Boolean
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Form_Activate()
Dim t As Long, x As Integer, pCnt As Integer
Dim c(2) As Single
Randomize
t = GetTickCount
pCnt = UBound(p)
For x = 0 To pCnt
p(x).x = ScaleWidth * Rnd
p(x).y = ScaleHeight * Rnd
p(x).Vx = 1 * Rnd
p(x).Vy = 1 * Rnd
Next
Do
For x = 0 To pCnt
p(x).x = p(x).x + p(x).Vx
p(x).y = p(x).y + p(x).Vy
If p(x).x < 0 Then p(x).x = 0: p(x).Vx = Abs(p(x).Vx)
If p(x).y < 0 Then p(x).y = 0: p(x).Vy = Abs(p(x).Vy)
If p(x).x > ScaleWidth Then p(x).x = ScaleWidth: p(x).Vx = -Abs(p(x).Vx)
If p(x).y > ScaleHeight Then p(x).y = ScaleHeight: p(x).Vy = -Abs(p(x).Vy)
Originally posted by NotLKH hdc is also a property of a picturebox, so a hanging hdc, unatached to any parent control or form, is ambiguous, and imho NGCP.
I always use the Parent Controls name when using properties.
Outside of a with, I never do it any other way.
-Lou
Not attached?
It's in Private Sub Form_Activate()!
A with still needs a . before the call.
For example:
VB Code:
Private Sub Picture1_Click()
With Picture1
MsgBox hDC & " " & .hDC
End With
End Sub
I don't see how it's ambiguous, unless you can't read BASIC.
I think it's ambiguous too, and I can certianly read basic.
I also don't like your lack of indentation, and (understandable) lack of comments. I'm not impressed with the use of End either - a simple boolean removes the need for it.
anyway, the biggest issue is the fact that nothing seems to happen (as with NotLKH)
after a lot of fiddling (such as setting the scalemode to pixels, and changing the code to draw on the picturebox) I managed to get a few circles.. wow! so pretty
I see.. it makes sense that Win2000 doesn't have features that Win95/98 and WinXP have - as 2000 is based on NT, and XP combines features of NT and 95/98.
Private Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal BLENDFUNCT As Long) As Long
Private Declare Sub RtlMoveMemory Lib "kernel32.dll" (Destination As Any, Source As Any, ByVal Length As Long)
Originally posted by si_the_geek I think it's ambiguous too, and I can certianly read basic.
I also don't like your lack of indentation, and (understandable) lack of comments. I'm not impressed with the use of End either - a simple boolean removes the need for it.
anyway, the biggest issue is the fact that nothing seems to happen (as with NotLKH)
after a lot of fiddling (such as setting the scalemode to pixels, and changing the code to draw on the picturebox) I managed to get a few circles.. wow! so pretty
(I think AlphaBlend doesn't work on Win 2000 )
I didn't really care about the code's indention. It's pretty damn simple(I was asked for the source).