/// <summary> /// Encodes the raw data into binary form representing bars and spaces. Also generates an Image of the barcode. /// </summary> /// <param name="iType">Type of encoding to use.</param> /// <param name="Data">Raw data to encode.</param> /// <param name="IncludeLabel">Include the label at the bottom of the image with data encoded.</param> /// <param name="DrawColor">Foreground color</param> /// <param name="BackColor">Background color</param> /// <param name="Width">Width of the resulting barcode.(pixels)</param> /// <param name="Height">Height of the resulting barcode.(pixels)</param> /// <param name="XML">XML representation of the data and the image of the barcode.</param> /// <returns>Image representing the barcode.</returns> public static Image DoEncode(BarCodeType iType, string Data, bool IncludeLabel, Color DrawColor, Color BackColor, int Width, int Height, ref string XML) { using (BarcodeLib b = new BarcodeLib()) { b.IncludeLabel = IncludeLabel; Image i = b.Encode(iType, Data, DrawColor, BackColor, Width, Height); XML = b.XML; return(i); }//using }