function TWIL.CreateSaveBitMap(Index:integer):tbitmap;
var hBm,nBm:tbitmap;
RS:DWORD;
tmpWILFILEIMAGEINFO:PWILFILEIMAGEINFO;
bufBitMap:array of WORD;
Width,High,tStart,i,j:WORD;
begin
ReSult:=nil;
try
if Index < FImageCount then
begin
RS:=OffsetOfImageColorBuf[Index];
if RS<>0 then begin
tmpWILFILEIMAGEINFO:=InfoOfImage[Index];
Width:=tmpWILFILEIMAGEINFO^.shWidth;
High:=tmpWILFILEIMAGEINFO^.shHeight;
ImageFromCompMemToResMem(0,0,Width,High,TARRAY(RS),Width,High,$F81F);
hBm:=TBitMap.Create;
hBm.Width:=Width;
hBm.Height:=High;
hbm.PixelFormat:=pf16bit;
if G3 then tStart:=Width else tStart:=0;
SetBitmapBits(hBm.Handle,Width*High*sizeof(WORD),@Image[tStart]);
dispose(tmpWILFILEIMAGEINFO);
ReSult:=hBm;
end;
end;
except end;
end;
其中 ImageFromCompMemToResMem(0,0,Width,High,TARRAY(RS),Width,High,$F81F);
这句里
TARRAY(RS)是什么
是一个 空的缓冲区
还是 一些数据请指点下
俺D语言 菜鸟
var hBm,nBm:tbitmap;
RS:DWORD;
tmpWILFILEIMAGEINFO:PWILFILEIMAGEINFO;
bufBitMap:array of WORD;
Width,High,tStart,i,j:WORD;
begin
ReSult:=nil;
try
if Index < FImageCount then
begin
RS:=OffsetOfImageColorBuf[Index];
if RS<>0 then begin
tmpWILFILEIMAGEINFO:=InfoOfImage[Index];
Width:=tmpWILFILEIMAGEINFO^.shWidth;
High:=tmpWILFILEIMAGEINFO^.shHeight;
ImageFromCompMemToResMem(0,0,Width,High,TARRAY(RS),Width,High,$F81F);
hBm:=TBitMap.Create;
hBm.Width:=Width;
hBm.Height:=High;
hbm.PixelFormat:=pf16bit;
if G3 then tStart:=Width else tStart:=0;
SetBitmapBits(hBm.Handle,Width*High*sizeof(WORD),@Image[tStart]);
dispose(tmpWILFILEIMAGEINFO);
ReSult:=hBm;
end;
end;
except end;
end;
其中 ImageFromCompMemToResMem(0,0,Width,High,TARRAY(RS),Width,High,$F81F);
这句里
TARRAY(RS)是什么
是一个 空的缓冲区
还是 一些数据请指点下
俺D语言 菜鸟
D语言简介:http://baike.baidu.com/view/701266.htm?fr=ala0RS:DWORD; RS:=OffsetOfImageColorBuf[Index];
RS是一个整形变量,用来装载ImageColorBuf的偏移,
procedure TForm1.Button1Click(Sender: TObject);
var
arr: array of string;
i: Integer;
begin
{设置动态数组大小}
SetLength(arr, Memo1.Lines.Count); {复制 Memo1 中的文本到数组}
for i := 0 to Memo1.Lines.Count - 1 do arr[i] := Memo1.Lines[i]; {排序}
TArray.Sort<string>(arr); {在 Memo1 中查看数组中的数据}
Memo1.Clear;
for i := 0 to Length(arr) - 1 do Memo1.Lines.Add(arr[i]);
end;
这是找到的万老师的一个例子
个人理解应该是一个内存块
这里不是已经定义了吗?
RS就是ImageColorBuf的偏移地址,为Dword型
什么意思?