[Lazarus] TBitmap and pixel format

Philippe philippe at quarta.com.br
Wed Jun 18 16:10:05 CEST 2014


 

I am trying to get raw data of image to use it as texture.
(Lazarus/windows 32 bits) 

basically I wrote some stuff like that 


pict := TPicture.create;

 try
 pict.loadFromFile( ExpandFileNameUTF8(
arqname));
 bm := pict.bitmap;

 // getting widht and height from bitmap
(working fine!) 

 .... 

 // pixels from bitmap
 pbarq :=
bm.rawimage.Data;

 // copy to my texture object .... 

 ..... 

 except


// some message 

 end; 

the problem is that sometimes raw data are
in a RGBA format, sometimes in a RGB format ! 

in both case pixelFormat
gives me "pf24bit" !!!!!!! 

is there a simple way to distinguish the
cases? 

if there a better list to post this, just tell me! 

thanks


Philippe 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140618/9d803bc2/attachment-0002.html>


More information about the Lazarus mailing list