Skip to content

Commit

Permalink
Merge pull request #2 from Sv-Vik/master
Browse files Browse the repository at this point in the history
толщина для рамки
  • Loading branch information
Pr-Mex authored Oct 24, 2019
2 parents ad69e68 + 5f04f3b commit c2ea7f2
Show file tree
Hide file tree
Showing 24 changed files with 36 additions and 1,357 deletions.
Binary file removed Pramougolnik/Arrow_Icon.ico
Binary file not shown.
Binary file modified Pramougolnik/GDIPAPI.dcu
Binary file not shown.
Binary file modified Pramougolnik/GDIPOBJ.dcu
Binary file not shown.
File renamed without changes.
3 changes: 3 additions & 0 deletions Pramougolnik/Arrow.dof → Pramougolnik/Rectangle.dof
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,6 @@ OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
1 change: 1 addition & 0 deletions Pramougolnik/Rectangle.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ uses

begin
Application.Initialize;
Application.Title := 'Rectangle';
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
872 changes: 0 additions & 872 deletions Pramougolnik/Rectangle.dproj

This file was deleted.

6 changes: 0 additions & 6 deletions Pramougolnik/Rectangle.dproj.local

This file was deleted.

Binary file removed Pramougolnik/Rectangle.identcache
Binary file not shown.
Binary file modified Pramougolnik/Rectangle.res
Binary file not shown.
Binary file added Pramougolnik/Rectangle_Icon.ico
Binary file not shown.
Binary file modified Pramougolnik/Unit1.dcu
Binary file not shown.
8 changes: 4 additions & 4 deletions Pramougolnik/Unit1.dfm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
object Form1: TForm1
Left = 191
Top = 124
Left = -8
Top = -8
Width = 1936
Height = 1056
Caption = 'Form1'
ClientHeight = 636
ClientWidth = 1290
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Expand Down
59 changes: 8 additions & 51 deletions Pramougolnik/Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ interface
type
TForm1 = class(TForm)
Button1: TButton;
RectangleTimer: TTimer;
Image1: TImage;
RectangleTimer: TTimer;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure RectangleTimerTimer(Sender: TObject);
Expand All @@ -24,7 +24,7 @@ TForm1 = class(TForm)
var
Form1: TForm1;
glX1,glX2,glY1,glY2,glColor, glHowLong:Integer;
glColorR,glColorG,glColorB:Integer;
glColorR,glColorG,glColorB, glWidth:Integer;
glFileName:String;
CountTimer,MaxCountTimer:Integer;
glFirstShow:Boolean;
Expand Down Expand Up @@ -59,29 +59,6 @@ function RightStr(S:String; Kol:Integer):String;
end;


procedure DrawArrowHead(Canvas: TCanvas; X,Y: Integer; Angle,LW: Extended);
var
A1,A2: Extended;
Arrow: array[0..3] of TPoint;
OldWidth: Integer;
const
Beta=0.322;
LineLen=4.74;
CentLen=3;
begin
Angle:=Pi+Angle;
Arrow[0]:=Point(X,Y);
A1:=Angle-Beta;
A2:=Angle+Beta;
Arrow[1]:=Point(X+Round(LineLen*LW*Cos(A1)),Y-Round(LineLen*LW*Sin(A1)));
Arrow[2]:=Point(X+Round(CentLen*LW*Cos(Angle)),Y-Round(CentLen*LW*Sin(Angle)));
Arrow[3]:=Point(X+Round(LineLen*LW*Cos(A2)),Y-Round(LineLen*LW*Sin(A2)));
OldWidth:=Canvas.Pen.Width;
Canvas.Pen.Width:=1;
Canvas.Polygon(Arrow);
Canvas.Pen.Width:=OldWidth
end;

procedure DrawRectangle(Canvas: TCanvas; X1,Y1,X2,Y2: Integer; LW: Extended);
begin
glgraphics.DrawRectangle(glPN, X1,Y1, X2-X1,Y2-Y1);
Expand Down Expand Up @@ -125,8 +102,8 @@ procedure TForm1.FormCreate(Sender: TObject);
end;
}

//X1, Y1, X2, Y2, Öâåò, Äëèòåëüíîñòü,{Èìÿ ñòîï ôàéëà(íåîáÿçàòåëüíûé)}
//åñëè íà äèñêå åñòü ñòîï ôàéë, çíà÷èò íàäî ñäåëàòü exit
//X1, Y1, X2, Y2, ????, ????????????,{??? ???? ?????(??????????????)}
//???? ?? ????? ???? ???? ????, ?????? ???? ??????? exit

glFirstShow:=True;

Expand All @@ -137,6 +114,7 @@ procedure TForm1.FormCreate(Sender: TObject);
glHowLong:=30000;
glColor := 255;
glFileName:='';
glWidth := 3;

for i := 1 to ParamCount do
begin
Expand All @@ -156,7 +134,8 @@ procedure TForm1.FormCreate(Sender: TObject);
glColorB:=StrToInt(ParamStr(i));
if i=8 then
glHowLong:=StrToInt(ParamStr(i));

if i=9 then
glWidth:=StrToInt(ParamStr(i));

if LeftStr(ParamStr(i),13) = 'stopfilename=' then
begin
Expand All @@ -169,28 +148,6 @@ procedure TForm1.FormCreate(Sender: TObject);

end;

procedure CopyScreenToImage();
var
bm: TBitMap;
ms: TMemoryStream;
begin
bm := TBitMap.Create;
bm.Width := Form1.Width; // øèðèíà õîëñòà
bm.Height := Form1.Height; // äëèíà õîëñòà
BitBlt(bm.Canvas.Handle, 0, 0, bm.Width, bm.Height,
GetDC(0), Form1.Left, Form1.Top, SRCCOPY); // 0, 0, bm.Width, bm.Height çäåñü ýòî òà ÷àñòü ýêðàíà
// êîòîðóþ íóæíî êîïèðîâàòü

ms := TMemoryStream.Create;
bm.SaveToStream(ms);
ms.Position := 0;
Form1.Image1.Picture.Bitmap.LoadFromStream(ms);
bm.Destroy;
ms.Free;

end;


procedure TForm1.RectangleTimerTimer(Sender: TObject);
var
OffsetX,OffsetY : integer;
Expand Down Expand Up @@ -270,7 +227,7 @@ procedure TForm1.RectangleTimerTimer(Sender: TObject);
glgraphics.SetCompositingQuality(CompositingQualityAssumeLinear);
glgraphics.SetInterpolationMode(InterpolationModeHighQualityBilinear);

glPN.SetWidth(3);
glPN.SetWidth(glWidth);


ResX:=glX1+OffsetX;
Expand Down
13 changes: 0 additions & 13 deletions Pramougolnik/__history/Rectangle.dpr.~1~

This file was deleted.

40 changes: 0 additions & 40 deletions Pramougolnik/__history/Unit1.dfm.~1~

This file was deleted.

40 changes: 0 additions & 40 deletions Pramougolnik/__history/Unit1.dfm.~2~

This file was deleted.

Loading

0 comments on commit c2ea7f2

Please sign in to comment.