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)); } }
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)); }
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); }
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); } }
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); }
/// <summary> /// Initializes instance of ControllerTouchedEventArgs. /// </summary> /// <param name="touchPoint">Touch point.</param> public ControllerTouchedEventArgs(Point touchPoint) { TouchPoint = touchPoint; }