1

The following works in Delphi XE2 but throws an access violation in Delphi XE:

uses
  GDIPAPI, GDIPOBJ;
...
TGPImage.Create (TStreamAdapter.Create (MemStream));   // throws AV

How can I use GDI+ in Delphi XE?

jpfollenius
  • 16,456
  • 10
  • 90
  • 156
  • Try to use tmp variable, ie `SA := TStreamAdapter.Create(MemStream); TGPImage.Create(SA);`, sometimes this makes difference with some obscure compiler bug... – ain Dec 21 '11 at 11:23
  • 1
    It works under Embarcadero® Delphi® XE Version 15.0.3953.35171 – menjaraz Dec 21 '11 at 12:56

1 Answers1

4

Using the GDI+ units from Progdigy and renaming them to avoid conflicts with the ones used in the TeeCharts package solves the issue. XE does not come with sources for these units (XE2 does), so I'm not sure why it failed.

jpfollenius
  • 16,456
  • 10
  • 90
  • 156
  • You mean to say that problem was due to namespace? – Kromster Dec 21 '11 at 14:15
  • I believe it's due to an out of date binary DCU shipped with XE, but I'm not certain. Or Smasher might have had some old versions of GDI+ units in his library path. – Warren P Dec 21 '11 at 14:38