예제 #1
0
        private void GetImage(out bool formatError, out SizeD size, float requestedHeight)
        {
            formatError = false;
            settings.RequestedTotalHeight = requestedHeight;
            BarCodeGenerator barCodeGenerator = new BarCodeGenerator(settings);
            string           data             = settings.Data;

            if (barCodeGenerator.AssembleBarCode().Validate(ref data) == BarCodeFormatValidationResult.Success)
            {
                image = barCodeGenerator.GenerateImage(ComponentHelper.TopWindow.CreatePangoLayout(""));
                size  = new SizeD(image.Width, image.Height);
            }
            else
            {
                formatError = true;
                size        = SetSizeOnError();
            }
        }