Exemplo n.º 1
0
 void IPainter.PaintImage(IndexedImage image, Point atPoint)
 {
     using (var bitmap = ToBitmap(image))
     {
         GdiGraphics.DrawImage(bitmap, new GdiPoint(atPoint.X + Shift.Width, atPoint.Y + Shift.Height));
     }
 }
Exemplo n.º 2
0
        void IPainter.PaintImage(IndexedImage image, Point atPoint)
        {
            var bitmap = ToBitmap(image);
            var xImage = XImage.FromGdiPlusImage(bitmap);

            PdfGraphics.DrawImage(xImage, new System.Drawing.Point(atPoint.X + Shift.Width, atPoint.Y + Shift.Height));
        }
Exemplo n.º 3
0
        void IPainter.PaintText(string text, Point atPoint, int pixelHeight, int argb, int spaceBetweenCharacters, FontBasePainter.TextDirection direction)
        {
            var state = PdfGraphics.Save();

            var font = GetPdfFont(pixelHeight);

            if (direction == FontBasePainter.TextDirection.VerticalUpward)
            {
                PdfGraphics.RotateAtTransform(-90, new XPoint(atPoint.X + Shift.Width, atPoint.Y + Shift.Height));
            }

            PdfGraphics.DrawString(text ?? "", font, GetBrush(argb), atPoint.X + Shift.Width, atPoint.Y + Shift.Height + pixelHeight);

            PdfGraphics.Restore(state);
        }
Exemplo n.º 4
0
        void IPainter.PaintSymbol(char symbol, Point atPoint, int symbolSize, int symbolBoxSize, int fontRgb, int backgroundRgb)
        {
            ((IPainter)this).FillRectangle(atPoint.X, atPoint.Y, symbolBoxSize, symbolBoxSize, backgroundRgb);

            if (fontRgb != backgroundRgb)
            {
                symbolSize = symbolSize * 9 / 10;

                var symbolShift = GetSymbolShift(symbol, symbolSize, symbolBoxSize);

                GdiGraphics.DrawString(
                    symbol.ToString(),
                    GetGdiFont(symbolSize),
                    GetBrush(fontRgb),
                    atPoint.X + Shift.Width + symbolShift.Width,
                    atPoint.Y + Shift.Height + symbolShift.Height);
            }
        }
Exemplo n.º 5
0
        void IPainter.PaintText(string text, Point atPoint, int pixelHeight, int argb, int spaceBetweenCharacters, FontBasePainter.TextDirection direction)
        {
            var font = GetGdiFont(pixelHeight);

            var stringFormat = new StringFormat();

            if (direction == FontBasePainter.TextDirection.VerticalDownward || direction == FontBasePainter.TextDirection.VerticalUpward)
            {
                stringFormat.FormatFlags = StringFormatFlags.DirectionVertical;
            }

            var verticalShift = 0;

            if (direction == FontBasePainter.TextDirection.VerticalUpward)
            {
                var textSize = GetTextSize(text, font);
                verticalShift = textSize.Width;
            }

            GdiGraphics.DrawString(text, font, GetBrush(argb), atPoint.X + Shift.Width, atPoint.Y + Shift.Height - verticalShift + 1f, stringFormat);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes instance of ControllerTouchedEventArgs.
 /// </summary>
 /// <param name="touchPoint">Touch point.</param>
 public ControllerTouchedEventArgs(Point touchPoint)
 {
     TouchPoint = touchPoint;
 }