Barcodes in BGRABitmap lazarus / 39-Graphics ---------------------------------------------------------------------- 99Percent · 2014-12-05 03:18 I am having trouble getting a barcode in a TBGRABitmap canvas. I am using the barcode library. Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var   Bitmap,Photo : TBGRABitmap;   Barcode : TBarcode; begin     Bitmap := TBGRABitmap.Create(661,1028,BGRAPixelTransparent);      Photo :=TBGRABitmap.Create('somepicture.jpg');      Barcode:=TBarcode.Create(self);     try        with Bitmap do begin          StretchPutImage(Rect(40,400,440,830),Photo,dmDrawWithTranspar ency,255);          FontHeight:=40;          FontAntialias:=True;          FontStyle:= [fsBold];          TextOut(240,950,'Name Last Name',BGRABlack,taCenter);        end;        with Barcode do begin          Typ:=bcCode128A;          Height:=80;          Modul:=3;          Text:='^01234';          Barcode.          Top:=850;          Left:=40+((400-Width) div 2);          DrawBarcode(Bitmap.Canvas);        end;          Bitmap.SaveToFile('credencial.png');        Image1.Picture.Bitmap.Assign(Bitmap);      finally        Bitmap.Free;        Photo.Free;        Barcode.Free;   end; end; It works fine in Linux but on Windows the black lines of the barcode are gone, only the white lines show. I have tried drawing a polygon directly to canvas and if I use any color except black it appears fine. Only the black color seems to be causing this problem. What am I missing? ---------------------------------------------------------------------- circular · 2014-12-05 15:00 The black color (clBlack) is used to specify a transparent color. To have a black color, you need to use clBlackOpaque constant instead. Alternatively, if you cannot change the color of the bar code, you can use Bitmap.AlphaFill to set the alpha channel to 255 afterwards in the desired area.