Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   TShape transparente (https://www.clubdelphi.com/foros/showthread.php?t=88925)

Jose Roman 27-08-2015 18:31:23

TShape transparente
 
Cordial saludo,

Necesito agregarle la propiedad Transparente de tipo Boolean (debido a que el usuario podrá decidir si lo desea o no transparente) a un TShape y que este TShape sea transparente solo la parte interna no los bordes, no se como hacer esto. Muchas gracias.

AgustinOrtu 27-08-2015 20:54:25

A ver si esto te sirve

Código Delphi [-]
unit TransparentShape;

interface

uses
  ExtCtrls;

type
  TTransparentShape = class(TShape)
  private
    FTransparent: Boolean;
    procedure SetTransparent(const Value: Boolean);
  published
    property Transparent: Boolean read FTransparent write SetTransparent;
  end;

implementation

uses
  Graphics;

{ TTransparentShape }

procedure TTransparentShape.SetTransparent(const Value: Boolean);
begin
  if FTransparent <> Value then
  begin
    FTransparent := Value;
    if FTransparent then
      Brush.Style := bsClear
    else
      Brush.Style := bsSolid;
  end;
end;

end.

Edito:

Salida -


Jose Roman 27-08-2015 22:10:12

Gracias por tu ayuda. ^\||/


La franja horaria es GMT +2. Ahora son las 01:44:06.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi