FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Transparent Canvas (Bitmap Image) (https://fileforums.com/showthread.php?t=104698)

Cuttlas 03-10-2021 05:32

Transparent Canvas (Bitmap Image)
 
I have created a TBitmap Image and I'm filling it in using Canvas.

I need to make it transparent, with no border, and no background color. is this possible? if yes, how?

Code:

var
  CustomButton: TBitmapImage;

// Drawing
//*************
procedure RedrawCustomButton;
var
  Canvas: TCanvas;
begin
  Canvas := CustomButton.Bitmap.Canvas;

  Canvas.Pen.Style := psClear;
  Canvas.Brush.Color := clBtnFace;
  Canvas.Rectangle(0, 0, CustomButton.Bitmap.Width, CustomButton.Bitmap.Height);

  Canvas.Pen.Style := psSolid;
  Canvas.Pen.Mode := pmCopy;
  Canvas.Pen.Color := clBlack;
  Canvas.Brush.Style := bsClear;
  Canvas.Rectangle(0, 0, CustomButton.Bitmap.Width, CustomButton.Bitmap.Height);
end;
//*************

procedure InitializeWizard();
var
  Page: TWizardPage;
begin
  WizardForm.InnerPage.Color := clYellow;

  Page := CreateCustomPage(wpWelcome, '', '');

  CustomButton := TBitmapImage.Create(WizardForm);
  CustomButton.Parent := Page.Surface;
  CustomButton.Top := 0;
  CustomButton.Left := 0;
  CustomButton.Width := ScaleX(128);
  CustomButton.Height := ScaleX(32);
  CustomButton.Bitmap.Width := CustomButton.Width;
  CustomButton.Bitmap.Height := CustomButton.Height;
  RedrawCustomButton;
end;



All times are GMT -7. The time now is 12:22.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com