Beispiel #1
0
        private TemplateGraphicJersey GetTemplateGraphicJersey(ProductLineJersey line)
        {
            TemplateGraphicJersey result = new TemplateGraphicJersey();

            //
            // Actual pixels (easier to calculate)
            //
            result.NameBoundingBox   = new Rectangle(400, 300, 700, 150);
            result.NumberBoundingBox = new Rectangle(450, 550, 600, 500);

            result.NameManualPositionAdjustments   = new ManualPositionAdjustments(1.15f, -20);
            result.NumberManualPositionAdjustments = new ManualPositionAdjustments(1.20f, -105);

            //InstalledFontCollection installedFontCollection = new InstalledFontCollection();
            //PrivateFontCollection pf = new PrivateFontCollection();
            //pf.AddFontFile("C:\\ffdgraphics\\United Sans Cond Black\\UnitedSansCdBk.ttf");
            //FontFamily[] ff = pf.Families;

            result.NameFont = "United Sans Cd Bk";

            // result.NameFont = "Comic Sans MS";

            string templateFileName = string.Format("{0}\\{1}", Config.GraphicsRootDirectory(), "jersey-template-05.bmp");

            result.TemplateImage = Image.FromFile(templateFileName);

            return(result);
        }
        private TemplateGraphicJersey GetTemplateGraphicJersey(ProductLineJersey line, Template template)
        {
            TemplateGraphicJersey result = new TemplateGraphicJersey();

            TemplateAttrDataSet ds = new TemplateAttrDataSet(string.Format("select * from [dbo].[TEMPLATE_ATTRIBUTES] where template_id = {0}", line.TemplateId));

            //
            // Actual pixels (easier to calculate)
            //
            result.NameBoundingBox   = ds.GetGraphicRect(TemplateAttrDataSet.TemplateAttrTypeCode.tatcNameBoundingBoxRect);
            result.NumberBoundingBox = ds.GetGraphicRect(TemplateAttrDataSet.TemplateAttrTypeCode.tatcNumberBoundingBoxRect);

            result.NameManualPositionAdjustments = ds.GetManualPositionAdjustments(TemplateAttrDataSet.TemplateAttrTypeCode.tatcManualPosAdjsNameFontHeight,
                                                                                   TemplateAttrDataSet.TemplateAttrTypeCode.tatcManualPosAdjsNameFontVerticalPosition);

            result.NumberManualPositionAdjustments = ds.GetManualPositionAdjustments(TemplateAttrDataSet.TemplateAttrTypeCode.tatcManualPosAdjsNumberFontHeight,
                                                                                     TemplateAttrDataSet.TemplateAttrTypeCode.tatcManualPosAdjsNumberFontVertPosition);

            result.NameFont = ds.GetValueFromRowSet((int)TemplateAttrDataSet.TemplateAttrTypeCode.tatcNameFontName).ToString();// "Comic Sans MS";

            string templateFileName = string.Format("{0}\\Source Files\\{1}", Config.GraphicsRootDirectory(),
                                                    string.Format("{0}_{1:000}.bmp", template.TemplateDescShort, template.TemplateId));

            result.TemplateImage = Image.FromFile(templateFileName);

            return(result);
        }
        public static TemplateGraphicJersey GetTemplateGraphicJerseyAttributes(Template template)
        {
            TemplateGraphicJersey result = new TemplateGraphicJersey();

            TemplateAttrDataSet ds = new TemplateAttrDataSet(string.Format("select * from [dbo].[TEMPLATE_ATTRIBUTES] where template_id = {0}", template.TemplateId));

            //
            // Actual pixels (easier to calculate)
            //
            result.NameBoundingBox   = ds.GetGraphicRect(TemplateAttrDataSet.TemplateAttrTypeCode.tatcNameBoundingBoxRect);
            result.NumberBoundingBox = ds.GetGraphicRect(TemplateAttrDataSet.TemplateAttrTypeCode.tatcNumberBoundingBoxRect);

            result.NameManualPositionAdjustments = ds.GetManualPositionAdjustments(TemplateAttrDataSet.TemplateAttrTypeCode.tatcManualPosAdjsNameFontHeight,
                                                                                   TemplateAttrDataSet.TemplateAttrTypeCode.tatcManualPosAdjsNameFontVerticalPosition);

            result.NumberManualPositionAdjustments = ds.GetManualPositionAdjustments(TemplateAttrDataSet.TemplateAttrTypeCode.tatcManualPosAdjsNumberFontHeight,
                                                                                     TemplateAttrDataSet.TemplateAttrTypeCode.tatcManualPosAdjsNumberFontVertPosition);

            result.NameFont = ds.GetValueFromRowSet((int)TemplateAttrDataSet.TemplateAttrTypeCode.tatcNameFontName).ToString();// "Comic Sans MS";

            return(result);
        }