Important alert: (current site time 7/16/2013 4:06:47 AM EDT)
 

winzip icon

A Paint program

Email
Submitted on: 8/4/1999
By: Ben Doherty  
Level: Advanced
User Rating: By 1 Users
Compatibility: VB 5.0, VB 6.0
Views: 42811
(About the author)
 
     This program allows users to choose a color and pen size to draw on a picture box and the user can also make circles and fill the picture box with a certain color. ****UPDATED**** August 14. New tools include Circular Gradient maker and Gradient maker,eye dropper and I also put the tools into a list box so it is easier to find. I also improved the pen tool so it doesn't skip.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
8/4/1999 5:59:00 PMBen Doherty

If you have any questions or comments, please email me

(If this comment was disrespectful, please report it.)

 
8/7/1999 9:40:00 PMIan Ippolito

FYI,
This gave me a slight problem due to a reference to a file that I don't have:the API declaration loader. After removing it from the references howver, the program worked fine.
(If this comment was disrespectful, please report it.)

 
8/13/1999 5:23:00 PMnone

Does it save the image?
(If this comment was disrespectful, please report it.)

 
8/13/1999 7:22:00 PMBen Doherty

Nope, it doesn't save. What i have tried hasn't worked, but im still working on new tools and a better pen tool (It doesn't skip).
(If this comment was disrespectful, please report it.)

 
8/18/1999 12:04:00 PMRandal

To save the contents of the picBoard picturebox use the SavePicture function.

Example:

SavePicture picBoard.Image, "c:\TEST2.BMP"

This would save the contents of picBoard to "c:\test2.bmp".

To load a picture from a file use LoadPicture.

Example:

Set picBoard.Picture = LoadPicture("c:\TEST2.BMP")

This would load the "c:\test2.bmp" into picBoard.
(If this comment was disrespectful, please report it.)

 
8/26/1999 12:56:00 PMhamzi

thanks about the examples

(If this comment was disrespectful, please report it.)

 
9/13/1999 7:06:00 AMlewis

Does anyone know how to resize a picture inside a picture box? If you can help me, please email me. Thanks.
(If this comment was disrespectful, please report it.)

 
10/8/1999 3:06:00 AMTroy

you should use a commondialog to open and save. use this!

Private Sub mnuFileOpen_Click()
CommonDialog1.Filter = "BMP (*.bmp)|*.bmp|gif" & _
"(*.gif)|*.gif|JPG (*.jpg)|*.jpg"
CommonDialog1.ShowOpen
Set picBoard.Picture = LoadPicture(CommonDialog1.FileName) '("c:\TEST2.BMP")


End Sub

Private Sub nmuFileSave_Click()
CommonDialog1.Filter = "BMP (*.bmp)|*.bmp|gif" & _
"(*.gif)|*.gif"
CommonDialog1.ShowSave

SavePicture picBoard.Image, CommonDialog1.FileName

End Sub
(If this comment was disrespectful, please report it.)

 
10/8/1999 7:21:00 AMSteve

Interesting, but I could show you a couple of tricks to improve your effects. For instance since I have started messing with this program i improved the circle function to work more like MS paint, and added a line function, as well as I changed to gradient function to work much like photoshop's version does. I don't know if anyone would like to see that, if you do I can upload it.
(If this comment was disrespectful, please report it.)

 
10/20/1999 5:57:00 PMMax Adams

Pretty nice project, but it needs a save and open option. Pretty cool though, keep up the good coding!

-Max
(If this comment was disrespectful, please report it.)

 
10/24/1999 9:29:00 PMBen Doherty

Thank you all for your feed back, sorry i haven't updated in awhile, i will be updating this as soon as possible with many new tools, and mabye a new interface. So Check back by next saturday and it should be up.
-Ben
(If this comment was disrespectful, please report it.)

 
12/30/1999 4:25:56 PMInFeStEd-ArCh0n

Dudes, BTW, when you fill a color you don't have to fill the entire picture box. You can fill just areas of the same color. Check this out:

Private Declare Function ExtFloodFill Lib "Gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long, ByVal wFillType As Long) As Long
Private Sub ThePik_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

ThePik.FillColor = RGB(0, 0, 0)
ExtFloodFill ThePik.hdc, X / Screen.TwipsPerPixelX, Y / Screen.TwipsPerPixelY, ThePik.Point(X, Y), 1

End Sub

Of course you don't have to divide the X and Y by the twips per pixels, since the X and Y are in twips I had to change them to pixels because the API call requires it.
(If this comment was disrespectful, please report it.)

 
2/19/2000 8:07:10 AMMichael

i added a Load & Open to this
& make it work over the network :)
As well as single mode....
(If this comment was disrespectful, please report it.)

 
7/24/2000 11:44:17 PMRyan

the paint bucket only changes the background color.
(If this comment was disrespectful, please report it.)

 
3/20/2002 7:53:39 PMspider

i noticed that too.
(If this comment was disrespectful, please report it.)

 
8/29/2002 2:48:41 AMDark Syphom

No offence... but how did this program win?
(If this comment was disrespectful, please report it.)

 
3/15/2003 2:10:49 PM

yeah... i agree... how could something like this win... it is nice and it well coded... but win with 111 votes :o
hmmm... check out http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=30854&lngWId=1
now< /span> this is one cool sweeeeeeet paint program :D
(If this comment was disrespectful, please report it.)

 
3/15/2003 7:11:03 PMBen Doherty

Ok listen up...
Back in August of 1999 when I submitted this program, the programs of the Month were decided by the owner of this website. The voting didn't exist back then, or it had just started, I don't exactly remember. Also, this was the very first paint program on Planet Source code. At the time this was excellent code. Since then people have taken the paint program idea and improved exponentially. So that's why this program won back in 1999.
(If this comment was disrespectful, please report it.)

 
11/8/2004 5:51:54 PM

i will be glad if u help me.
i want to know how to a backaground picture will be move continously like a plane game semms plane is running but faster
(If this comment was disrespectful, please report it.)

 
3/15/2005 12:23:39 PMWilliam -

cant download...the servers slow again
(If this comment was disrespectful, please report it.)

 
5/16/2005 1:41:49 PM

Call SavePicture(Picture1.Image,
(If this comment was disrespectful, please report it.)

 
5/16/2005 1:44:24 PM

Picked this up from the VB6 newsgroup:

Call SavePicture(Picture1.Image, "C:\temp\picture2.bmp")
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.