示例#1
0
        /// <summary>
        /// Specifies where we're going to draw on top of the template, what we're going to
        /// say and with which fonts, colours, decoration, etc.
        /// </summary>
        protected override void RegisterAreasOfInterest()
        {
            // Setup the position of each asset (if they've not been specified outside the class)
            Area mapCaptionRect = new Area(this.GDI, "#mapCaption", 1715, 1520, 650, 120);
            Position qrCodePosition = new Position(this.GDI,"#qrCode", 1704, 1800);
            Position qRCaptionPosition = new Position(this.GDI,"#qrCaption", 1704, 2000);

            // Add caption on to the polaroid
            Typeface mapCaptionFont = new Typeface("Bradley Hand ITC")
                .Bold(true)
                .Italic(true)
                .FontColour("#000000")
                .FontSize(35)
            ;

            Typeface gameDetailFont = new Typeface()
                .FontColour("#252525")
                .FontSize(50)
            ;
            Typeface gameLinkFont = new Typeface(gameDetailFont)
                .Underline(true)
                .FontColour("#cc0000")
            ;

            Caption mapCaption =
                new Caption(base.GDI, "#mapCaption", this.Venue)
                .Typeface(mapCaptionFont)
                .HorizontalAlignment(StringAlignment.Near)
                .Rect(mapCaptionRect)
            ;

            // Add the Quick Response code
            QRCode qrCode =
                new QRCode(base.GDI, "#qrCode", this.SignUpLink)
                .TopLeft(qrCodePosition)
                .Data(this.SignUpLink)
                .Scale(20)
                .Version(4)
            ;

            // add instructions
            Caption where = new Caption(base.GDI, "#where")
                .Text(this.Venue)
                .Rect(200, 1000, 1400, 300)
                .Typeface(gameDetailFont)
            ;
            Caption when = new Caption(base.GDI, "#when")
                .Text(this.Frequency)
                .Rect(200, 1500, 1400, 300)
                .Typeface(gameDetailFont)
            ;
            Caption howSignUp = new Caption(base.GDI, "#how")
                .Text("Join the game with the QR code, or at the website below:")
                .Rect(200, 2000, 1400, 300)
                .Typeface(gameDetailFont)
            ;
            Caption howLink = new Caption(base.GDI, "#how")
                .Text(this.SignUpLink)
                .Rect(200, 2200, 1400, 300)
                .Typeface(gameLinkFont)
            ;

            List<Position> areas = new List<Position>();

            areas.Add( where );
            areas.Add( when );
            areas.Add( howSignUp );
            areas.Add( howLink );

            areas.Add( this.VenueMap );
            areas.Add( mapCaption );
            areas.Add( qrCode );

            // Now we've defined all our instructions for what to draw, tell the PosterBuilder
            base.AreasOfInterest = areas;
        }
示例#2
0
		/// <summary>
		/// Copy constructor: Initialises this object from the copy
		/// </summary>
		/// <param name="copy">Object to make a copy from</param>
		public Caption(Caption copy) : base(copy) {
			_Text = copy._Text;
			_HorizontalAlignment = copy._HorizontalAlignment;
			_VerticalAlignment = copy._VerticalAlignment;
			_Typeface = copy._Typeface;
		}
示例#3
0
        /// <summary>
        /// Specifies where we're going to draw on top of the template, what we're going to
        /// say and with which fonts, colours, decoration, etc.
        /// </summary>
        protected override void RegisterAreasOfInterest()
        {
            Typeface.DEFAULT_FONT_NAME = "Trebuchet MS";
            Typeface.DEFAULT_HEX_COLOUR = "#8f87ca";
            Typeface.DEFAULT_FONT_SIZE = 75f;

            // Define the font decorations we'll be using in the Titles and dynamic text
            Typeface titleFace = new Typeface().FontColour("#000000");
            Typeface textFace = new Typeface().Bold(true);
            Typeface urlFace = new Typeface().Bold(true).Underline(true);

            // Define where on the image we need to draw each of our captions
            // ... recall we're using the same X, width and height.  We only need modify the Y
            Caption whenTitle = new Caption(base.GDI, "#whenTitle", "WHEN?")
                .Typeface(titleFace)
                .HorizontalAlignment(StringAlignment.Center)
                .Rect(BaseX, BaseY, BaseWidth, BaseHeight)
            ;

            Caption whenText = new Caption(base.GDI, "#whenText", string.Format("We play {0}.", this.Frequency) )
                .Typeface(textFace)
                .HorizontalAlignment(StringAlignment.Center)
                .Rect(BaseX, BaseY+150, BaseWidth, BaseHeight)
            ;

            Caption whereTitle = new Caption(base.GDI, "#whereTitle", "WHERE?")
                .Typeface(titleFace)
                .HorizontalAlignment(StringAlignment.Center)
                .Rect(BaseX, BaseY+400, BaseWidth, BaseHeight)
            ;

            Caption whereText = new Caption(base.GDI, "#whereText", this.Venue)
                .Typeface(textFace)
                .HorizontalAlignment(StringAlignment.Center)
                .Rect(BaseX, BaseY+550, BaseWidth, BaseHeight)
            ;

            Caption howTitle = new Caption(base.GDI, "#howTitle", "HOW?")
                .Typeface(titleFace)
                .HorizontalAlignment(StringAlignment.Center)
                .Rect(BaseX, BaseY+800, BaseWidth, BaseHeight)
            ;

            Caption howText = new Caption(base.GDI, "#howText", "Sign-up at:")
                .Typeface(textFace)
                .HorizontalAlignment(StringAlignment.Center)
                .Rect(BaseX, BaseY+950, BaseWidth, BaseHeight)
            ;
            Caption howUrl = new Caption(base.GDI, "#howUrl", this.SignUpLink)
                .Typeface(urlFace)
                .HorizontalAlignment(StringAlignment.Center)
                .Rect(BaseX, BaseY+1100, BaseWidth, BaseHeight)
            ;

            // And finally bring it all together and setup our rectangles, captions and fonts
            List<Position> areas = new List<Position>();
            areas.Add( whenTitle );
            areas.Add( whenText );
            areas.Add( whereTitle );
            areas.Add( whereText );
            areas.Add( howTitle );
            areas.Add( howText );
            areas.Add( howUrl );

            // Now we've defined all our instructions for what to draw, tell the PosterBuilder
            base.AreasOfInterest = areas;
        }
示例#4
0
        /// <summary>
        /// Specifies where we're going to draw on top of the template, what we're going to
        /// say and with which fonts, colours, decoration, etc.
        /// </summary>
        protected override void RegisterAreasOfInterest()
        {
            Typeface.DEFAULT_FONT_NAME = "Bradley Hand ITC";
            Typeface.DEFAULT_HEX_COLOUR = "#A56BDB";
            Typeface.DEFAULT_FONT_SIZE = 11;

            // roughly number of years since they started playing
            int years = (int)Math.Ceiling((DateTime.Now - this.Birthday).TotalDays / 365d);

            string birthdayMsg =
                string.Format("On {0} it's your pitch birthday.  You've been playing football with us for {1} years!",
                    this.Birthday.ToString("MMM dd"), years
                );

            Caption hello =
                new Caption(base.GDI, "#hello", "Hi " + this.OfferFor + ",")
                    .TopLeft(5, 65)
                ;

            Caption noticedYourBithday =
                new Caption(base.GDI, "#birthday", birthdayMsg)
                    .Rect(5, 90, 350, 100)
                ;

            Caption offer =
                new Caption(base.GDI, "#offer", this.SpecialOffer)
                    .Rect(5, 135, 350, 100)
                ;

            QRCode qrCode =
                new QRCode(base.GDI, "#qrCode", this.GenerateQRCodeData())
                    .TopLeft(350, 75)
                    .Scale(2)
                    .Version(4)
            ;

            this.AreasOfInterest.Add(hello);
            this.AreasOfInterest.Add(noticedYourBithday);
            this.AreasOfInterest.Add(offer);
            this.AreasOfInterest.Add(qrCode);
        }
示例#5
0
 /// <summary>
 /// Copy constructor: Initialises this object from the copy
 /// </summary>
 /// <param name="copy">Object to make a copy from</param>
 public Caption(Caption copy)
     : base(copy)
 {
     _Text = copy._Text;
     _HorizontalAlignment = copy._HorizontalAlignment;
     _VerticalAlignment = copy._VerticalAlignment;
     _Typeface = copy._Typeface;
 }