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 / making a paint program

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 10th Oct 2005 12:53
i am currently working on a paint program but it seems the refresh rate is not fast enough to draw properly was wondering if there was a way to fix this.

i am using a code simular to this one
while mouseclick()=1
circle mousex(),mousey(),2
endwhile
ty

A child's dream never dies.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Oct 2005 13:04
The 2D commands such as circle, dot, etc are not particularly fast.

You're also not SYNCing in that code. You won't see the results until you stop clicking your mouse. If you are letting Windows SYNC for you, it could be very unpredictable.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Oct 2005 14:29
BatVink is correct about the speed of 2D commands, but don't abandon the idea - they are not so slow as to make them unusable - it's a good learning tool too.

To help you on your way, I just did the code for drawing a circle for you...



TDK_Man

UFOs other account lol
19
Years of Service
User Offline
Joined: 3rd Jun 2005
Location: Somewhere :)
Posted: 11th Oct 2005 02:42
Can't you just do this?

It seems fast enough.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Oct 2005 02:55
Quote: "Can't you just do this?"


Apart from the fact that your code won't run?...

Seriously though, what use is a paint program where you can create any size circles... as long as their radius is 3?

TDK_Man

UFOs other account lol
19
Years of Service
User Offline
Joined: 3rd Jun 2005
Location: Somewhere :)
Posted: 11th Oct 2005 03:04 Edited at: 11th Oct 2005 03:06
I wasa just typing it in the code thing. I made a mistake with the syntax. I remember doing this before, that is how I knew it ran pretty fast.
Here is the fixed code:

I don't mean they have to have a radius of three, it was an example. I was just wondering if it is really that much faster. I am not saying you are wrong or anything.

Edit: Oh, never mind. I thought you were just trying to make a program that just make tons of circles where you clicked.

Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 11th Oct 2005 03:05
sync on
sync rate 0
do
If mousebutton() = 1 circle mousex(),mousey(),3
sync
loop

You forget the 'then' in the IF case buddy...
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 11th Oct 2005 03:05
Ahh, posted just as I did.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Oct 2005 07:45
Green Bunny

Don't worry - I'm regularly posting answers before I read the questions properly.

Sometimes I'd be knackered without the Edit Post button!

TDK_Man

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Oct 2005 06:36
Smerf, if you don't respond to your own posts, you will just tick people off, and they won't bother replying to any other questions you ask in the future.

There have been a few newcomers doing this just recently, so it isn't just you.

If you don't have regular access to the forums, mention it in your post so we all know you may not be able to get back for a few days.

TDK_Man

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 14th Oct 2005 05:45
i did respond to this post dont know what happened mabey it was removed. but doubt it replyed to it about a week ago.
anyway what was said in that post was

you cannot read text from a bitamp so i was going to create a second variable to to keep track of the inmput in my program or write it in a diferent language.
a ftp program really ist for dark basic due to the ammount of file acess. and lack of navigation through a gui.
was considering delphi or vb. dont get me wrong i love db just its not really built to be anything other thant a game engine.

and i may sometimes go 5 or six days without posting i do work a full time job somtimes 17 hour shifts. and had several doctors appointment the last week for a umbilical hernia outch!!

A child's dream never dies.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Oct 2005 07:51
Quote: "you cannot read text from a bitamp so i was going to create a second variable to to keep track of the inmput in my program or write it in a diferent language.
a ftp program really ist for dark basic due to the ammount of file acess. and lack of navigation through a gui.
was considering delphi or vb."


Sorry - I don't see the connection with drawing circles?!

TDK_Man

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 17th Oct 2005 11:08
dangit so sorry. i usually post prett late in the evening around 1 or 2 oclock. got my two posts mixed up dont know how.
What i was wanting to say is the refresh rate seems to e to slow with dbasic when drawing a crirlc or any other item to the screel on the current mouse position it leaves a trail and the fadster the mouse moves the longer the distance becomes between the previous circle and the current circle so in stead of a line you get a choppy line was wondering how you fix that tryed all the ynce commands and have had no luck

A child's dream never dies.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Oct 2005 02:08
Are you saying that the code snippet I posted above was slow or left trails behind on your machine? Ran fine for me.

If this is the case for you, then there may be a problem with your machine - possibly graphics drivers need updating.

If you just run the snippet on it's own (don't paste it into your own code before running it) and it runs OK, then you know the problem is in some other part of your program.

TDK_Man

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 19th Oct 2005 11:15
hmm ok. nice snippet tdk howevcer i do not want to resize circles or even make cirlces for that matter. as a said before i want to be ablue to use (pictures circles squares bitmpa whatever at the mouse position to draw with as in any other paint program like say for example i wanted to draw a house. open up microsoft paint . and draw on the screen that is basicallt what i want to do.
circles are squares are going to be just for the convienence of choosing a brush size.

A child's dream never dies.

Login to post a reply

Server time is: 2024-11-27 14:33:39
Your offset time is: 2024-11-27 14:33:39