ByteScout QR Code SDK - C# - Create Colored QR Code - ByteScout

ByteScout QR Code SDK – C# – Create Colored QR Code

  • Home
  • /
  • Articles
  • /
  • ByteScout QR Code SDK – C# – Create Colored QR Code

How to create colored QR code in C# with ByteScout QR Code

This tutorial will show how to create colored QR code 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 barcode generator SDK with tunnable quality and features like QR Code embedded logo or images. Supports batch generation and specialized features like encoding of vCard and other structures inside QR Code barcodes. It can create colored QR code in C#.

The SDK samples like this one below explain how to quickly make your application do create colored QR code in C# with the help of ByteScout QR Code. Follow the instructions from the scratch to work and copy the C# code. Code testing will allow the function to be tested and work properly with your data.

Free trial version of ByteScout QR Code is available on our website. Documentation and source code samples are included.

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

ColoredQRCode.csproj
      
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}</ProjectGuid> <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ColoredQRCode</RootNamespace> <AssemblyName>ColoredQRCode</AssemblyName> <OldToolsVersion>3.5</OldToolsVersion> <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.Drawing" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> </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

ColoredQRCode.sln
      
Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColoredQRCode", "ColoredQRCode.csproj", "{A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {A657F388-7D2A-4C05-9E04-6F6FAFF16F0C}.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

Program.cs
      
using System.Diagnostics; using System.Drawing; using Bytescout.BarCode; namespace ColoredQRCode { class Program { static void Main(string[] args) { // Create and activate QRCode instance using (QRCode barcode = new QRCode()) { barcode.RegistrationName = "demo"; barcode.RegistrationKey = "demo"; // Set background color barcode.BackColor = Color.Yellow; // Set foreground color barcode.ForeColor = Color.Red; // Set value barcode.Value = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 1234567890"; // Save barcode to image barcode.SaveImage("result.png"); } // Open the image in default image viewer (for demo purpose) Process.Start("result.png"); } } }

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