PDA

Click to See Complete Forum and Search --> : Picture box graph ???


abdul
Feb 3rd, 2001, 08:04 PM
Hello guys!
I am building a small math program. I have a picture box and I have drawn a graph on it but now I want to put a point on the center of the picture with a different colour. It does not work. It just makes the graph and that's it!
Some help is needed!!!

Here is the code:
Dim i as long
Dim j as long
For i = 10 To Picture1.Width Step 10
Picture1.Line (i, 0)-(i, Picture1.Height)

Next
For j = 10 To Picture1.Height Step 10
Picture1.Line (0, j)-(Picture1.Width, j)
Next

Now I want to put a pixel in the center on the picture box like this:

Picture1.PSet (Picture1.Width / 2, Picture1.Height / 2), _ vbBlue

It makes the graph but does put the point.

Feb 3rd, 2001, 08:55 PM
Instead of using PSet, try this:

picture1.line(picture1.width / 2 + 10, picture1.height / 2 + 10)-(picture1.width / 2 - 10, picture1.height / 2 - 10, ,BF


i think the reason your code doesnt work is because
there are X number of twips in the width and height,
but only so many pixels. If you try only setting 1 point
to another color, it may not be able to show it, because
it is so very small. Then again, that may not be the
case. You may also want to try setting
picture1.autoredraw = true..

abdul
Feb 4th, 2001, 10:46 AM
Thanks!