<div dir="ltr">2013/7/13 silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<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></div></blockquote></div><div><br></div><div>IMG, it works now, I discovered:</div><div><br></div><div>i.UsePalette := True;<br></div><div><br></div><div>Thank you anyway! :)</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>