Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
Graphics
(Moderator:
Ask
) »
(Solved) selected area with rectangle
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
FPC Unleashed (async/awai...
by
Thaddy
[
Today
at 09:38:12 am]
TCHATGPT — An Artificial ...
by
Thaddy
[
Today
at 09:11:03 am]
Lazarus for Windows on aa...
by
szlbz
[
Today
at 08:35:13 am]
Slow app start on M5 MacB...
by
Thaddy
[
Today
at 06:34:10 am]
Review from FreePascal
by
n7800
[
Today
at 05:27:49 am]
Rounding issues (only wit...
by
Thaddy
[
Today
at 04:51:47 am]
Some Lazarus documentatio...
by
dsiders
[
Today
at 03:09:48 am]
Network drop and firewall
by
kupferstecher
[July 21, 2026, 07:11:07 pm]
How to check my own certi...
by
LeP
[July 21, 2026, 05:04:49 pm]
How can I get names of CO...
by
Thaddy
[July 21, 2026, 04:55:08 pm]
Accessing VRAM memory wit...
by
Thaddy
[July 21, 2026, 01:31:19 pm]
Fixed an RV32ec compiler ...
by
ccrause
[July 21, 2026, 12:04:05 pm]
[SOLVED} Copying existing...
by
Davo
[July 21, 2026, 11:59:45 am]
TDWEdit
by
Ed78z
[July 21, 2026, 09:53:10 am]
Elite Arcade
by
Zvoni
[July 21, 2026, 08:17:20 am]
Which quantized model wor...
by
LeP
[July 20, 2026, 10:34:07 pm]
PasFLTK - Binding for FLT...
by
Dibo
[July 20, 2026, 10:26:31 pm]
[Closed]Indy10 hangs the ...
by
marcov
[July 20, 2026, 03:52:59 pm]
Lazarus components
by
threedslider
[July 20, 2026, 02:37:23 pm]
Many recent books on Laza...
by
threedslider
[July 20, 2026, 02:27:45 pm]
[Solved]Setting the CURSO...
by
jamie
[July 20, 2026, 11:33:52 am]
FastCGI vs. CGI
by
egsuh
[July 20, 2026, 06:33:08 am]
I have made some progress...
by
onionmixer
[July 20, 2026, 12:32:08 am]
Lazarus Bugfix Release 4....
by
n7800
[July 19, 2026, 10:59:09 pm]
Can not load postgres cli...
by
martinm
[July 19, 2026, 10:17:31 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: (Solved) selected area with rectangle (Read 5368 times)
xinyiman
Hero Member
Posts: 2261
(Solved) selected area with rectangle
«
on:
July 23, 2012, 04:09:53 pm »
Who tells me how do I create a rectangle (with dotted lines) on a TImage when I select a part of? And how do I determine the coordinates of the selected area?
«
Last Edit: July 27, 2012, 11:30:23 am by xinyiman
»
Logged
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1
KpjComp
Hero Member
Posts: 680
Re: selected area with rectangle
«
Reply #1 on:
July 23, 2012, 04:17:42 pm »
So that you don't modify the TImage itself, what you can do is place a TPaintBox over the top of the TImage. And then draw you dotted lines on the TPaintBox OnPaint event.
To make it so the user can move/size the rectangle you could place even more TPaintBox's or TShape's for the Handles, and the use the following technique to do the moving. ->
http://www.lazarus.freepascal.org/index.php?topic=17356.0
Logged
xinyiman
Hero Member
Posts: 2261
Re: selected area with rectangle
«
Reply #2 on:
July 27, 2012, 10:23:27 am »
Ok, doing a bit of evidence I think I have figured out how. I only have a doubt! How do I clean the TPaintBox riseleziono when another part of the object?!
So how can I delete the rectangles already created in TPaintBox?!
Logged
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1
xinyiman
Hero Member
Posts: 2261
Re: selected area with rectangle
«
Reply #3 on:
July 27, 2012, 11:08:48 am »
I understand that you have to use the property invalidated. Except that when I use it and then drawing a rectangle in succession I do not keep! I delete it. How can I do?!
Logged
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1
xinyiman
Hero Member
Posts: 2261
Re: selected area with rectangle
«
Reply #4 on:
July 27, 2012, 11:30:06 am »
I solved in this mode
PaintBox1.Invalidate;
PaintBox1.Refresh;
PaintBox1.Canvas.Rectangle(x_SelIniz,y_SelIniz,x,y);
Logged
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
Graphics
(Moderator:
Ask
) »
(Solved) selected area with rectangle
TinyPortal
© 2005-2018