Hi
It would be something like:
// Method that takes an image, splits it into multiple cells and saves each cell to file
procedure SplitImage(Bitmap: TIEBitmap; cols, rows: integer; DestFolder: string);
var
cellWidth, cellHeight: Double;
x,y : Integer;
outBmp: TIEBitmap;
begin
cellWidth := Bitmap.Width / cols;
cellHeight := Bitmap.Height / rows;
outBmp := TIEBitmap.Create;
outBmp.Allocate( Round( cellWidth ), Round( cellHeight ));
for x := 0 to cols do
for y := 0 to rows do
begin
Bitmap.CopyRectTo( outBmp,
Round( cellWidth * x ), Round( cellHeight * y ),
0, 0,
Round( cellWidth ), Round( cellHeight ));
outBmp.Write( IncludeTrailingBackSlash( DestFolder ) + IntToStr( x ) + '_' + IntToStr( y ) + '.bmp' );
end;
outBmp.Free;
end;
Nigel
Xequte Software
www.imageen.com