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
IndySecOpenSSL is now ava...
by
LeP
[
Today
at 08:41:00 am]
Gitlab site history date.
by
Martin_fr
[
Today
at 08:35:38 am]
Dataset EnableControls/Di...
by
Sharfik
[
Today
at 07:40:21 am]
TVirtualDBTreeEx and upda...
by
Sharfik
[
Today
at 07:36:30 am]
made hooking newinstance ...
by
Thaddy
[
Today
at 06:56:17 am]
XLibre, finally and fortu...
by
kagamma
[
Today
at 06:50:42 am]
Interesting video
by
Curt Carpenter
[
Today
at 04:28:27 am]
Printer Info
by
rvk
[
Today
at 02:50:05 am]
how to add a ForEach call...
by
cdbc
[
Today
at 02:19:44 am]
Sizes and SizeInt
by
mas steindorff
[
Today
at 02:16:07 am]
I found an actual use for...
by
jamie
[June 09, 2026, 11:48:04 pm]
Lazarus Main and Gnome/Wa...
by
Jonax
[June 09, 2026, 09:02:10 pm]
[New Component] ExtTabCtr...
by
d7_2_laz
[June 09, 2026, 08:56:07 pm]
WEBP, no DLLs
by
Tomxe
[June 09, 2026, 07:40:17 pm]
MacOS post compilation sc...
by
marcou
[June 09, 2026, 07:30:07 pm]
water filling simulation
by
Dzandaa
[June 09, 2026, 06:53:35 pm]
Pdf Viewer in Pascal
by
Tomxe
[June 09, 2026, 05:00:32 pm]
How can 'Canvas does not ...
by
J-G
[June 09, 2026, 03:05:01 pm]
AArch64. Fast method to c...
by
Thaddy
[June 09, 2026, 01:58:45 pm]
Strange Behaviour at Runt...
by
andrew Bubble
[June 09, 2026, 12:41:49 pm]
Can /my/ AI help me with ...
by
microxa
[June 09, 2026, 12:12:06 pm]
Knigo
by
CM630
[June 09, 2026, 12:05:31 pm]
P.I.S.S. a PlugIn-framewo...
by
cdbc
[June 09, 2026, 11:27:35 am]
[solved] rotate image pro...
by
speter
[June 09, 2026, 10:03:42 am]
TstringGrid read cell col...
by
Josh
[June 08, 2026, 11:05:23 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: (Solved) selected area with rectangle (Read 5361 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