Re: TBitmap - how to copy an "object"
- From: Nicholas Sherlock <n_sherlock@xxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 12:38:05 +1200
Ekkehard Domning wrote:
ReplaceContinousColor(Bitmap,X-1,Y-1,SearchColor, ReplaceColor); ReplaceContinousColor(Bitmap,X-1, Y,SearchColor, ReplaceColor); ReplaceContinousColor(Bitmap,X-1,Y+1,SearchColor, ReplaceColor); ReplaceContinousColor(Bitmap,X, Y-1,SearchColor, ReplaceColor); ReplaceContinousColor(Bitmap,X, Y+1,SearchColor, ReplaceColor); ReplaceContinousColor(Bitmap,X+1,Y-1,SearchColor, ReplaceColor); ReplaceContinousColor(Bitmap,X+1, Y,SearchColor, ReplaceColor); ReplaceContinousColor(Bitmap,X+1,Y+1,SearchColor, ReplaceColor);
I like to optimize these sorts of structures to this:
var x1,y1:integer;
for x1:=-1 to 1 do for y1:=-1 to 1 do if not ((x1=0) and (y1=0)) then ReplaceContinuousColor(bitmap,x+x1,y+y1,searchcolor,replacecolor);
Cheers, Nicholas Sherlock .
- Follow-Ups:
- Re: TBitmap - how to copy an "object"
- From: Peter Bauer
- Re: TBitmap - how to copy an "object"
- References:
- TBitmap - how to copy an "object"
- From: Peter Bauer
- Re: TBitmap - how to copy an "object"
- From: Maarten Wiltink
- Re: TBitmap - how to copy an "object"
- From: Ekkehard Domning
- TBitmap - how to copy an "object"
- Prev by Date: Re: Undetected memory leaks?
- Next by Date: Re: TBitmap - how to copy an "object"
- Previous by thread: Re: TBitmap - how to copy an "object"
- Next by thread: Re: TBitmap - how to copy an "object"
- Index(es):