Method to unpack zip files in Delphi

 procedure TMForm.UnzipFile(const ZipFileName, DestinationFolder: string);

var

  Zip: TZipFile;

begin

  Zip := TZipFile.Create;       // use System.Zip

  try

    Zip.Open(ZipFileName, zmRead);      // ZIP 파일 열기 (읽기 전용 모드)

    Zip.ExtractAll(DestinationFolder);  // 전체 파일 압축 해제

  finally

    Zip.Free;

  end;

end;

Windows 원격 데스크톱 연결 클라이언트에서 항목 제거

Windows 원격 데스크톱 연결 클라이언트에서 항목 제거

Windows 원격 데스크톱 연결 클라이언트의 원격 데스크톱 연결 컴퓨터 상자에서 항목을 제거하려면 레지스트리 편집기를 시작한 다음, 다음 레지스트리 키를 선택합니다.

HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default

Drawing sine math function with FMX in Delphi

 





unit MUnit; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, System.Math, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls, FMX.Layouts, FMX.Objects; type TMForm = class(TForm) MRect: TRectangle; Timer1: TTimer; Circle1: TCircle; Pie1: TPie; Text_Angle: TText; Text_Circle: TText; Text1: TText; StartTimer: TTimer; procedure FormShow(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure StartTimerTimer(Sender: TObject); private procedure OnePointCircle(x, y: single; setColor : cardinal); procedure Draw_Line2P(x1, y1, x2, y2: single; setColor: cardinal); procedure Sin_OnePoint(xD: single); procedure Init_Screen; { Private declarations } public { Public declarations } AngleXD : single; end; var MForm: TMForm; implementation {$R *.fmx} procedure TMForm.FormShow(Sender: TObject); begin Draw_Line2P( 0,0, 1320,0, $FF252525 ); // Pie Solid Color MForm.ClientWidth := 1920; MForm.ClientHeight := 1080; MForm.Fill.Color := $FF000000; MForm.FullScreen := TRUE; Init_Screen(); end; // 실행하고 3초 이후 작동. procedure TMForm.StartTimerTimer(Sender: TObject); begin StartTimer.Enabled := FALSE; Init_Screen(); Timer1.Enabled := TRUE; end; procedure TMForm.Init_Screen(); var i : integer; begin AngleXD := 0; Pie1.EndAngle := 0; for i := MRect.ComponentCount - 1 downto 0 do if MRect.Components[i] is TCircle then MRect.Components[i].Free; MForm.Realign; // MRect 밖으로 삐져나온 원 자국 제거. end; //------------------------------------------------------------------------------- procedure TMForm.Draw_Line2P( x1,y1, x2,y2 : single; setColor : cardinal ); var d, xtemp, ytemp, rAngle : single; drawLine : TLine; begin if x1 > x2 then begin xtemp := x1; ytemp := y1; x1 := x2; y1 := y2; x2 := xtemp; y2 := ytemp; end; d := SQRT( Power( x2-x1, 2 ) + Power( y2-y1, 2 ) ); // Uses System.Math rAngle := RadToDeg( ArcSin( (y2-y1)/d )); drawLine := TLine.Create( MRect ); drawLine.Parent := MRect; drawLine.LineLocation := TLineLocation.Inner; drawLine.LineType := TLineType.Bottom; drawLine.RotationCenter.X := 0; drawLine.RotationCenter.Y := 0; drawLine.Stroke.Thickness := 6; drawLine.Stroke.Color := setColor; drawLine.Height := 1; drawLine.Width := d; drawLine.Position.X := x1; drawLine.Position.Y := MRect.Height * 0.5 - y1; drawLine.RotationAngle := rAngle; end; //------------------------------------------------------------------------------- procedure TMForm.OnePointCircle( x, y : single; setColor : cardinal ); var cc : TCircle; xInterval : single; // X 간격 begin cc := TCircle.Create( MRect ); cc.Parent := MRect; cc.Fill.Color := setColor; cc.Stroke.Kind := TBrushKind.None; cc.Width := 6; cc.Height := 6; xInterval := 2; cc.Position.X := ( x * xInterval - cc.Width * 0.5 ); // * xInterval 는 x 간격을 더 넓게 cc.Position.y := MRect.Height * 0.5 - y - cc.Height * 0.5; // 500 - y Text_Angle.Position.X := cc.Position.X + 10; Text_Angle.Position.Y := cc.Position.y - 30; end; //--------------------------------------------- // xd : 0 ~ 360 도 Degree procedure TMForm.Sin_OnePoint( xD : single ); var radianA, yp : single; yStr : string; begin radianA := DegToRad( xD ); yp := SIN( radianA ) * MRect.Height * 0.5; yStr := Format( '%5f', [ SIN( radianA ) ] ); OnePointCircle( xD, yp, $FF00FFFF ); Text_Angle.Text := '( ' + AngleXD.ToString + ' ,' + yStr + ' )'; Text_Circle.Text := AngleXD.ToString; end; //***************************************************************** procedure TMForm.Timer1Timer(Sender: TObject); begin if AngleXD > 540 then begin Timer1.Enabled := FALSE; StartTimer.Enabled := TRUE; end else begin Sin_OnePoint( AngleXD ); Pie1.EndAngle := -1 * ( AngleXD - 360 * ( Round( AngleXD ) div 360 ) ); // 360도 초과 해도 360으로 인식하므로 360 주기로변환. end; AngleXD := AngleXD + 1; // 1도 씩 증가 end; end.