Projektdateien hinzufügen.
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.11.35219.272
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QR-Code-Generator", "QR-Code-Generator\QR-Code-Generator.csproj", "{F2A91F64-A3F5-46C0-9E58-A3F8A8A67496}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{F2A91F64-A3F5-46C0-9E58-A3F8A8A67496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{F2A91F64-A3F5-46C0-9E58-A3F8A8A67496}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{F2A91F64-A3F5-46C0-9E58-A3F8A8A67496}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F2A91F64-A3F5-46C0-9E58-A3F8A8A67496}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {CED21D64-9D33-4424-BDA4-36DDE450548D}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
Generated
+165
@@ -0,0 +1,165 @@
|
|||||||
|
namespace QR_Code_Generator
|
||||||
|
{
|
||||||
|
partial class Main
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
tabControl1 = new TabControl();
|
||||||
|
tabPage1 = new TabPage();
|
||||||
|
bt_gen_QR_URL = new Button();
|
||||||
|
label1 = new Label();
|
||||||
|
tb_URL = new TextBox();
|
||||||
|
tabPage2 = new TabPage();
|
||||||
|
pb_QRC = new PictureBox();
|
||||||
|
button1 = new Button();
|
||||||
|
pb_icon = new PictureBox();
|
||||||
|
tabControl1.SuspendLayout();
|
||||||
|
tabPage1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pb_QRC).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pb_icon).BeginInit();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// tabControl1
|
||||||
|
//
|
||||||
|
tabControl1.Controls.Add(tabPage1);
|
||||||
|
tabControl1.Controls.Add(tabPage2);
|
||||||
|
tabControl1.Location = new Point(12, 12);
|
||||||
|
tabControl1.Name = "tabControl1";
|
||||||
|
tabControl1.SelectedIndex = 0;
|
||||||
|
tabControl1.Size = new Size(420, 200);
|
||||||
|
tabControl1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage1
|
||||||
|
//
|
||||||
|
tabPage1.Controls.Add(bt_gen_QR_URL);
|
||||||
|
tabPage1.Controls.Add(label1);
|
||||||
|
tabPage1.Controls.Add(tb_URL);
|
||||||
|
tabPage1.Location = new Point(4, 24);
|
||||||
|
tabPage1.Name = "tabPage1";
|
||||||
|
tabPage1.Padding = new Padding(3);
|
||||||
|
tabPage1.Size = new Size(412, 172);
|
||||||
|
tabPage1.TabIndex = 0;
|
||||||
|
tabPage1.Text = "tabPage1";
|
||||||
|
tabPage1.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// bt_gen_QR_URL
|
||||||
|
//
|
||||||
|
bt_gen_QR_URL.Location = new Point(71, 91);
|
||||||
|
bt_gen_QR_URL.Name = "bt_gen_QR_URL";
|
||||||
|
bt_gen_QR_URL.Size = new Size(254, 23);
|
||||||
|
bt_gen_QR_URL.TabIndex = 2;
|
||||||
|
bt_gen_QR_URL.Text = "generiere QR";
|
||||||
|
bt_gen_QR_URL.UseVisualStyleBackColor = true;
|
||||||
|
bt_gen_QR_URL.Click += bt_gen_QR_URL_Click;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
label1.AutoSize = true;
|
||||||
|
label1.Location = new Point(34, 70);
|
||||||
|
label1.Name = "label1";
|
||||||
|
label1.Size = new Size(31, 15);
|
||||||
|
label1.TabIndex = 1;
|
||||||
|
label1.Text = "URL:";
|
||||||
|
//
|
||||||
|
// tb_URL
|
||||||
|
//
|
||||||
|
tb_URL.Location = new Point(71, 62);
|
||||||
|
tb_URL.Name = "tb_URL";
|
||||||
|
tb_URL.Size = new Size(254, 23);
|
||||||
|
tb_URL.TabIndex = 0;
|
||||||
|
tb_URL.Text = "https://www.youtube.com/watch?v=3XW7SxiJC-k";
|
||||||
|
//
|
||||||
|
// tabPage2
|
||||||
|
//
|
||||||
|
tabPage2.Location = new Point(4, 24);
|
||||||
|
tabPage2.Name = "tabPage2";
|
||||||
|
tabPage2.Padding = new Padding(3);
|
||||||
|
tabPage2.Size = new Size(412, 294);
|
||||||
|
tabPage2.TabIndex = 1;
|
||||||
|
tabPage2.Text = "tabPage2";
|
||||||
|
tabPage2.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// pb_QRC
|
||||||
|
//
|
||||||
|
pb_QRC.Location = new Point(16, 218);
|
||||||
|
pb_QRC.Name = "pb_QRC";
|
||||||
|
pb_QRC.Size = new Size(300, 300);
|
||||||
|
pb_QRC.SizeMode = PictureBoxSizeMode.Zoom;
|
||||||
|
pb_QRC.TabIndex = 1;
|
||||||
|
pb_QRC.TabStop = false;
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
button1.Location = new Point(434, 36);
|
||||||
|
button1.Name = "button1";
|
||||||
|
button1.Size = new Size(75, 23);
|
||||||
|
button1.TabIndex = 2;
|
||||||
|
button1.Text = "Icon?";
|
||||||
|
button1.UseVisualStyleBackColor = true;
|
||||||
|
button1.Click += button1_Click;
|
||||||
|
//
|
||||||
|
// pb_icon
|
||||||
|
//
|
||||||
|
pb_icon.Location = new Point(625, 40);
|
||||||
|
pb_icon.Name = "pb_icon";
|
||||||
|
pb_icon.Size = new Size(184, 168);
|
||||||
|
pb_icon.SizeMode = PictureBoxSizeMode.Zoom;
|
||||||
|
pb_icon.TabIndex = 3;
|
||||||
|
pb_icon.TabStop = false;
|
||||||
|
//
|
||||||
|
// Main
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(929, 633);
|
||||||
|
Controls.Add(pb_icon);
|
||||||
|
Controls.Add(button1);
|
||||||
|
Controls.Add(pb_QRC);
|
||||||
|
Controls.Add(tabControl1);
|
||||||
|
Name = "Main";
|
||||||
|
Text = "QR-Code Generator";
|
||||||
|
tabControl1.ResumeLayout(false);
|
||||||
|
tabPage1.ResumeLayout(false);
|
||||||
|
tabPage1.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pb_QRC).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pb_icon).EndInit();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private TabControl tabControl1;
|
||||||
|
private TabPage tabPage1;
|
||||||
|
private Button bt_gen_QR_URL;
|
||||||
|
private Label label1;
|
||||||
|
private TextBox tb_URL;
|
||||||
|
private TabPage tabPage2;
|
||||||
|
private PictureBox pb_QRC;
|
||||||
|
private Button button1;
|
||||||
|
private PictureBox pb_icon;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
using QRCoder;
|
||||||
|
using System.Reflection.Emit;
|
||||||
|
using static QRCoder.PayloadGenerator;
|
||||||
|
|
||||||
|
namespace QR_Code_Generator
|
||||||
|
{
|
||||||
|
public partial class Main : Form
|
||||||
|
{
|
||||||
|
public Main()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bt_gen_QR_URL_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Url generator = new Url(tb_URL.Text);
|
||||||
|
string payload = generator.ToString();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
QRCodeGenerator qrg = new QRCodeGenerator();
|
||||||
|
QRCodeData qrCodeData = qrg.CreateQrCode(payload, QRCodeGenerator.ECCLevel.H);
|
||||||
|
generateQR(qrCodeData);
|
||||||
|
|
||||||
|
void generateQR(QRCodeData qrCodeData)
|
||||||
|
{
|
||||||
|
Bitmap icon = null;
|
||||||
|
if (pb_icon.Image != null)
|
||||||
|
{
|
||||||
|
icon = (Bitmap)pb_icon.Image;
|
||||||
|
}
|
||||||
|
using (QRCode qrCode = new QRCode(qrCodeData))
|
||||||
|
{
|
||||||
|
Bitmap qrCodeImage = qrCode.GetGraphic(20, Color.Black, Color.White, icon, 25, 3);
|
||||||
|
pb_QRC.Image = qrCodeImage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
pb_icon.Image = SelectImage();
|
||||||
|
}
|
||||||
|
private Image SelectImage()
|
||||||
|
{
|
||||||
|
using (OpenFileDialog openFileDialog = new OpenFileDialog())
|
||||||
|
{
|
||||||
|
// Filter für Bilddateien festlegen
|
||||||
|
openFileDialog.Filter = "Bilddateien (*.jpg;*.jpeg;*.png;*.bmp;*.gif)|*.jpg;*.jpeg;*.png;*.bmp;*.gif";
|
||||||
|
openFileDialog.Title = "Bild auswählen";
|
||||||
|
|
||||||
|
// Wenn der Benutzer eine Datei auswählt und auf OK klickt
|
||||||
|
if (openFileDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
// Bild aus dem ausgewählten Pfad laden und zurückgeben
|
||||||
|
return Image.FromFile(openFileDialog.FileName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Gibt null zurück, wenn keine Datei ausgewählt wurde
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
namespace QR_Code_Generator
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
|
// see https://aka.ms/applicationconfiguration.
|
||||||
|
ApplicationConfiguration.Initialize();
|
||||||
|
Application.Run(new Main());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
|
<RootNamespace>QR_Code_Generator</RootNamespace>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="QRCoder" Version="1.6.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user