Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / microsoft paint

Author
Message
gsd
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: London
Posted: 12th May 2004 16:25
out of complete boredom and my inability to make a better game than hangman (which by the way ran at a healthy 600fps and will be the only thing ill ever complete), ive decided to create something similar to mspaint.
ive already done some very simple code to draw pencil lines but have a few questions which somebody may know the answer to..
firstly if you draw a line in mspaint it will never have gaps so it must use some method to compensate for areas in between the pencil marks it picks up in the loop. im sure this is very easy to do, just a simple check to see if mouseclick is still flagged and then fill in the dots but i just want to see if this is how it really works. sorry if ive confused anyone.
also if you create a bitmap 512x512 pixels paint must hold color data for each pixel. i have an array like pixels(imagewidth,imageheight,3) which holds 3bytes (3 colors) for every pixel. i work this out to be 512 * 512 * 3 = 768kb. so this must be all the bmp format holds? also if anyone knows anything else id need to know to finish all the functions of paint then please advise me. thanks

gsd
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 12th May 2004 16:36 Edited at: 13th May 2004 01:18
I would guess paint gets around the jumpy mouse movement by drawing a line between the current mouse position and the last position of the mouse. Like this.


[beat the machine that works in your head]
gsd
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: London
Posted: 12th May 2004 16:57
well thats ok for looking at the lines you draw but the line data needs to be put in my array. currently, by drawing on the image i set array data with the current color and then read through all the pixels and use the 'dot' command to update the image. im not too sure if this is the best way of doing it.

gsd

Login to post a reply

Server time is: 2024-11-26 17:39:59
Your offset time is: 2024-11-26 17:39:59