Ruslan 5 Posted May 22, 2020 Maybe a stupid question but not for me at the moment. Need a way to draw rectangles on a canvas and then to make it possible to resize, move, delete or clone. That is needed to automate some process of segmentation objects (same kind of objects by rectangles with same aspect ratio) on a bunch of images (>100K). For now I can draw rectagles on a TImage canvas wthout any questions. But can't figure out how to select that rectangle with mouse, resize it, scale it and move. Or maybe should I look at shapes? Share this post Link to post
Rollo62 536 Posted May 22, 2020 (edited) Yóu can draw like this. But the Canvas is a raster-based area, which doesn't contain graphical objects. So the only way would be to re-paint the objects, as you like. Usually this is done via FrameBuffer bitmaps, where you can do the clearing and drawing, and then paint the whole frame buffer to the canvas each frame (or when changed). Edited May 22, 2020 by Rollo62 1 Share this post Link to post
M.Joos 30 Posted May 22, 2020 I would not draw directly on the canvas. Use TShapes. You may also want to have a look at this selection component that is part of FMX: TSelection 1 Share this post Link to post
FranzB 0 Posted August 27, 2020 use TPath and change before drawing again or use TObjectList and always draw the full objectlist , individual items are rects ..... Share this post Link to post
Anders Melander 1783 Posted August 27, 2020 Instead of reinventing the wheel why not try one of the many existing solutions. For example Graphics32 or Image32. Here's a shot of an old demo of the GR32_Objects unit: and here's one of a similar Image32 demo: Share this post Link to post