I think I'm getting the hang of this.(?)
So this code works when the autoredraw property is set to true. But only if I have the picture = image lines. This is okay, though. Only problem is: how do I clear out the picture property? Is there a way to do it besides just coloring over all my drawings with gray and then setting picture to image again? Also, what if I want to draw the shell's path? Will I have to set the picture to image every time I draw a pixel? That's what it seems like but that is pretty ridiculous.
Private Sub Command1_Click()
Dim FormDC As Long
Dim BackDC As Long
Dim OldBrush As Long
Dim OldPen As Long
Dim NewBrush As Long
Dim NewPen As Long
Dim Color As Long
NewPen = CreatePen(PS_SOLID, 9, &HFF)
OldPen = SelectObject(Form1.hdc, NewPen)
NewBrush = CreateSolidBrush(&HFF)
OldBrush = SelectObject(Form1.hdc, NewBrush)
Rectangle Form1.hdc, 50, 50, 100, 100
Form1.Picture = Form1.Image
SelectObject Form1.hdc, OldBrush
SelectObject Form1.hdc, OldPen
Rectangle Form1.hdc, 50, 50, 100, 100
Form1.Picture = Form1.Image
DeleteObject NewPen
End Sub
P.S. I still can't get the createcompatibleDC thing to work. Or maybe the DC works, but when I draw to it and try to blit it to my form it doesn't work. If anyone would like to look at my code, I'll put it in a new reply; this one is getting pretty lenghty.