![]() |
Re: API Casten ala ALIAS von VB
Zitat:
wie ich das in Delphi umsetzen kann... gruss Emil |
Re: API Casten ala ALIAS von VB
Du könntest die Typdeklaration der Funktion ja entsprechend anpassen.
Delphi-Quellcode:
wird zu
type
TFunction = function(Originalrecord: TOriginalrecord): Ergebnistyp;
Delphi-Quellcode:
Viel Erfolg.
type
TFunction = function(DeinRecord: TDeinRecord): Ergebnistyp; |
Re: API Casten ala ALIAS von VB
Zitat:
Hier ein Sample..
Delphi-Quellcode:
type
TMyBitmapInfo = Record bmiHeader : TBitmapInfoHeader; bmiColors : array [0..255] of RGBQUAD; end;
Delphi-Quellcode:
CreateDIBSection kennt aber MYBITMAPINFO nicht ok ?
function TSkinEngine.MyCreateDIBSection (imgHdc: Hdc; Width, Height:Integer; BitCount: Integer):Integer;
var bi: MYBITMAPINFO; p : Pointer; begin bi.bmiHeader.biSize := SIZEOF(bi.bmiHeader); bi.bmiHeader.biWidth := Width; bi.bmiHeader.biHeight := Height; bi.bmiHeader.biPlanes := 1; bi.bmiHeader.biBitCount := BitCount; bi.bmiHeader.biCompression := BI_RGB; Result := CreateDIBSection(imgHdc, bi, DIB_RGB_COLORS, p, 0, 0); end; Weil diese im Original auf
Delphi-Quellcode:
zeigt...
type
PBitmapInfo = ^TBitmapInfo; {$EXTERNALSYM tagBITMAPINFO} tagBITMAPINFO = packed record bmiHeader: TBitmapInfoHeader; bmiColors: array[0..0] of TRGBQuad; end; TBitmapInfo = tagBITMAPINFO; {$EXTERNALSYM BITMAPINFO} BITMAPINFO = tagBITMAPINFO; Also was ich möchte ist ähnlich wie in VB MYBITMAPINFO auf die Originale DLL verlinken. Sollte dann eigentlich so aussehen Org..
Delphi-Quellcode:
Neu..
{$EXTERNALSYM CreateDIBSection}
function CreateDIBSection(DC: HDC; const p2: TBitmapInfo; p3: UINT; var p4: Pointer; p5: THandle; p6: DWORD): HBITMAP; stdcall;
Delphi-Quellcode:
gruss Emil
{$EXTERNALSYM CreateDIBSection}
function CreateDIBSection(DC: HDC; const p2: TMyBitmapInfo; p3: UINT; var p4: Pointer; p5: THandle; p6: DWORD): HBITMAP; stdcall; |
Re: API Casten ala ALIAS von VB
Liste der Anhänge anzeigen (Anzahl: 3)
Nach einigen versuchen habe ich es selbst geschafft:
Hier ist die lösung...
Delphi-Quellcode:
type
TMyBitmapInfo = Record bmiHeader : TBitmapInfoHeader; bmiColors : array [0..255] of RGBQUAD; end; function MyCreateDIBSection(DC: HDC; const p2: TMyBitmapInfo; p3: UINT; var p4: Pointer; p5: THandle; p6: DWORD): HBITMAP; stdcall; external 'GDI32.DLL' name 'CreateDIBSection';
Delphi-Quellcode:
aufruf als Beispiel:
// Create DIB section
function TSkinEngine.skCreateDIBSection (imgHdc: Hdc; Width, Height:Integer; BitCount: Integer):HBITMAP; var bi: TMyBitmapInfo; p : Pointer; begin bi.bmiHeader.biSize := SIZEOF(bi.bmiHeader); bi.bmiHeader.biWidth := Width; bi.bmiHeader.biHeight := Height; bi.bmiHeader.biPlanes := 1; bi.bmiHeader.biBitCount := BitCount; bi.bmiHeader.biCompression := BI_RGB; Result := MyCreateDIBSection(imgHdc, bi, DIB_RGB_COLORS, p, 0, 0); end;
Delphi-Quellcode:
gruss Emil
hPaintBitmap := skCreateDIBSection(imgHdc, MAX(rc.Right, X), MAX(rc.Bottom, Y), 32);
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:40 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz