<div dir="ltr">Hello,<div><br></div><div>How do I load a XPM image using only FCL-Image?</div><div><br></div><div>I'm trying it:</div><div><br></div><div><div>program project1;</div><div><br></div><div>{$mode objfpc}{$H+}</div>
<div><br></div><div>uses</div><div> FPimage, FPReadXPM;</div><div><br></div><div>var</div><div> r: TFPReaderXPM;</div><div> i: TFPMemoryImage;</div><div>begin</div><div> r := TFPReaderXPM.Create;</div><div> i := TFPMemoryImage.Create(48, 48);</div>
<div> try</div><div> i.LoadFromFile('ide_icon48x48.xpm', r);</div><div> finally</div><div> r.Free;</div><div> i.Free;</div><div> end;</div><div>end.</div></div><div><br></div><div>But:</div><div><br></div>
<div><div>C:\Users\Silvio\Desktop\xpm>project1.exe</div><div>An unhandled exception occurred at $00412008:</div><div>EAccessViolation: Access violation</div><div> $00412008</div><div> $00411D6F</div><div> $00410B81</div>
<div> $0040F9B1</div><div> $004015D5 main, line 15 of project1.lpr</div><div><br></div><div><div>In attached, I'm sending a small project and my XPM image to test it.</div><div><br></div><div>Thank you!</div></div>
<div><br></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>