new utility "crop" (which helps creating screenshots of widgets, by cropping the original screenshot to multiple small image files which are used in the documentation)

updated dolabel documentation

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2225 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blaszijk 2012-01-04 14:08:02 +00:00
parent def3913ebb
commit e84764f650
20 changed files with 102 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

View File

@ -0,0 +1,17 @@
::this script takes a screenshot from the widget_test example
::and cut's the individual widget examples and saves them to
::a separate file
::the crop application is located in ./utils
crop widget_test.png 7 30 150 70 label.png
crop widget_test.png 7 70 170 100 button.png
crop widget_test.png 7 100 385 162 checkbutton.bmp
crop widget_test.png 7 162 375 222 radiobutton.bmp
crop widget_test.png 7 222 120 252 horizontal_slider.png
crop widget_test.png 7 252 108 309 listbox.png
crop widget_test.png 104 252 233 309 combobox.png
crop widget_test.png 7 309 235 340 line_edit.png
crop widget_test.png 7 340 242 407 panel.png
crop widget_test.png 7 414 242 480 frame.png
crop widget_test.png 4 478 74 542 listitem.png
crop widget_test.png 4 540 112 649 textureview.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,26 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>GLUIPainter.Destroy</title>
<link rel="stylesheet" href="../fpdoc.css" type="text/css">
</head>
<body>
<table class="bar" width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<td><b>[<a href="../nvglwidgets/index.html">Overview</a>][<a href="../nvglwidgets/index-2.html">Constants</a>][<a href="../nvglwidgets/index-4.html">Classes</a>][<a href="../nvglwidgets/index-8.html">Index</a>]</b></td>
<td align="right"><span class="bartitle">Reference for unit 'nvGLWidgets' (<a href="../index.html">#nvidia-widgets</a>)</span></td>
</tr>
</table>
<h1>GLUIPainter.Destroy</h1>
<p></p>
<h2>Declaration</h2>
<p>Source position: nvglwidgets.pas line 127</p>
<table cellpadding="0" cellspacing="0">
<tr>
<td><p><tt><span class="code"> <span class="kw">public</span> <span class="kw">destructor</span> <a href="../nvglwidgets/gluipainter.html">GLUIPainter</a><span class="sym">.</span>Destroy<span class="sym">;</span></span></tt></p></td>
</tr>
</table>
</body>
</html>

View File

@ -72,8 +72,12 @@
</element>
<element name="UIContext.doLabel">
<short>UI method for drawing a static text label</short>
<descr>The label display a non interactive text.
The text can have multiple lines</descr>
<descr>
<p>The label displays a non interactive text.</p>
<p>The style flag enables to draw the label in two distict styles. The first one is default <var>(style = 0)</var> and displays the label simply as text. The alternative <var>(style = 1)</var> displays the label with a frame around it. An example is shown in then following figure.</p>
<img file="label.png"/>
<p>The Text can have multiple lines.</p>
</descr>
</element>
<element name="UIContext.doLabel.r">
<short>optionally provides a location and size for the label</short>

View File

@ -53,6 +53,10 @@
</tr>
</table>
<h2>Description</h2>
<p>The label display a non interactive text. The text can have multiple lines</p>
<p>The label displays a non interactive text.</p>
<p>The style flag enables to draw the label in two distict styles. The first one is default <var>(style = 0)</var> and displays the label simply as text. The alternative <var>(style = 1)</var> displays the label with a frame around it. An example is shown in then following figure.</p>
<img alt="" src="../images/label.png">
<p>The Text can have multiple lines.</p>
</body>
</html>

View File

@ -7,7 +7,6 @@
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<UseDefaultCompilerOptions Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
@ -15,6 +14,7 @@
<UseXPManifest Value="True"/>
<Icon Value="0"/>
</General>
<LazDoc Paths="..\..\..\doc"/>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
@ -34,12 +34,17 @@
<FormatVersion Value="1"/>
</local>
</RunParams>
<Units Count="1">
<Units Count="2">
<Unit0>
<Filename Value="widget_test.pp"/>
<IsPartOfProject Value="True"/>
<UnitName Value="widget_test"/>
</Unit0>
<Unit1>
<Filename Value="..\nvWidgets.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="nvWidgets"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -0,0 +1,41 @@
program crop;
{$mode objfpc}{$h+}
uses
//readers
FPReadBMP, fpreadjpeg, FPReadPNG, fpreadpnm, fpreadtga, FPReadXPM,
//writers
FPWriteBMP, fpwritejpeg, FPWritePNG, fpwritepnm, fpwritetga, FPWriteXPM,
FPImage, SysUtils;
var
img: TFPMemoryImage;
img2: TFPMemoryImage;
x1, y1, x2, y2: integer;
x: integer;
y: integer;
begin
img := TFPMemoryImage.Create(0, 0);
//img.UsePalette := False;
img.LoadFromFile(ParamStr(1));
x1 := StrToInt(ParamStr(2));
y1 := StrToInt(ParamStr(3));
x2 := StrToInt(ParamStr(4));
y2 := StrToInt(ParamStr(5));
img2 := TFPMemoryImage.Create(x2 - x1, y2 - y1);
//img2.UsePalette := False;
for x := x1 to x2 - 1 do
for y := y1 to y2 - 1 do
img2.Colors[x - x1, y - y1] := img.Colors[x, y];
img2.SaveToFile(ParamStr(6));
img.Free;
img2.Free;
end.