Board index » delphi » i need help for a paint !

i need help for a paint !

i made a paint same of paint in windows i need create line, circles,
rectangles and pascal contains this instruccion but i need made that whit
the coordenates of the mouse and i don't made it because i get the first
coordenates the mouse and that is my point of start, when i pressbutton of
mouse i get that coordenates, later i get new coordenates for my end of the
figure and that i made very good but i don't create a new figure whit others
coordenates because the compiler get the last one and the new one.. what can
i do? help
 

Re:i need help for a paint !


Quote
luis guaqueta wrote:
> i made a paint same of paint in windows i need create line, circles,
> rectangles and pascal contains this instruccion but i need made that whit
> the coordenates of the mouse and i don't made it because i get the first
> coordenates the mouse and that is my point of start, when i pressbutton of
> mouse i get that coordenates, later i get new coordenates for my end of the
> figure and that i made very good but i don't create a new figure whit others
> coordenates because the compiler get the last one and the new one.. what can
> i do? help

Could you please rephrase this? What do you mean by "last one" and "new one"?
Figures or coordinates?

Re:i need help for a paint !


In article <Hdp82.532$E_3.70@news01>, lguaq...@telcel.net.ve says...

Quote
> i made a paint same of paint in windows i need create line, circles,
> rectangles and pascal contains this instruccion but i need made that whit
> the coordenates of the mouse and i don't made it because i get the first
> coordenates the mouse and that is my point of start, when i pressbutton of
> mouse i get that coordenates, later i get new coordenates for my end of the
> figure and that i made very good but i don't create a new figure whit others
> coordenates because the compiler get the last one and the new one.. what can
> i do? help

im not *entirely* sure what you mean here... but is this it..

you're trying to make a program which draws shapes, collecting the first
'start' coordinate with the first mouse click, then the second 'finish'
coordinate with the second click?.... except you are having problems,
because the second click overwrites the first-clicks variables (mouse
position)... well... this might help...

procedure get_coords(var xstart,ystart,xfinish,yfinish:word);
begin
        showmouse;
        repeat
                xstart:=getmousex;
                ystart:=getmousey;
        until button=1;  {i.e. mouse button 1 is pressed - may need to
                                change this for the mouse unit you're using}

        repeat until button=0;{needed to wait for release of mouse button}

        repeat
                xfinish:=getmousex;
                yfinish:=getmousey;
        until button=1;
        hidemouse;
end;

..then just call this from a main program & the two sets of coordinates,
the top-left corner, and bottom-right corner will be returned..

hope this is what you mean :o).. if not let me know... and if you need a
mouse unit (for all the getting of mouse x & y & button values), i'll
send you one too... i've got quite a few :o)

--
Martin Fitzpatrick
ICQ#: 11077801
AOL/CServeIM: Flupert

Other Threads