PDA

Click to See Complete Forum and Search --> : creating a simple paint program


Jun 2nd, 2000, 05:38 PM
hi, i know nothing about using graphics in vb, so i have a couple of questions:

- how do i create a simple paint program so i could pick brush (image file) and smear it all over the place?

- i want to use a grid, so i could later add right click options to a specific square (or hex)

- how do i save and load my image (but no in a graphic methood, a simple location of each square in the grid)?

- i want to be able to determain the grid's x and y.

- i want to be able to put text on the image.

any help will be appreceated, what ever you know how to do please tell me.

thanks ahead.
Boaz zemeR

Jun 2nd, 2000, 08:19 PM
To scribble on the drawing, you could use the SetPixel and LineTo API calls.


Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Declare Function LineTo Lib "gdi32" Alias "LineTo" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long

PsyVision
Jun 3rd, 2000, 02:10 AM
I have created a simple paint program, I will sort the code out and stick it on the web soon, but!! I cannot make it so it saves the file to .bmp or whatever, any help??

Jun 3rd, 2000, 06:31 AM
Use the SavePicture method to save it.


SavePicture Picture1.Picture, "C:\MyPic.bmp"

PsyVision
Jun 3rd, 2000, 04:11 PM
Thanks Mate, I will try it now!!

Jun 3rd, 2000, 10:22 PM
Here's another note. ImageBox's only save in BMP format. PictureBox's save in whatever format the original Picture was.