Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-06

TBitmap and pixel format

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Philippe

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.freepascal.org/pipermail/lazarus/attachments/20140618/9d803bc2/attachment.html>

Reply by email

Philippe
to Philippe

I am trying to undestand better ... I got now an pf32bit pixelformat!!!!!! I need to check several cases ...

Philippe wrote
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

Show quoted text 5 lines
pict := TPicture.create; try
pict.loadFromFile( ExpandFileNameUTF8( arqname));
Show quoted text 12 lines
bm := pict.bitmap; // getting widht and height from bitmap (working fine!) .... // pixels from bitmap pbarq := bm.rawimage.Data; // copy to my

texture object ....

Show quoted text 8 lines
..... 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" !!!!!!!

Show quoted text 14 lines
is there a simple way to distinguish the cases? if there a better list to post this, just tell me! thanks Philippe -- _______________________________________________

Lazarus mailing list

http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus [1]

Links:
------
[1]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140618/6ac9be26/attachment-0001.html>

Reply by email

Philippe
to Philippe

checked! ...

pixelFormat seems doing well .... (better than I do!)

doing ok with bmp, jpg and png I checked.

but if someone got another
idea ... I appreciate!

but this item can be close!!!!

Philippe

Em

Philippe wrote
I am trying to undestand better

... I got now an pf32bit pixelformat!!!!!! I need to check several cases ...

Em 18.06.2014 11:10, Philippe escreveu: > 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!)

Show quoted text 5 lines
> > .... > > // pixels from bitmap >
pbarq := bm.rawimage.Data;
Show quoted text 13 lines
> > // 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!

Show quoted text 8 lines
> > thanks > > Philippe > > -- >

Reply by email

Philippe
to Mattias Gaertner

I tried to get TRawImage.Description ... I tried!!!!

I saw that
document ... but got lost rapidly!!!!!! dificult to find the way to do simple things reading it!!!!!

Now what I wanted to do seems to work ok
... I?ll be back to that document later ... lot of stuff I could take advantage for sure!!!

Thanks a lot for your help!

Philippe

Em

Mattias Gaertner wrote
On Wed, 18 Jun 2014

12:02:44 -0300

Philippe wrote: > checked!

... pixelFormat seems doing well .... (better than I do!) doing ok with bmp, jpg and png I checked. but if someone got another idea ... I appreciate!

RGB and RGBA is only the tip of the ice berg. See

TRawImage.Description.

Have you read

http://wiki.lazarus.freepascal.org/Developing_with_Graphics [1]

?

Mattias

-- _______________________________________________

Lazarus mailing list

http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus [2]

Links:
------
[1]
http://wiki.lazarus.freepascal.org/Developing_with_Graphics [2]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140618/d9f6e868/attachment.html>

Reply by email