Ich erstelle nun den BitmapHeader selbst
AtmoCtrlLib.AtmoCreateTransferBuffers(BI_RGB, 4, captureWidth, captureHeight);
Delphi-Quellcode:
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);
jetzt muss ich nur noch das PpixelDataArr mit Daten füttern das war's dann.
AtmoCtrlLib.AtmoSendPixelData;
Delphi-Quellcode:
procedure TAtmoCtrlLib.AtmoSendPixelData; stdcall;
var
pALVC: IAtmoLiveViewControl;
begin
pALVC := getAtmoLiveViewControl;
if Assigned(PpixelDataArr) and Assigned(pALVC) then
begin
SafeArrayUnaccessData(PpixelDataArr);
pALVC.setPixelData(PbitmapInfoArr, PpixelDataArr);
end;
end;
gruss