Results 1 to 6 of 6

Thread: creating a simple paint program

  1. #1
    Guest

    Question

    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

  2. #2
    Guest
    To scribble on the drawing, you could use the SetPixel and LineTo API calls.

    Code:
    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

  3. #3
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341

    Question

    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??

  4. #4
    Guest
    Use the SavePicture method to save it.

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

  5. #5
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341

    Exclamation

    Thanks Mate, I will try it now!!

  6. #6
    Guest
    Here's another note. ImageBox's only save in BMP format. PictureBox's save in whatever format the original Picture was.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width