function BitmapTo65536(Bitmap: TBitmap): string; //из обычного битмапа в этот формат var i, j, c, p: integer; w: word; begin SetLength(Result, Bitmap.Width * Bitmap.Height * 2); p := 1; for i := 0 to Bitmap.Height - 1 do begin for j := 0 to Bitmap.Width - 1 do begin c := Bitmap.Canvas.Pixels[j, i]; w := ((c shl 8) and $F800) + ((c shr 5) and $07E0) + ((c shr 19) and $1F); Result[p] := Chr(w and $FF); Result[p + 1] := Chr(w shr 8); p := p + 2; end; end; end; procedure TForm1.ConvertANItoBMP(FileName:string; Bitmap:TBitmap;Frame:Integer); //а это чтение var tmpbuf:array[0..325000] of word; x,y,i:integer; w:word; begin AssignFile(Fw,FileName); Reset(Fw); //lengthfile:=filesize(Fw); BlockRead(Fw,tmpbuf,$4b+1); Bitmap.Width:=tmpbuf[$2] div 256; Bitmap.Height:=tmpbuf[$3] div 256; for i:=0 to Frame do BlockRead(Fw,tmpbuf,(Bitmap.Width*Bitmap.Height)*2); for y:=0 to Bitmap.Height-1 do for x:=0 to Bitmap.Width-1 do begin w:=tmpbuf[y*Bitmap.Width+x]; Bitmap.Canvas.Pixels[x,y]:=((w and $F800) shr 8)+((w and $07E0) shl 5)+((w and $1F) shl 19); end; CloseFile(Fw); end;