Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
SynEdit
»
Is it possible to get copyrect without a visual instance of tsynedit?
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
Omitting semicolon on las...
by
440bx
[
Today
at 06:55:47 am]
FPC Unleashed (inline var...
by
440bx
[
Today
at 05:42:39 am]
fp-h2pas: New C header tr...
by
Gustavo 'Gus' Carreno
[
Today
at 05:20:21 am]
The ever re-appearing /= ...
by
440bx
[
Today
at 05:05:57 am]
android attack (inc)
by
speter
[
Today
at 04:19:54 am]
Little bit...
by
n7800
[
Today
at 03:51:08 am]
[ANN] Unofficial FPC 3.3....
by
440bx
[
Today
at 01:00:04 am]
NiceGrid component for La...
by
wp
[
Today
at 12:03:57 am]
Remote desktop software i...
by
rvk
[April 10, 2026, 08:20:14 pm]
Track windows cross-platf...
by
dsiders
[April 10, 2026, 07:43:43 pm]
[ANN] PasBuild v1.8.0 Rel...
by
Graeme
[April 10, 2026, 06:43:13 pm]
Подписи кнопок панели инс...
by
Raskaton
[April 10, 2026, 06:37:48 pm]
HTTPS-сервер с ГОСТ-серти...
by
Raskaton
[April 10, 2026, 06:29:36 pm]
Strange behavior with dat...
by
JanRoza
[April 10, 2026, 06:20:38 pm]
RegExpr matchting empty s...
by
Thaddy
[April 10, 2026, 04:35:27 pm]
TLazSerial : serial port ...
by
CM630
[April 10, 2026, 03:45:42 pm]
Can't pass string to TEdi...
by
lazarusprogrammer
[April 10, 2026, 02:04:36 pm]
Messing with Gemini AI an...
by
gidesa
[April 10, 2026, 12:48:03 pm]
Lazarus Bugfix Release 4....
by
dbannon
[April 10, 2026, 10:09:07 am]
[SOLVED] How to enter gen...
by
PascalDragon
[April 10, 2026, 07:27:12 am]
AI Assist Python - to - P...
by
PascalDragon
[April 10, 2026, 07:25:42 am]
How to remove a FORM from...
by
Martin_fr
[April 10, 2026, 12:29:46 am]
504 Gateway Timeout
by
Marc
[April 09, 2026, 10:28:28 pm]
Can /my/ AI help me with ...
by
schuler
[April 09, 2026, 09:27:43 pm]
I can write your README.m...
by
schuler
[April 09, 2026, 09:22:38 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Is it possible to get copyrect without a visual instance of tsynedit? (Read 3375 times)
Michael Collier
Sr. Member
Posts: 329
Is it possible to get copyrect without a visual instance of tsynedit?
«
on:
June 20, 2017, 03:27:02 am »
I'd like to copy the visual view of a TSynEdit onto a TImage canvas.
I have used copyrect to copy the canvas OK, but I'd like to try this without an instance of the TSynEdit being visible.
Is there any way I can do this already? Maybe low level calls or components that I don't know about?
Logged
Pascal
Hero Member
Posts: 932
Re: Is it possible to get copyrect without a visual instance of tsynedit?
«
Reply #1 on:
June 20, 2017, 06:05:13 am »
You can use PaintTo:
Code: Pascal
[Select]
[+]
[-]
lEdit
:
=
TSynEdit
.
Create
(
Panel2
)
;
try
lEdit
.
Parent
:
=
Panel2
;
lEdit
.
Lines
.
LoadFromFile
(
'C:\freepascal\fpc\trunk\packages\rtl-generics\src\generics.collections.pas'
)
;
lEdit
.
PaintTo
(
Image1
.
Canvas
.
Handle
,
0
,
0
)
;
finally
lEdit
.
Free
;
end
;
But you have to set the parent of the TSynEdit to an invisible Control.
Logged
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)
Michael Collier
Sr. Member
Posts: 329
Re: Is it possible to get copyrect without a visual instance of tsynedit?
«
Reply #2 on:
June 20, 2017, 04:55:01 pm »
Thanks for the heads up on PaintTo, it works OK for me when the parent panel is visible, but if I hide either the parent panel (panel2) or the synedit (LEdit) the result is a black canvas in the image. Is there any other value I need to set please?
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
SynEdit
»
Is it possible to get copyrect without a visual instance of tsynedit?
TinyPortal
© 2005-2018