Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   TStreamAdapter Patch für ntdll AV (GDI+) (https://www.delphipraxis.net/170686-tstreamadapter-patch-fuer-ntdll-av-gdi.html)

Tonic1024 28. Sep 2012 15:39

TStreamAdapter Patch für ntdll AV (GDI+)
 
Dieser Tip aus der CodeLib hat mir leider nicht geholfen beim laden von PNGs aus Ressourcen mit GDI+.

Mit etwas google und viel Phantasie hab ich ne Lösung gefunden.

Delphi-Quellcode:
uses
  ActiveX

type
  TPatchedStreamAdapter = class(TStreamAdapter)
  public
    function Stat(out statstg: ActiveX.TStatStg; grfStatFlag: Longint): HResult; override; stdcall;
  end;

implementation

function TPatchedStreamAdapter.Stat(out statstg: ActiveX.TStatStg; grfStatFlag: Longint): HResult;
begin
  Result := inherited Stat(statstg, grfStatFlag);
  statstg.pwcsName := nil;
end;
Delphi-Quellcode:
  Stream:=TResourceStream.Create(hInstance, 'Image', RT_RCDATA);
  Image:=TGPBitmap.Create((TPatchedStreamAdapter.Create(Stream) as IStream));
  Stream.Free;
Gruß,

Toni


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:24 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz