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
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
Cirumvent the assignment ...
by
dbannon
[
Today
at 03:09:01 am]
Setting up an ARM embedde...
by
Ruptor
[
Today
at 12:44:58 am]
Tedit control that adjust...
by
simsee
[
Today
at 12:36:13 am]
Compare two text lines an...
by
simone
[
Today
at 12:04:05 am]
Is there a Lazbuild compi...
by
Mark Paley
[July 12, 2025, 09:56:45 pm]
ChatGPT and ObjectPascal ...
by
Joanna
[July 12, 2025, 08:02:23 pm]
About Skia graphics engin...
by
aydın
[July 12, 2025, 07:58:51 pm]
problem by export and imp...
by
paule32
[July 12, 2025, 07:43:53 pm]
Searching for current wor...
by
Thaddy
[July 12, 2025, 07:22:28 pm]
Has anyone installed TeeB...
by
Thaddy
[July 12, 2025, 07:06:19 pm]
new private messages fly ...
by
Martin_fr
[July 12, 2025, 05:13:47 pm]
Fpcupdeluxe
by
DonAlfredo
[July 12, 2025, 04:45:54 pm]
[SOLVED] SQLite query to ...
by
DanishMale
[July 12, 2025, 04:37:24 pm]
Pulsating Radial Segments...
by
Boleeman
[July 12, 2025, 04:11:52 pm]
Object Pascal Playing Car...
by
marcov
[July 12, 2025, 02:53:25 pm]
Fast Canvas Library V1.05...
by
Gigatron
[July 12, 2025, 02:49:43 pm]
Trouchet Koch (Snowflake ...
by
Boleeman
[July 12, 2025, 02:34:31 pm]
Extended Module Player
by
Gigatron
[July 12, 2025, 02:27:09 pm]
controls.lpr(731,15) Erro...
by
Martin_fr
[July 12, 2025, 11:44:05 am]
Amigo programming languag...
by
paxscript
[July 12, 2025, 08:48:11 am]
[Solved]Garbled web page ...
by
PeterHu
[July 12, 2025, 08:34:38 am]
Rainbowed Rotating Square...
by
Boleeman
[July 12, 2025, 07:33:00 am]
[Solved]Retrieving wrong ...
by
PeterHu
[July 12, 2025, 03:19:47 am]
I read this somewhere... ...
by
1HuntnMan
[July 12, 2025, 12:06:28 am]
TCustomApplication.DoRun
by
cdbc
[July 11, 2025, 09:31:55 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: (Solved) selected area with rectangle (Read 5104 times)
xinyiman
Hero Member
Posts: 2258
(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: 2258
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: 2258
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: 2258
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