Renders the Tag into a byte array representing an image.

Namespace: Microsoft.Tag.CampaignManagement
Assembly: Microsoft.Tag.CampaignManagement (in Microsoft.Tag.CampaignManagement.dll) Version: 1.0.7785.0 (1.0.7785.0)

Syntax

C#
byte[] GetBarcode(
	UserCredential userCredential,
	string categoryName,
	string tagName,
	ImageTypes imageType,
	float sizeInInches,
	DecorationType decorationsType,
	bool isBlackWhite
)
Visual Basic
Function GetBarcode ( _
	userCredential As UserCredential, _
	categoryName As String, _
	tagName As String, _
	imageType As ImageTypes, _
	sizeInInches As Single, _
	decorationsType As DecorationType, _
	isBlackWhite As Boolean _
) As Byte()
Visual C++
array<unsigned char>^ GetBarcode(
	UserCredential^ userCredential, 
	String^ categoryName, 
	String^ tagName, 
	ImageTypes imageType, 
	float sizeInInches, 
	DecorationType decorationsType, 
	bool isBlackWhite
)

Parameters

userCredential
Type: Microsoft.Tag.CampaignManagement..::..UserCredential
A 64-bit encrypted GUID specifying the user credential.
categoryName
Type: System..::..String
The name of the Category containing the Tag to be rendered.
tagName
Type: System..::..String
The name of the Tag to be rendered.
imageType
Type: Microsoft.Tag.CampaignManagement..::..ImageTypes
Image render Type: Includes pdf, wmf, jpeg, png, gif, and tif.
sizeInInches
Type: System..::..Single
Barcode Size (in inches): Ranging from 0.75 to 120.0.
decorationsType
Type: Microsoft.Tag.CampaignManagement..::..DecorationType
Choose one of four Color Formats.
isBlackWhite
Type: System..::..Boolean
Choose just the black and white format.

Return Value

true if the method succeeds

false if the method fails

Remarks

CreateBarcode renders a Tag Barcode into a byte array representing a specified image type:

  • Render Type: pdf, wmf, jpeg, png, gif, tif.
  • Barcode Inch Size: Ranging from 0.75" to 120.0".
  • Four Color Formats or Black and White.

CreateBarcode fails when any of the following invalid parameters is passed or failure conditions occurs:

  • Category not found.
  • Category has an invalid status.
  • Category is paused.
  • Tag not found.
  • Tag status is invalid.
  • Tag is paused.

Examples

This code sample demonstrates how to call GetBarcode(UserCredential, String, String, ImageTypes, Single, DecorationType, Boolean).
CopyC#
private void LocalCreateBarcode()
{
    try
    {
        MIBPContractClient OMIBPClient = new MIBPContractClient();
        UserCredential oCredential = new UserCredential();

        oCredential.AccessToken = "Enter your access token";
        float Size = 5.5;
        bool IsBlackAndWhite = true;
        byte[] oBarcode = OMIBPClient.GetBarcode(oCredential,
                                                "Category Name",
                                                "Tag Name",
                                                ImageTypes.tiff,
                                                Size,
                                                DecorationType.HCCBRP_DECORATION_NONE, 
                                                IsBlackAndWhite);
        //render the oBarcode byte array into an image.
    }
    catch
    {
        throw;
    }
}

See Also