ByteScout QR Code SDK - C# - Create QR Code with Binary Data - ByteScout

ByteScout QR Code SDK – C# – Create QR Code with Binary Data

  • Home
  • /
  • Articles
  • /
  • ByteScout QR Code SDK – C# – Create QR Code with Binary Data

How to create QR code with binary data in C# using ByteScout QR Code

How to create QR code with binary data in C#

We made thousands of pre-made source code pieces for easy implementation in your own programming projects. ByteScout QR Code is QR Code generation library. It provides full control on the quality, features and encoding. Can embed logo image right into QR Code itself. Batch barcode generation, and many special features like vCard or URL encoding are also supported. It can be used to create QR code with binary data using C#.

This rich sample source code in C# for ByteScout QR Code includes the number of functions and options you should do calling the API to create QR code with binary data. Just copy and paste the code into your C# application’s code and follow the instruction. Enjoy writing a code with ready-to-use sample C# codes.

Free trial version of ByteScout QR Code is available for download from our website. Get it to try other source code samples for C#.

Try it today: Get 60 Day Free Trial or sign up for Web API

Program.cs
      
using System.Diagnostics; using System.Text; using Bytescout.BarCode; namespace QRCodeWithBinaryData { class Program { static void Main(string[] args) { // Create and activate QRCode component instance using (QRCode barcode = new QRCode()) { barcode.RegistrationName = "demo"; barcode.RegistrationKey = "demo"; // Sample byte array to use as value byte[] byteArray = new byte[] { 0, 10, 11, 12, 13, 14, 15, 0xFF }; // Set value by converting byte array to string barcode.Value = Encoding.ASCII.GetString(byteArray); // Save barcode image barcode.SaveImage("result.png"); // Open the image in default associated application (for the demo purpose) Process.Start("result.png"); } } } }

Try it today: Get 60 Day Free Trial or sign up for Web API

QRCodeWithBinaryData.csproj
      
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{52554423-9A7B-456A-8026-845D1846585E}</ProjectGuid> <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>QRCodeWithBinaryData</RootNamespace> <AssemblyName>QRCodeWithBinaryData</AssemblyName> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="Bytescout.BarCode.QRCode, Version=1.0.0.100, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>c:\Program Files\Bytescout QR Code SDK\net40\Bytescout.BarCode.QRCode.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project>

Try it today: Get 60 Day Free Trial or sign up for Web API

QRCodeWithBinaryData.sln
      
Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QRCodeWithBinaryData", "QRCodeWithBinaryData.csproj", "{52554423-9A7B-456A-8026-845D1846585E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {52554423-9A7B-456A-8026-845D1846585E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {52554423-9A7B-456A-8026-845D1846585E}.Debug|Any CPU.Build.0 = Debug|Any CPU {52554423-9A7B-456A-8026-845D1846585E}.Release|Any CPU.ActiveCfg = Release|Any CPU {52554423-9A7B-456A-8026-845D1846585E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

Try it today: Get 60 Day Free Trial or sign up for Web API

MORE INFORMATION

Get 60 Day Free Trial or Visit ByteScout QR Code page

Explore ByteScout QR Code documentation

WEB API VERSION

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next