Kann mir jemand sagen ob der cast für SafeArrayAccessData so in Ordnung ist?
Delphi-Quellcode:
procedure TAtmoCtrlLib.AtmoCreateTransferBuffers(FourCC, bytePerPixel, width,
height: Integer);
var
size: Integer;
header: BITMAPINFOHEADER;
pHeader: Pointer;
begin
if Assigned(PpixelDataArr) then
SafeArrayDestroy(PpixelDataArr);
if Assigned(PbitmapInfoArr) then
SafeArrayDestroy(PbitmapInfoArr);
size := width * height * bytePerPixel;
PpixelDataArr := SafeArrayCreateVector(VT_UI1, 0, size);
PbitmapInfoArr := SafeArrayCreateVector(VT_UI1, 0, sizeof(BITMAPINFOHEADER));
pHeader := @Header;
SafeArrayAccessData(PbitmapInfoArr, pHeader);
Header.biSize := sizeof(BITMAPINFOHEADER);
Header.biWidth := width;
Header.biHeight := height;
Header.biBitCount := bytePerPixel*8;
Header.biCompression := FourCC;
SafeArrayUnaccessData(PbitmapInfoArr);
end;
Dieser hier > pHeader := @Header;
gruss