TImageList and masks lazarus / 13-General ---------------------------------------------------------------------- Zombat · 2006-09-23 14:01 I'm experiencing a few problems with the TImageList when I try to either use AddMasked or do Add with a TBitmap as mask (black/white). The main problem is that I try to split a 560x16 bmp image into X images, which I use for my toolbar as skins. Splitting them up works fine, but I can't really get clFuchsia to work right... Here's how I do it atm: Code: [Select]procedure LoadBMP(FileName: string; IL: TImageList); var   B1,B2,B3: TBitmap;   X,X2,Y: integer; begin   IL.Clear;   B1 := TBitmap.Create;   B1.LoadFromFile(FileName);   X := 0;   while (X + B1.Height <= B1.Width) do   begin     B2 := TBitmap.Create;     B2.Width := B1.Height;     B2.Height := B2.Width;     B2.Canvas.Brush.Color := clBtnFace;     B2.Canvas.FillRect(Rect(0, 0, B2.Width, B2.Height));     B3 := TBitmap.Create;     B3.Width := B2.Width;     B3.Height := B2.Height;     for X2 := 0 to B1.Height-1 do     begin       for Y := 0 to B1.Height-1 do       begin         if (B1.Canvas.Pixels[X+X2,Y] = clFuchsia) then         begin           B3.Canvas.Pixels[X2,Y] := clWhite;           B2.Canvas.Pixels[X2,Y] := clBtnFace;         end         else         begin           B3.Canvas.Pixels[X2,Y] := clBlack;           B2.Canvas.Pixels[X2,Y] := B1.Canvas.Pixels[X+X2,Y];         end;       end;     end;     IL.Add(B2,B3);     X:=X+B1.Height;   end;   FreeAndNil(B1); end; This code results in X images but with black background... Any help is appreciated ---------------------------------------------------------------------- felipemdc · 2006-09-23 14:37 Under Linux or Windows? ---------------------------------------------------------------------- Zombat · 2006-09-23 14:40 Windows