|
-
Nov 15th, 2001, 10:14 PM
#1
Thread Starter
Fanatic Member
Using Line (I cant work out where i have gone wrong)
Hi chaps me again !!!
im trying to draw a line around the edge of a picture box
my code seems fine it doesnt gereate any errors but i dont get a line either can someone check my math is right ??
ps i have tried setting the scalemodes to pixel as well as twipsperpixel
this example is in twips where 6 twips = pixel
VB Code:
Private Sub Form_Load()
frm1.ScaleMode = 1
pic1.ScaleMode = 1
drawbox
End Sub
Public Sub drawbox()
Dim LTop As Integer
Dim LBottom As Integer
Dim Lleft As Integer
Dim LRight As Integer
pic1.Cls
LTop = pic1.Top + 6
LBottom = pic1.Top + pic1.Height - 6
Lleft = pic1.Left + 6
LRight = pic1.Left + pic1.Width - 6
pic1.DrawWidth = 6
pic1.Line (Lleft, LBottom)-(LRight, LBottom), RGB(127, 157, 185)
pic1.Line (LRight, LBottom)-(LRight, LTop), RGB(127, 157, 185)
End Sub
any Ideas people??
-
Nov 15th, 2001, 10:19 PM
#2
Thread Starter
Fanatic Member
Never mind i found out where i went wrong lol
I forgot to ake the picture box Autoredraw property to True
DOH
-
Nov 16th, 2001, 05:47 PM
#3
Frenzied Member
Eh, you should use
0 for left and top
and
scalewidth instead of left + width
and
scaleheight instead of top + height
-
Nov 16th, 2001, 06:03 PM
#4
Conquistador
Doesn't a line have to be given 4 points?
I don't think you've passed 4 points to it...
-
Nov 16th, 2001, 06:19 PM
#5
-= B u g S l a y e r =-
??
pic1.Line (0, 0)-(pic1.ScaleWidth - 15, pic1.ScaleHeight - 15), , B
seems u do alot for little... ?
-
Nov 16th, 2001, 06:57 PM
#6
Frenzied Member
Originally posted by da_silvy
Doesn't a line have to be given 4 points?
I don't think you've passed 4 points to it...
Who is this to?
OK #1 you pass 2 points ( a line is defined by 2 points in case you haven't taken algebra 1 yet )
And both rudvs2's code and mine passes 2 points.
-
Nov 16th, 2001, 07:48 PM
#7
PowerPoster
i think he was referring to a rectangle having 4 lines. Rud's code only had 2 (bottom and right). But anyway, Peeeeeeet is the scandi god and is right that a B (for box) line method is much easier (or even a shape control).
rud's whut yuh dun mut, yuh furgut huh tuh pruhgrumm??
-
Nov 16th, 2001, 10:08 PM
#8
Conquistador
Originally posted by mlewis
Who is this to?
OK #1 you pass 2 points ( a line is defined by 2 points in case you haven't taken algebra 1 yet )
And both rudvs2's code and mine passes 2 points.
OK FINE
You wanna go me? Bring it
To put a line on the screen
you need four values
X1, Y1, X1, Y2
I've done Algebra
I'm on a scholarship to my school
I've got full marks on 6 out of the last 7 maths tests...
And I'm probably going to do Year 11 maths next year (although i'll be in year 10)
Anything else you want to know?
I'm not a dumb ass you tool
Last edited by da_silvy; Nov 16th, 2001 at 10:16 PM.
-
Nov 16th, 2001, 10:13 PM
#9
-
Nov 16th, 2001, 10:15 PM
#10
Conquistador
Well he keeps on having cracks at me.
i'm really starting to get quite pi$$ed off too
-
Nov 16th, 2001, 10:37 PM
#11
Frenzied Member
Jeez da_silvy...calm down and quit taking everything so personally.
Although you have the right to your opinion, and you are allowed to say that you dislike me, please do not do so in your signature.
You are perfectly correct that a line needs X1, Y1, X2, Y2; I agree.
However: (X1, Y1) is one point, and (X2, Y2) is the second.
Therefore you need 4 values, but 2 points.
None of this is intended to flame you, "have cracks" at you, or anything of the kind. These forums are here so people can share the knowledge and experience they have with others. Its OK to be wrong; I've been wrong many more times than most people I know, probably including you. If you don't make mistakes, you can't learn from them, right?
Don't take this so hard, and please don't be so antagonistic, or treat me like I am trying to cut you down. This is not my intent.
This is the second time I've had to do this; let's not have it happen a third time OK?
:: offers to shake hands, shutup, and never bug you again (well, maybe I'll bug you again in a looooong time ) ::
-
Nov 16th, 2001, 10:43 PM
#12
Conquistador
OK then
Thats alright
I meant to say values before.
Truce now
-
Nov 16th, 2001, 10:46 PM
#13
Frenzied Member
Truce...*whew*
Nice signature btw
-
Nov 16th, 2001, 10:50 PM
#14
Conquistador
-
Nov 16th, 2001, 10:53 PM
#15
Frenzied Member
I haven't eitherhrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrr
HUh?!?? What?!? oh, oops sorry...fell asleep at the keys again.
-
Nov 16th, 2001, 10:57 PM
#16
Conquistador
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
|