[fpc-pascal] interactively draw an ellipse
ewald at yellowcouch.org
Wed Jan 23 12:35:38 CET 2013
Quite easy. Abstract concept:
- Take one framebuffer `ImageBuffer`, whose contents is the final image
- Take another framebuffer `InteractionBuffer` whose contents is
everything that's interactive
- The InteractionBuffer shall be an overlay of the imagebuffer
So when you want to draw it interactively, you draw the ellipse in
InteractionBuffer, and once the user confirms that `yes draw what I see
right now`, you simply draw the ellipse in the ImageBuffer and clear the
InteractionBuffer. If you want to update the interaction buffer with a
new ellipse, you clear it and draw the new ellipse.
As for the third party library: how could you expect for a third party
library to give you such lazarus-specific functionality?
Anyway, hope it helps.
Once upon a time, on 01/23/2013 11:27 AM to be precise, duilio foschi said:
> this code
> will draw 10 ellipses on Image1.
> However, I want to do it interactively, like it is done in Photo-Paint.
> The ellipse should be contained in a rectangle R whose upper-left
> corner is given by the original position of the mouse on screen.
> And the bottom-right corner of R will be the final position of the mouse.
> During dragging, a temporary ellipse should be shown on screen and the
> mouse will be cross-shaped.
> Any idea re how to do it ?
> An unexpensive well debugged 3th-party library would be the ideal
> solution (as I don't plan to work in graphics in the future).
More information about the fpc-pascal