[lazarus] Win32 fpimage support + cleanups (affects gtk)

Micha Nelissen M.Nelissen at student.tue.nl
Thu Nov 13 16:12:45 EST 2003


Micha Nelissen wrote:

> Mattias Gaertner wrote:
> 
>> On Wed, 12 Nov 2003 22:09:55 +0100
>> Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
>>
>>
>>> Mattias Gaertner wrote:
>>>
>>>
>>>> On Mon, 10 Nov 2003 17:17:43 +0100
>>>> Micha Nelissen <M.Nelissen at student.tue.nl> wrote:
>>>>
>>>>
>>>>> Are there test cases / examples for fpimage support?
>>>>
>>>>
>>>>
>>>> None yet. Simply load some bmp, xpm or png files. Or you can try the 
>>>> jpeglazarus
>>>> package on lazarus-ccr.
>>>
>>>
>>> Heh, tried an updated version of speedtest.pp. To penguin turns up 
>>> blue+pink :). Is RRGGBB swapped incorrectly then?
>>
>>
>>
>> The penguin is like any other penguin black and white.
>> If you got colors, then
>> - the xpm color map loading is buggy
>> - the creation of the pixels is buggy.
> 
> 
> Do the raw images support ByteOrder already? I changed it, but it 
> doesn't seem to have an effect. I also can't find any mention of 
> ByteOrder intfgraphics.pas.

Attached patch seems to make things a little better, but still the right 
and left half of the image are swapped. Mattias, maybe it gives you a 
hint? Alpha bitmaps are monochrome on win32 afaik, so this functionality 
is crucial.

Micha.


Index: intfgraphics.pas
===================================================================
RCS file: /FPC/CVS/projects/lazarus/lcl/intfgraphics.pas,v
retrieving revision 1.10
diff -u -b -r1.10 intfgraphics.pas
--- intfgraphics.pas	7 Nov 2003 22:50:44 -0000	1.10
+++ intfgraphics.pas	13 Nov 2003 21:20:05 -0000
@@ -803,6 +803,8 @@
   BitOffset:=FDataDescription.AlphaBitsPerPixel*cardinal(x)+Position.Bit;
   Position.Bit:=BitOffset and 7;
   inc(Position.Byte,BitOffset shr 3);
+  if FDataDescription.ByteOrder = riboLSBFirst then
+    Position.Byte := (Position.Byte and not $3) + (3 - (Position.Byte and $3));
 end;
 
 procedure TLazIntfImage.LoadFromDevice(DC: HDC);





More information about the Lazarus mailing list