Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Middle button picks a random color. Bitmap is now the size of the full desktop. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | develop |
Files: | files | file ages | folders |
SHA1: |
4d0f6cf5ac6edaaafcd774c9a7c745d5 |
User & Date: | tinus 2017-03-28 18:15:05.588 |
Context
2017-03-28
| ||
18:21 | Changed parse mode to Delphi, since Lazarus 1.0 doesn't support DelphiUnicode. check-in: e90bec57c7 user: tinus tags: develop | |
18:15 | Middle button picks a random color. Bitmap is now the size of the full desktop. check-in: 4d0f6cf5ac user: tinus tags: develop | |
2017-03-26
| ||
16:01 | Added ignore-glob. check-in: 6409f446ba user: tinus tags: develop | |
Changes
Changes to .fossil-settings/ignore-glob.
1 2 | *.bak src/lib/ | > > | | 1 2 3 4 5 | *.bak src/lib/ src/*.lps src/tekening src/tekening.exe |
Added .fossil-settings/ignore-glob.no-warn.
Changes to src/f_main.lfm.
︙ | ︙ | |||
11 12 13 14 15 16 17 | OnKeyDown = FormKeyDown OnMouseDown = FormMouseDown OnMouseMove = FormMouseMove OnMouseUp = FormMouseUp OnPaint = FormPaint OnUTF8KeyPress = FormUTF8KeyPress Position = poDesktopCenter | | | 11 12 13 14 15 16 17 18 19 20 | OnKeyDown = FormKeyDown OnMouseDown = FormMouseDown OnMouseMove = FormMouseMove OnMouseUp = FormMouseUp OnPaint = FormPaint OnUTF8KeyPress = FormUTF8KeyPress Position = poDesktopCenter LCLVersion = '1.6.4.0' WindowState = wsFullScreen end |
Changes to src/f_main.pas.
︙ | ︙ | |||
47 48 49 50 51 52 53 | LCLIntf; {$R *.lfm} { TfrmTekening } procedure TfrmTekening.FormCreate(Sender: TObject); | < < | | > > > > > | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | LCLIntf; {$R *.lfm} { TfrmTekening } procedure TfrmTekening.FormCreate(Sender: TObject); begin FPNG := TPortableNetworkGraphic.Create; FPNG.PixelFormat := pf24bit; FPNG.Transparent := False; FPNG.SetSize(Screen.DesktopWidth, Screen.DesktopHeight); FPNG.Canvas.Brush.Style := bsSolid; FPNG.Canvas.Brush.Color := Self.Color; FPNG.Canvas.FillRect(0, 0, FPNG.Width, FPNG.Height); FColor := clPurple; FPNG.Canvas.Pen.Color := FColor; FPNG.Canvas.Pen.Width := 10; FPNG.Canvas.Font.Size := 30; Self.Canvas.Pen.Color := FColor; Self.Canvas.Pen.Width := 10; Self.Canvas.Font.Size := 30; FDrawing := dsDrawing; FSkip := True; Self.BorderStyle := bsNone; Self.SetBounds(Screen.DesktopLeft, Screen.DesktopTop, Screen.DesktopWidth, Screen.DesktopHeight); Randomize; end; procedure TfrmTekening.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); const cKeyColors: array[VK_F1..VK_F12] of TColor = ( $00000000 // F1 |
︙ | ︙ | |||
91 92 93 94 95 96 97 | , $00880000 // F10 , $00888888 // F11 , $00880088 // F12 ); begin if Key in [VK_F1..VK_F12] then begin FColor := cKeyColors[Key]; | > | | < < < > > | > > | | | > < > | > | > | < < < | > | | > | < < | < | | | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | , $00880000 // F10 , $00888888 // F11 , $00880088 // F12 ); begin if Key in [VK_F1..VK_F12] then begin FColor := cKeyColors[Key]; if Shift = [] then Key := 0; end; end; procedure TfrmTekening.FormClose(Sender: TObject; var CloseAction: TCloseAction); begin OnMouseDown := nil; OnMouseMove := nil; FPNG.SaveToFile(IncludeTrailingPathDelimiter(GetUserDir) + 'tekening-' + FormatDateTime('yyyy-MM-dd_hh.nn.ss', Now) + '.png'); FPNG.Free; end; procedure TfrmTekening.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin case Button of mbLeft: begin if FDrawing <> dsDrawing then FDrawing := dsDrawing else FDrawing := dsNothing; end; mbMiddle: begin FColor := RGB(Random(255), Random(255), Random(255)); FDrawing := dsDrawing; end; mbRight: begin if FDrawing <> dsErasing then FDrawing := dsErasing else FDrawing := dsNothing; end; end; end; procedure TfrmTekening.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if FSkip then begin MoveTo(X, Y); FSkip := False; end; case FDrawing of dsNothing: MoveTo(X, Y); dsDrawing: LineTo(X, Y, FColor); dsErasing: LineTo(X, Y, Self.Color); end; end; procedure TfrmTekening.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin end; procedure TfrmTekening.FormPaint(Sender: TObject); begin Self.Canvas.Draw(ClientOrigin.X, ClientOrigin.Y, FPNG); end; procedure TfrmTekening.FormUTF8KeyPress(Sender: TObject; var UTF8Key: TUTF8Char ); begin if (UTF8Key >= #32) then begin TextOut(FPNG.Canvas, UnicodeUpperCase(UTF8String(UTF8Key))); TextOut(Self.Canvas, UnicodeUpperCase(UTF8String(UTF8Key))); FSkip := True; end; end; procedure TfrmTekening.MoveTo(const X, Y: Integer); begin FPNG.Canvas.MoveTo(X, Y); |
︙ | ︙ |
Changes to src/tekening.lpi.
|
| | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <?xml version="1.0" encoding="UTF-8"?> <CONFIG> <ProjectOptions> <Version Value="10"/> <General> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> <Title Value="tekening"/> <ResourceType Value="res"/> <UseXPManifest Value="True"/> <Icon Value="0"/> </General> <i18n> <EnableI18N LFM="False"/> </i18n> <VersionInfo> <MajorVersionNr Value="1"/> <StringTable ProductVersion=""/> </VersionInfo> <BuildModes Count="1"> <Item1 Name="Default" Default="True"/> </BuildModes> <PublishOptions> <Version Value="2"/> |
︙ | ︙ | |||
35 36 37 38 39 40 41 | <PackageName Value="LCL"/> </Item1> </RequiredPackages> <Units Count="2"> <Unit0> <Filename Value="tekening.pas"/> <IsPartOfProject Value="True"/> | < < > > > > > < < < < < < | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | <PackageName Value="LCL"/> </Item1> </RequiredPackages> <Units Count="2"> <Unit0> <Filename Value="tekening.pas"/> <IsPartOfProject Value="True"/> </Unit0> <Unit1> <Filename Value="f_main.pas"/> <IsPartOfProject Value="True"/> <ComponentName Value="frmTekening"/> <HasResources Value="True"/> <ResourceBaseClass Value="Form"/> </Unit1> </Units> </ProjectOptions> <CompilerOptions> <Version Value="11"/> <Target> <Filename Value="tekening"/> </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> <SyntaxOptions> <SyntaxMode Value="DelphiUnicode"/> </SyntaxOptions> </Parsing> <Linking> <Options> <Win32> <GraphicApplication Value="True"/> </Win32> </Options> </Linking> </CompilerOptions> <Debugging> <Exceptions Count="3"> <Item1> <Name Value="EAbort"/> </Item1> <Item2> |
︙ | ︙ |
Changes to src/tekening.res.
cannot compute difference between binary files