No subject


Tue Dec 7 08:03:25 EST 2004


function Get16Bpg:Byte;
var
  c: DWord;
  hBM: HBITMAP;
  sDC,bDC: Windows.HDC;
begin
  sDC:=GetDC(0);
  bDC:=CreateCompatibleDC(sDC);
  hBM:=CreateCompatibleBitmap(sDC,1,1);
  SelectObject(bDC,hBM);
  SetPixel(bDC,0,0,RGB(0,100,0));
  c:=GetPixel(bDC,0,0);
  DeleteDC(bDC);
  DeleteObject(hBM);
  ReleaseDC(0,sDC);
  if GetGValue(c)>=100 then Result:=6 else Result:=5;
end;


----- Original Message -----
From: Micha Nelissen <micha at neli.hopto.org>
To: <lazarus at miraclec.com>
Sent: Saturday, December 13, 2003 1:46 PM
Subject: Re: [lazarus] Wrong colours in win32


> Micha Nelissen wrote:
>
> > Mattias Gaertner wrote:
> >
> >>
> >>
> >> Yes.
> >>
> >> To reduce the confusion:
> >> fpImage splitts and modularizes the reading/writing of images. For
> >> example the XPM reader parses a stream and converts each pixel into a
> >> TFPColor, to call SetPixel for each pixel. So, this conversion is
XPM ->
> >> TFPColor (48bit depth). Theoretically XPM supports more than 48 bit
> >> depth,
> >> but practically not, therefore this conversion is lossless.
> >> The TLazIntfImage overrides the SetPixel method and sets the pixel
> >> according
> >> to the RawImage format. This can result in loss of color information.
> >>
> >> So, yes, the splash logo is paletted, and no, fpImage has no problem
with
> >> it.
> >> When you save an XPM, the palette is created on the fly.
> >
> >
> > Ok. My hunt continues... ;-)
>
> It's fixed now. Wrong color format, 5-5-5 instead of 5-6-5. Maybe this
> info is retrievable from win32 api / device, instead of hardcoded, but I
> don't know how.
>
> Regards,
>
> Micha.
>
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives






More information about the Lazarus mailing list