Skip to content

Commit

Permalink
Retouren-Label hinzugefügt
Browse files Browse the repository at this point in the history
  • Loading branch information
Manfred Müller committed Nov 3, 2023
1 parent 6a8f916 commit ee8c9c0
Show file tree
Hide file tree
Showing 12 changed files with 254 additions and 54 deletions.
29 changes: 27 additions & 2 deletions DHLabel.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33516.290
# Visual Studio Version 16
VisualStudioVersion = 16.0.33920.266
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DHLabel", "Program\DHLabel.csproj", "{F79E3061-F8FE-46DD-BE4C-69F85A675116}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projektmappenelemente", "Projektmappenelemente", "{2B593C4A-133C-4E82-A91E-5A860E2A357D}"
EndProject
Project("{29E15B7A-B420-4782-B51D-1BE2F663A160}") = "Setup", "Setup\Setup.innoproj", "{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -55,6 +57,29 @@ Global
{F79E3061-F8FE-46DD-BE4C-69F85A675116}.Release|x64.Build.0 = Release|Any CPU
{F79E3061-F8FE-46DD-BE4C-69F85A675116}.Release|x86.ActiveCfg = Release|Any CPU
{F79E3061-F8FE-46DD-BE4C-69F85A675116}.Release|x86.Build.0 = Release|Any CPU
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Debug|Any CPU.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Debug|ARM.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Debug|ARM64.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Debug|x64.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Debug|x86.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Debug|x86.Build.0 = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|Any CPU.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|Any CPU.Build.0 = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|ARM.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|ARM.Build.0 = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|ARM64.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|ARM64.Build.0 = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|x64.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|x64.Build.0 = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|x86.ActiveCfg = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.DefaultBuild|x86.Build.0 = Debug|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Release|Any CPU.ActiveCfg = Release|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Release|Any CPU.Build.0 = Release|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Release|ARM.ActiveCfg = Release|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Release|ARM64.ActiveCfg = Release|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Release|x64.ActiveCfg = Release|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Release|x86.ActiveCfg = Release|x86
{4409CFB9-DFFA-49A3-B416-FC188DD5D7D1}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
101 changes: 74 additions & 27 deletions Program/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 49 additions & 11 deletions Program/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public partial class Form1 : Form
RegistryKey progKey = Registry.CurrentUser.OpenSubKey("Software\\Classes\\" + Application.ProductName, true);
protected StatusBar mainStatusBar = new StatusBar();
protected StatusBarPanel statusPanel = new StatusBarPanel();
public bool isBusiness;
public bool isHeavy;
public int labelType;
public string titleString;
public Form1(string[] args)
{
Expand All @@ -24,9 +24,11 @@ public Form1(string[] args)
checkKey();
cbOntop.Checked = Properties.Settings.Default.onTop;
cbOpenWith.Checked = Properties.Settings.Default.openWith;
cbBusiness.Checked = Properties.Settings.Default.businessLabel;
labelType = Properties.Settings.Default.labelType;
rbStandard.Checked = labelType == 0;
rbBusiness.Checked = labelType == 1;
rbReturn.Checked = labelType == 2;
cbHeavy.Checked = Properties.Settings.Default.heavyPackage;
isBusiness = cbBusiness.Checked;
isHeavy = cbHeavy.Checked;
setTitle();
if (args.Length == 1)
Expand Down Expand Up @@ -85,7 +87,13 @@ private Bitmap convertPDF(string filename)
Rectangle rectGoGreen;
Rectangle rectPayed;
Bitmap bitmapLabel;
if (isBusiness)
if (labelType == 2)
{
rectMain = new Rectangle(1920, 65, 1075, 755);
rectMiddle = new Rectangle(1850, 885, 860, 145);
rectBar = new Rectangle(1912, 1100, 1075, 860);
}
else if (labelType == 1)
{
rectMain = new Rectangle(-20, 0, 1120, 705);
rectMiddle = new Rectangle(0, 700, 1090, 140);
Expand All @@ -95,7 +103,7 @@ private Bitmap convertPDF(string filename)
{
rectMain = new Rectangle(1860, 95, 1075, 705);
rectMiddle = new Rectangle(1850, 885, 860, 145);
rectBar = new Rectangle(1860, 1345, 1075, 860);
rectBar = new Rectangle(1860, 1350, 1075, 860);
}

rectLine = new Rectangle(1860, 1018, 1075, 17);
Expand All @@ -116,8 +124,9 @@ private Bitmap convertPDF(string filename)

doc.LoadFromFile(filename);
source = doc.SaveAsImage(0, 273, 273);
source.Save("C://Temp//test1.jpg");

if (!isBusiness) source.RotateFlip(RotateFlipType.Rotate90FlipNone);
if (labelType != 1) source.RotateFlip(RotateFlipType.Rotate90FlipNone);
bitmapMain = getClip(source, rectMain);
bitmapMiddle = getClip(source, rectMiddle);
bitmapBar = getClip(source, rectBar);
Expand All @@ -140,7 +149,13 @@ private Bitmap convertPDF(string filename)
{
g.Clear(Color.White);
g.DrawImage(bitmapMain, 0, 1);
if (isBusiness)
if (labelType == 2)
{
g.DrawImage(bitmapBar, 760, -70);
if (isHeavy) g.DrawImage(bitmapHeavy, 475, 4);

}
else if (labelType == 1)
{
g.DrawImage(bitmapBar, 705, 5);
g.DrawImage(bitmapMiddle, 620, 5);
Expand Down Expand Up @@ -397,11 +412,34 @@ private void cbOntop_CheckedChanged(object sender, EventArgs e)
Properties.Settings.Default.Save();
}

private void cbBusiness_CheckedChanged(object sender, EventArgs e)
private void rbBusiness_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.businessLabel = cbBusiness.Checked;
isBusiness = cbBusiness.Checked;
Properties.Settings.Default.Save();
if (rbBusiness.Checked)
{
labelType = 1;
Properties.Settings.Default.labelType = 1;
Properties.Settings.Default.Save();
}
}

private void rbReturn_CheckedChanged(object sender, EventArgs e)
{
if (rbReturn.Checked)
{
labelType = 2;
Properties.Settings.Default.labelType = 2;
Properties.Settings.Default.Save();
}
}

private void rbStandard_CheckedChanged(object sender, EventArgs e)
{
if (rbStandard.Checked)
{
labelType = 0;
Properties.Settings.Default.labelType = 0;
Properties.Settings.Default.Save();
}
}

private void cbHeavy_CheckedChanged(object sender, EventArgs e)
Expand Down
5 changes: 4 additions & 1 deletion Program/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public SingleInstanceController()
void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e)
{
Form1 form = MainForm as Form1;
form.LoadFile(e.CommandLine[1]);
if (e.CommandLine.Count == 2)
{
form.LoadFile(e.CommandLine[1]);
}
}

protected override void OnCreateMainForm()
Expand Down
Loading

0 comments on commit ee8c9c0

Please sign in to comment.