[SOLVED] BGRABitmap and fpGUI transparency lazarus / 46-BGRABitmap and LazPaint ---------------------------------------------------------------------- lainz · 2016-07-28 19:41 In fpGUI discussion they say that transparency is supported but I can't get it working. The say that using the develop branch setting a control Background property to clNone works to set transparency. http://geldenhuys.co.uk/webnews/webnews.cgi?user=test;group=fpgui.supp ort;sortorder=date;article=7103 What I get is a complete invisible component. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit my_panel; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, fpg_base, fpg_main, fpg_panel,  BGRABitmap, BGRABitmapTypes; type   { TmyPanel }   TmyPanel = class(TfpgPanel)  private    FBGRA: TBGRABitmap;  protected    procedure HandlePaint; override;  public  constructor Create(AOwner: TComponent); override;    destructor Destroy; override;  end; implementation { TmyPanel } procedure TmyPanel.HandlePaint;begin  if (Width <> FBGRA.Width) or (Height <> FBGRA.Height) then    FBGRA.SetSize(Width, Height);   FBGRA.Rectangle(0, 0, Width, Height, BGRA(40, 40, 40), BGRA(83, 83, 83), dmSet);  FBGRA.SetHorizLine(1, 1, Width - 2, BGRA(106, 106, 106));   Self.BackgroundColor := clNone;  FBGRA.ApplyGlobalOpacity(100); // testing purpose  FBGRA.Draw(Canvas, 0, 0, False);end; constructor TmyPanel.Create(AOwner: TComponent);begin  inherited Create(AOwner);  FBGRA := TBGRABitmap.Create;end; destructor TmyPanel.Destroy;begin  if FBGRA <> nil then    FreeAndNil(FBGRA);  inherited Destroy;end; end. ---------------------------------------------------------------------- circular · 2016-07-29 14:17 Hi Lainz, As far as I remember, fpGUI only supports 1bit of transparency, so either completely transparent or completely opaque. You could simulate some transparency by erasing one every two pixel though. ---------------------------------------------------------------------- lainz · 2016-07-29 14:54 Thankyou! ---------------------------------------------------------------------- Roland57 · 2016-07-29 15:50 Quote from: lainz on July 28, 2016, 09:41:06 pmIn fpGUI discussion they say that transparency is supported but I can't get it working. Hello! I am working on a project using fpGUI ("develop" branch) and PNG pictures with transparent background. To get a correct result, I had to build fpGUI with -dAGGCanvas option. It was suggested to me by Graeme. I don't know if it will solve your problem, but you could try. ---------------------------------------------------------------------- lainz · 2016-07-29 16:12 Quote from: RolandC on July 29, 2016, 05:50:48 pmQuote from: lainz on July 28, 2016, 09:41:06 pmIn fpGUI discussion they say that transparency is supported but I can't get it working. Hello! I am working on a project using fpGUI ("develop" branch) and PNG pictures with transparent background. To get a correct result, I had to build fpGUI with -dAGGCanvas option. It was suggested to me by Graeme. I don't know if it will solve your problem, but you could try. Thankyou it works. My theme get's broken BTW. I need to re-create it with this setting. ---------------------------------------------------------------------- circular · 2016-07-29 18:15 Hmm, does the line FBGRA.Draw(Canvas, 0, 0, False); work as such with -dAGGCanvas ? ---------------------------------------------------------------------- lainz · 2016-07-29 18:41 Quote from: circular on July 29, 2016, 08:15:21 pmHmm, does the line FBGRA.Draw(Canvas, 0, 0, False); work as such with -dAGGCanvas ? Yes it works. ---------------------------------------------------------------------- circular · 2016-07-29 23:07 Cool, I am positively surprised by that. So that's a good thing, we can use AGG and BGRABitmap together via fpGUI. ---------------------------------------------------------------------- lainz · 2016-07-29 23:14 Quote from: circular on July 30, 2016, 01:07:06 amCool, I am positively surprised by that. So that's a good thing, we can use AGG and BGRABitmap together via fpGUI. We can create panels with transparency! Also any control can have transparency, all controls can have focus too. ---------------------------------------------------------------------- Graeme · 2016-08-09 12:58 Quote from: circular on July 30, 2016, 01:07:06 amCool, I am positively surprised by that. So that's a good thing, we can use AGG and BGRABitmap together via fpGUI. I've always said... fpGUI rocks!