Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
Graphics
»
BGRABitmap and LazPaint
»
BGRABitmap - copy rectangle
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
IRC channel
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
[Solved] Accessing variab...
by
ASBzone
[
Today
at 05:03:05 am]
Error Messages
by
OC DelGuy
[
Today
at 04:54:54 am]
[LAMW] is it possible sen...
by
ASBzone
[
Today
at 04:54:25 am]
[Problem solved] Wish: st...
by
funlw65
[
Today
at 02:20:38 am]
File handling, records [p...
by
manahu
[
Today
at 02:19:59 am]
if ImageList
by
jamie
[
Today
at 01:42:12 am]
converting C++ over laz, ...
by
jamie
[
Today
at 01:13:48 am]
Pictures in Forms
by
winni
[
Today
at 12:24:04 am]
[SOLVED] Indicator arrow ...
by
pcurtis
[February 27, 2021, 11:54:02 pm]
MOVED: TChart start posit...
by
trev
[February 27, 2021, 11:05:08 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: BGRABitmap - copy rectangle (Read 244 times)
mosquito
New Member
Posts: 26
BGRABitmap - copy rectangle
«
on:
February 23, 2021, 09:48:49 am »
I have a TBGRABitmap in memory, how can I extract a rectangle from this bitmap and copy it to another temporary bitmap?
Logged
winni
Hero Member
Posts: 2187
Re: BGRABitmap - copy rectangle
«
Reply #1 on:
February 23, 2021, 10:41:20 am »
Hi!
Easy:
Code: Pascal
[Select]
[+]
[-]
NewBGRAbitmap
:
=
TBGRAbitmap
.
create
;
NewBGRAbitmap
:
=
OldBGRAbitmap
.
GetPart
(
Rect
(
10
,
10
,
100
,
100
)
)
;
Done.
Winni
Logged
mosquito
New Member
Posts: 26
Re: BGRABitmap - copy rectangle
«
Reply #2 on:
February 23, 2021, 12:03:51 pm »
Thanks, this is just what I was looking for.
Logged
Roland57
Full Member
Posts: 121
Re: BGRABitmap - copy rectangle
«
Reply #3 on:
February 23, 2021, 02:40:24 pm »
Hello!
@Winni
The first line isn't required. It would create a memory leak.
Regards.
Roland
Logged
https://github.com/rchastain
https://gitlab.com/rchastain
winni
Hero Member
Posts: 2187
Re: BGRABitmap - copy rectangle
«
Reply #4 on:
February 24, 2021, 05:49:49 pm »
Hi Roland.
That depends on the version of BGRAbitmap your using.
Old versions behaved this way: If you did not do a create before the Getpart you got a nice crash.
Nice that it was at long last changed.
Winni
Logged
circular
Hero Member
Posts: 3666
Re: BGRABitmap - copy rectangle
«
Reply #5 on:
February 24, 2021, 06:49:05 pm »
Hmmm nope it has always been a memory leak.
Assigning to the variable replaces the previous pointer.
Maybe you’re thinking of BGRAReplace?
Logged
Conscience is the debugger of the mind
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
Graphics
»
BGRABitmap and LazPaint
»
BGRABitmap - copy rectangle
TinyPortal
© 2005-2018