ByteScout Premium Suite - C++ - Generate barcode monochrome bitmap with barcode sdk - ByteScout

ByteScout Premium Suite – C++ – Generate barcode monochrome bitmap with barcode sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – C++ – Generate barcode monochrome bitmap with barcode sdk

How to generate barcode monochrome bitmap with barcode sdk in C++ with ByteScout Premium Suite

How to write a robust code in C++ to generate barcode monochrome bitmap with barcode sdk with this step-by-step tutorial

The sample source code below will teach you how to generate barcode monochrome bitmap with barcode sdk in C++. ByteScout Premium Suite is the set that includes 12 SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can be applied to generate barcode monochrome bitmap with barcode sdk using C++.

Want to save time? You will save a lot of time on writing and testing code as you may just take the C++ code from ByteScout Premium Suite for generate barcode monochrome bitmap with barcode sdk below and use it in your application. Simply copy and paste in your C++ project or application you and then run your app! If you want to use these C++ sample examples in one or many applications then they can be used easily.

You can download free trial version of ByteScout Premium Suite from our website to see and try many others source code samples for C++.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

BarcodeGenerationExample.cpp
      
#include "stdafx.h" #import "Bytescout.BarCode.tlb" raw_interfaces_only using namespace Bytescout_BarCode; int _tmain(int argc, _TCHAR* argv[]) { // Initialize COM. HRESULT hr = CoInitialize(NULL); // Create the interface pointer. IBarcodePtr pIBarcode(__uuidof(Barcode)); // set the registration name and key BSTR regname = ::SysAllocString(L"DEMO"); pIBarcode->put_RegistrationName(regname); ::SysFreeString(regname); BSTR regkey = ::SysAllocString(L"DEMO"); pIBarcode->put_RegistrationKey(regkey); ::SysFreeString(regkey); // Set barcode type (symbology) pIBarcode->put_Symbology(SymbologyType_DataMatrix); // Set monochrome output pIBarcode->put_ProduceMonochromeImages(VARIANT_TRUE); // Set barcode value BSTR value = ::SysAllocString(L"Barcode Value 1234567890"); pIBarcode->put_Value(value); ::SysFreeString(value); // Save barcode image BSTR fileName = ::SysAllocString(L"result.png"); pIBarcode->SaveImage(fileName); ::SysFreeString(fileName); pIBarcode->Release(); // Uninitialize COM. CoUninitialize(); return 0; }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

stdafx.cpp
      
// stdafx.cpp : source file that includes just the standard includes // BarcodeGenerationExample.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

stdafx.h
      
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include "targetver.h" #include <stdio.h> #include <tchar.h> // TODO: reference additional headers your program requires here

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

targetver.h
      
#pragma once // Including SDKDDKVer.h defines the highest available Windows platform. // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. #include <SDKDDKVer.h>

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next