Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#1

CopyPTRtoBYTES alternative in Delphi

  Alt 22. Apr 2009, 19:55
Welche alternative bietet sich hier an ?

Code:
Private Declare Sub CopyBYTEStoPTR Lib "kernel32.dll" Alias "RtlMoveMemory" _
                          (ByVal PtrDest As Long, _
                          ByRef ByteSrc As Byte, _
                          ByVal Length As Long)

Private Declare Sub CopyPTRtoBYTES Lib "kernel32.dll" Alias "RtlMoveMemory" _
                          (ByRef ByteDest As Byte, _
                          ByVal PtrSrc As Long, _
                          ByVal Length As Long)
Meine Delphi version!

Delphi-Quellcode:
procedure CopyBYTEStoPTR(PtrDest: Pointer; ByteSrc: Byte; Length: Integer); stdcall;
    external 'kernel32.dllName 'RtlMoveMemory';

procedure CopyPTRtoBYTES(ByteDest: Byte; PtrSrc: Pointer; Length: Integer); stdcall;
    external 'kernel32.dllName 'RtlMoveMemory';
und die beiden aufrufe.
Code:
    //' Copy The R,G,B Data Into Our Image Array For Rapid Editing/Fading.
    CopyPTRtoBYTES(ia[0, 0], pAddr, 49152);

    //' Copy Edited Image Back To Dib Section.
    CopyBYTEStoPTR(pAddr, ia[0, 0], 49152);
Denke das müßte in Delphi eleganter zu lösen sein.

gruss Emil
  Mit Zitat antworten Zitat