|
-
Sep 8th, 2001, 09:00 AM
#1
Thread Starter
PowerPoster
ScreenDC and Setting Object Color
When drawing a line in the ScreenDC (eg. API MoveTo LineTo)
is there anyway to set the color?
There is no forecolor property for the Screen object.
API CreatePen also doesn't appear to work.
Thanks
David
-
Sep 8th, 2001, 02:26 PM
#2
Fanatic Member
Did you do something like this?
VB Code:
Dim DC As Long, hPen As Long, hOldPen As Long
DC = GetDC(0)
hPen = CreatePen(PS_SOLID, 1, vbRed)
hOldPen = SelectObject(DC, hPen)
MoveToEx DC, 200, 150, 0
LineTo DC, 600, 450
DeleteObject SelectObject(DC, hOldPen)
ReleaseDC 0, DC
I tried that myself, and it drew a red line on my screen like I expected.
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Sep 8th, 2001, 03:43 PM
#3
Thread Starter
PowerPoster
Lookes like my code, but mine just draws a black line.
Tried changing colors and still black.
I have a picbox showing on top of the screen, draw in picboxdc OK, then change to screendc and draw another line still on top of picbox. Only getting black lines - - color won't change so something else must be wrong.
Thanks for quick feedback.
David
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
|