TBitmap - how to copy an "object"
- From: "Peter Bauer" <PeterBauer@xxxxxxxx>
- Date: Thu, 28 Apr 2005 13:11:13 +0200
hi,
i'm trying to copy an "object" of one color out of a TBitmap,
the problem i got is that i dont know when a pixel belongs to this object
when the image contains more then one objects. it's also not possible
to split the image, cause the objects are not seperated well.
this is my first try:
x:= 0;
while x < CacheBitmap.Width - 1 do
begin
for y := 0 to CacheBitmap.Height - 1 do
begin
P := CacheBitmap.ScanLine[y];
for i:= 0 to x do
inc(P);
if (P^.rgbRed = 0) and (P^.rgbGreen = 0) and (P^.rgbBlue = 0) then
begin
MyRect:= Rect(x, y, SmartBitmap.Height-1, SmartBitmap.Width-1);
MyOther:= Rect(x,y,SmartBitmap.Height-1, SmartBitmap.Width-1);
SmartBitmap.Canvas.CopyRect(MyOther,CacheBitmap.Canvas,MyRect);
end;
End;
inc(x);
end;
i also played around with a second pointer, but i got no luck :(
any ideas?
.
- Follow-Ups:
- Re: TBitmap - how to copy an "object"
- From: Maarten Wiltink
- Re: TBitmap - how to copy an "object"
- Prev by Date: Re: FORMS INTERACTION
- Next by Date: Re: TBitmap - how to copy an "object"
- Previous by thread: FORMS INTERACTION
- Next by thread: Re: TBitmap - how to copy an "object"
- Index(es):