LineTo

gpmaker

Member
Joined
Jun 3, 2004
Messages
24
OK......i REALLY need help...ANYONE???

I'm using this code:
VB.NET:
[size=2][color=#008000][size=2][/size][/color][/size][size=2][size=2][size=2][/size][size=2][color=#0000ff]Dim[/color][/size][size=2] pn [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]Integer[/color][/size][size=2] = CreatePen(0, 2, 5) [/size][size=2][color=#008000]'13382655

[/color][/size]SelectObject(GetWindowDC(0), pn)

[/size]MoveToEx(GetWindowDC(0), [/size][size=2][color=#0000ff]CInt[/color][/size][size=2](drawx), [/size][size=2][color=#0000ff]CInt[/color][/size][size=2](drawy), 0)

LineTo(GetWindowDC(0), [/size][size=2][color=#0000ff]CInt[/color][/size][size=2](drawx + 1), [/size][size=2][color=#0000ff]CInt[/color][/size][size=2](drawy + 1))

[/size]

Ok, i'm using Getwindowdc(0), cause i wanted to draw on top of the screen, next, i tried using the 13382655 (suppose to be purple) but it ingores it and draws black. Now, the LineTo works...but it's ingoring the MoveToEx, so the line always comes from point 0,0 on the screen. anyone know wut i'm doing wrong????
 

mathpath

Active member
Joined
Aug 21, 2004
Messages
27
Programming Experience
10+
Could you double check the range of the parameters for CreatePen()?

If they expect numbers from 0-255, small numbers like 0,2, and 5 will give a very dark colour similar to black. You could try 180,70,180 if they range from 0-255.

Happy Programming.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
I thought I was pretty well versed in GDI+. Is your example .NET code? What classes do the CreatePen, SelectObject, MoveToEx, and LineTo methods belong? Just curious.
 
Top Bottom