Hi,
I wanted to find out a quick way to paint grid dots in a PictureBox or directly on a form? What I'm talking about is the same grid dots that are on the form in design view in VB.
Any help would be appreciated..
Dan
Printable View
Hi,
I wanted to find out a quick way to paint grid dots in a PictureBox or directly on a form? What I'm talking about is the same grid dots that are on the form in design view in VB.
Any help would be appreciated..
Dan
This is the quickest way I know of:
A little explination may be in order... My form was in the default of twips (this can also be done on a picture object) I found that there is 135 twips between each point in the VB grid (by making the smallest Shape object possible and looking at width/height). The vb red is a red dot, obviously, so change that if you need to. But its pretty straight forward.VB Code:
For i = 0 To Me.Width Step 135 For j = 0 To Me.Height Step 135 Me.PSet (i, j), vbRed Next j Next i
Hope this helped!
NOMAD
use a loop
set the scalemode of the form to pixels
code:
option explicit
Dim A%
dim B%
private sub command1_click()
for a% = 0 to form1.scalewidth step 50
for b% = 0 to form1.scaleheight step 50
form1.pset (a,b)
next a%
next b%
end sub
hope this works, i haven't had a chance to try it out.
Thanks! Now how would I be able to clear the dots off the form?
There is a slight problem when painting the dots in a PictureBox.
When I move a control around at run time when it is a child of the PictureBox and I have drawn the dots, the dots get wiped out as I move the control around.
Is there a way to prevent the dots from being erased?
I've been struggling with that for weeks! I'm just tring to save the images though.
I did some experimenting and found you can copy the image to a buffer picture object using bitblt. This buffer if set to autoredraw = TRUE and visible = FALSE will let you use bitblt on it like you would for any game with an invisible sprite picture object.
Follow? Just ask and I'll ********!
NOMAD
Put the code in the Picture_Paint and set AutoRedraw to True.Quote:
Originally posted by dbassettt74
There is a slight problem when painting the dots in a PictureBox.
When I move a control around at run time when it is a child of the PictureBox and I have drawn the dots, the dots get wiped out as I move the control around.
Is there a way to prevent the dots from being erased?