Skip to content

Commit

Permalink
added alternate label text field, cleaned up example app
Browse files Browse the repository at this point in the history
  • Loading branch information
barnhill committed Oct 27, 2014
1 parent 4c230d1 commit 41efc4a
Show file tree
Hide file tree
Showing 6 changed files with 318 additions and 291 deletions.
2 changes: 2 additions & 0 deletions Barcode.sln
Expand Up @@ -37,6 +37,7 @@ Global
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8DB57BA1-E88C-43D9-AD0E-04BFA6B11C61}.Debug|.NET.ActiveCfg = Debug|Any CPU
{8DB57BA1-E88C-43D9-AD0E-04BFA6B11C61}.Debug|.NET.Build.0 = Debug|Any CPU
{8DB57BA1-E88C-43D9-AD0E-04BFA6B11C61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DB57BA1-E88C-43D9-AD0E-04BFA6B11C61}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8DB57BA1-E88C-43D9-AD0E-04BFA6B11C61}.Debug|x86.ActiveCfg = Debug|Any CPU
Expand All @@ -45,6 +46,7 @@ Global
{8DB57BA1-E88C-43D9-AD0E-04BFA6B11C61}.Release|Any CPU.Build.0 = Release|Any CPU
{8DB57BA1-E88C-43D9-AD0E-04BFA6B11C61}.Release|x86.ActiveCfg = Release|Any CPU
{F8646414-0C9C-49BB-9DA3-3923BF78A398}.Debug|.NET.ActiveCfg = Debug|Any CPU
{F8646414-0C9C-49BB-9DA3-3923BF78A398}.Debug|.NET.Build.0 = Debug|Any CPU
{F8646414-0C9C-49BB-9DA3-3923BF78A398}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8646414-0C9C-49BB-9DA3-3923BF78A398}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8646414-0C9C-49BB-9DA3-3923BF78A398}.Debug|x86.ActiveCfg = Debug|x86
Expand Down
16 changes: 13 additions & 3 deletions BarcodeLib/BarcodeLib.cs
Expand Up @@ -183,6 +183,16 @@ public bool IncludeLabel
get;
set;
}

/// <summary>
/// Alternate label to be displayed. (IncludeLabel must be set to true as well)
/// </summary>
public String AlternateLabel
{
get;
set;
}

/// <summary>
/// Gets or sets the amount of time in milliseconds that it took to encode and draw the barcode.
/// </summary>
Expand Down Expand Up @@ -739,7 +749,7 @@ private Image Label_ITF14(Image img)
//draw datastring under the barcode image
StringFormat f = new StringFormat();
f.Alignment = StringAlignment.Center;
g.DrawString(this.RawData, font, new SolidBrush(this.ForeColor), (float)(img.Width / 2), img.Height - font.Height + 1, f);
g.DrawString(AlternateLabel == null ? RawData : AlternateLabel, font, new SolidBrush(ForeColor), (float)(img.Width / 2), img.Height - font.Height + 1, f);

Pen pen = new Pen(ForeColor, (float)img.Height / 16);
pen.Alignment = PenAlignment.Inset;
Expand Down Expand Up @@ -810,10 +820,10 @@ private Image Label_Generic(Image img)
}//switch

//color a background color box at the bottom of the barcode to hold the string of data
g.FillRectangle(new SolidBrush(this.BackColor), new RectangleF((float)0, (float)LabelY, (float)img.Width, (float)font.Height));
g.FillRectangle(new SolidBrush(BackColor), new RectangleF((float)0, (float)LabelY, (float)img.Width, (float)font.Height));

//draw datastring under the barcode image
g.DrawString(this.RawData, font, new SolidBrush(this.ForeColor), new RectangleF((float)0, (float)LabelY, (float)img.Width, (float)font.Height), f);
g.DrawString(AlternateLabel == null ? RawData : AlternateLabel, font, new SolidBrush(ForeColor), new RectangleF((float)0, (float)LabelY, (float)img.Width, (float)font.Height), f);

g.Save();
}//using
Expand Down
3 changes: 2 additions & 1 deletion BarcodeLib/Release Notes.txt
@@ -1,7 +1,8 @@
Release Notes for BarcodeLib.dll
================================
1.0.0.18
-
- cleaned up layout of test application
- added alternate label text property
1.0.0.17
- Fixed a bug in Code 11 where K checksums were being calculated for messages shorter than 10 characters in length.
- Fixed a bug in PostNet that drew incorrectly for all PostNet barcodes (thanks jonney3099)
Expand Down
3 changes: 1 addition & 2 deletions BarcodeLibTest/BarcodeLibTest.csproj
Expand Up @@ -13,7 +13,7 @@
<ManifestCertificateThumbprint>1465CABE4A879E249A14FA206FD2C53D4E943647</ManifestCertificateThumbprint>
<ManifestKeyFile>BarcodeLibTest_TemporaryKey.pfx</ManifestKeyFile>
<GenerateManifests>true</GenerateManifests>
<SignManifests>true</SignManifests>
<SignManifests>false</SignManifests>
<IsWebBootstrapper>true</IsWebBootstrapper>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand Down Expand Up @@ -86,7 +86,6 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="BarcodeLibTest_TemporaryKey.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down

0 comments on commit 41efc4a

Please sign in to comment.