Why did you need to change the pixel format value?
Pixel format is used to inform programmer how the data being stored so one knows how to deal with it. You cannot change it directly and hope some 'magical' things to happen.
You may have better understanding how to use pixel format by studying the code here:
https://forum.lazarus.freepascal.org/index.php/topic,37242.msg253349.html#msg253349
Thank you for your reply.
I just moved from Delphi to Lazarus this week, So I see there are some differences between Delphi and Lazarus.
my project is to capture photos from the camera or from other devices, then analyze the image to do something.
so the picture pixel format some are 24bits, some are 32bit. even 16 bits.
In Delphi, If we wanna change a bitmap pixel bits, just set
Pixelformat to what we want.
------------------------
In Lazarus, seems we cannot do that.
--------------------------------------------
So follow your information, I will check the pixel format of the image at first, then process them defferently.