[Lazarus] TImage and PNG (on linux)

Leonardo M. Ramé l.rame at griensu.com
Tue Apr 12 21:09:07 CEST 2011


On 2011-04-12 20:36:34 +0200, Krzysztof wrote:
>    I am not the author of BGRABitmap class but I think it is easy to assign
>    bitmap from resource to BGRABitmap class. You can load image from resource
>    using TResourceStream (there is tutorial on wiki) and then call
>    BGRABitmap.LoadFromStream(MyResourceStream)

I tried this and got an 'ExceptionException Unknown/Unsupported PCX
image type'. The resource contains a PNG image.

  lRes := TLazarusResourceStream.Create('sombra_top_horiz', 'PNG');
  try
    lRes.Position:= 0;
    FMyTBGRABitmap.LoadFromStream(lRes);
  finally
    lRes.Free;
  end; 

Any workaround?
--
Leonardo M. Ramé
http://leonardorame.blogspot.com

A: Maybe because some people are too annoyed by top-posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?




More information about the Lazarus mailing list