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 / connecting the boxes?

Author
Message
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 26th Jan 2006 06:26
hey. i have a paint program im working on but when i click and move the mouse
around i put a box on the screen but if i move the mouse fast the boxes seperate
out. does anyone have an idea of how to make the boxes ALWAYS stay together?

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Jan 2006 09:14
You would need to interpolate the points. So, instead of just drawing a box at the mouse point, you need to work out all the necessary points between the last position and the new one.

Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 26th Jan 2006 16:27
how would i do that? could i get an exable please

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 27th Jan 2006 13:51
If it's just dots you simply draw a line from last mouse coordinates to new mouse coordinates.



Boo!
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 27th Jan 2006 14:07
Using a box of size 5 by 5, you have to do as BatVink says and draw boxes between last mouse position and current position;



Boo!
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 27th Jan 2006 16:01
Awesome! now how would i change the brush size?

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 27th Jan 2006 18:09
I'm not doing all the code for you!

The program is so small that it should take you about 10 seconds to change brush size. Experiment with the box commands. If you can't manage that then you have no chance writing a fully fledged paint proggy.

Boo!
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 27th Jan 2006 23:21
nvm. i figured out how to do it. thanks Spooky!

Login to post a reply

Server time is: 2024-11-27 05:28:40
Your offset time is: 2024-11-27 05:28:40