Tampar uma determinada area de um form com buraco
Boa Tarde pessoal, tenho um código no qual ele cria um "buraco" onde movimenta o mouse, mas gostaria de saber como posso tampar uma determinada área, por exemplo eu crio o "buraco" no form e consigo visualizar a palavra "Google" que esta atrás do form, no entando eu não quero que mostre a letra "l", eu pensei em movimentar um form2 com as localidade da letra, mas n obtive êxito. Código que estou usando.
var
Form1: TForm1;
region1, region2: hrgn;
implementation
{$R *.dfm}
const
vH: Byte = 10;
vV: Byte = 30;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
x1 := x + vH;
y1 := y + vV;
ptnd := True;
AnchorX := X;
CurX := X;
AnchorY := Y;
CurY := Y;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Caption := ''x1: '' + IntToStr(x1) + ''; y1 '' + IntToStr(y1) + ''; x2 '' + IntToStr(x2) + ''; y2 '' + IntToStr(y2) + '';'';
if ptnd then
begin
Canvas.Pen.Mode := pmNot;
Canvas.Pen.Width := 2;
Canvas.Brush.Style := bsClear;
Canvas.Rectangle(AnchorX, AnchorY, CurX, CurY);
CurX := X;
CurY := Y;
Canvas.Rectangle(AnchorX, AnchorY, CurX, CurY);
end;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
x2 := x + vH;
y2 := y + vV;
begin
region1 := CreateRectRgn(0, 0, Self.Width, Self.Height);
region2 := CreateRectRgn(x1, y1, x2, y2);
CombineRgn(region1, region1, region2, RGN_DIFF);
SetWindowRgn(Handle, region1, True);
end;
if ptnd then
begin
ptnd := False;
Canvas.Pen.Mode := pmNot;
Canvas.Brush.Style := bsClear;
Canvas.Rectangle(AnchorX, AnchorY, CurX, CurY);
end;
end;
var
Form1: TForm1;
region1, region2: hrgn;
implementation
{$R *.dfm}
const
vH: Byte = 10;
vV: Byte = 30;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
x1 := x + vH;
y1 := y + vV;
ptnd := True;
AnchorX := X;
CurX := X;
AnchorY := Y;
CurY := Y;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Caption := ''x1: '' + IntToStr(x1) + ''; y1 '' + IntToStr(y1) + ''; x2 '' + IntToStr(x2) + ''; y2 '' + IntToStr(y2) + '';'';
if ptnd then
begin
Canvas.Pen.Mode := pmNot;
Canvas.Pen.Width := 2;
Canvas.Brush.Style := bsClear;
Canvas.Rectangle(AnchorX, AnchorY, CurX, CurY);
CurX := X;
CurY := Y;
Canvas.Rectangle(AnchorX, AnchorY, CurX, CurY);
end;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
x2 := x + vH;
y2 := y + vV;
begin
region1 := CreateRectRgn(0, 0, Self.Width, Self.Height);
region2 := CreateRectRgn(x1, y1, x2, y2);
CombineRgn(region1, region1, region2, RGN_DIFF);
SetWindowRgn(Handle, region1, True);
end;
if ptnd then
begin
ptnd := False;
Canvas.Pen.Mode := pmNot;
Canvas.Brush.Style := bsClear;
Canvas.Rectangle(AnchorX, AnchorY, CurX, CurY);
end;
end;
Thiago
Curtidas 0
Respostas
Nidora
10/11/2022
Para filtrar o intervalo da lista copiando as linhas que atendem aos critérios para outra área da planilha, clique em Copiar para outro local, clique na caixa Copiar para e, em seguida, clique no canto superior esquerdo da área onde deseja cole as linhas.
GOSTEI 0