Exemplo n.º 1
0
        /// <summary>
        ///		縦横位置を指定して矩形領域内に文字を描画する。
        /// </summary>
        public void DrawStringHelper(Graphics g, global::System.Drawing.Font font, Brush brush, HPosition hPos, VPosition vPos)
        {
            PointF drawpos = new PointF(0, 0);

            if (hPos == HPosition.Left && vPos == VPosition.Top)
            {
                g.DrawString(drawString, font, global::System.Drawing.Brushes.Black, drawpos);
                return;
            }

            SizeF strsize = g.MeasureString(drawString, font);

            if (hPos == HPosition.Right)
            {
                drawpos.X = width - strsize.Width - 1;
            }
            else if (hPos == HPosition.Center)
            {
                drawpos.X = (width - strsize.Width) / 2;
            }

            if (vPos == VPosition.Bottom)
            {
                drawpos.Y = height - strsize.Height - 1;
            }
            else if (vPos == VPosition.Middle)
            {
                drawpos.Y = (height - strsize.Height) / 2;
            }

            g.DrawString(drawString, font, brush, drawpos);
        }
Exemplo n.º 2
0
        public virtual void setFont(global::alphatab.platform.model.Font font)
        {
            unchecked
            {
                global::System.Drawing.FontStyle fontStyle = global::System.Drawing.FontStyle.Regular;
                if ((((font.getStyle() & 1)) != 0))
                {
                    fontStyle |= System.Drawing.FontStyle.Bold;
                }

                if ((((font.getStyle() & 2)) != 0))
                {
                    fontStyle |= System.Drawing.FontStyle.Italic;
                }

                this._fontSize = font.getSize();
                this._font     = new global::System.Drawing.Font(global::haxe.lang.Runtime.toString(font.getFamily()), ((float)(font.getSize())), ((global::System.Drawing.FontStyle)(fontStyle)), ((global::System.Drawing.GraphicsUnit)(global::System.Drawing.GraphicsUnit.Pixel)));
            }
        }
Exemplo n.º 3
0
        public override object __hx_setField(string field, int hash, object @value, bool handleProperties)
        {
            unchecked
            {
                switch (hash)
                {
                case 672263473:
                {
                    this._textBaseline = ((global::alphatab.model.TextBaseline)(@value));
                    return(@value);
                }


                case 2002104775:
                {
                    this._stringFormat = ((global::System.Drawing.StringFormat)(@value));
                    return(@value);
                }


                case 371286681:
                {
                    this._textAlign = ((global::alphatab.platform.model.TextAlign)(@value));
                    return(@value);
                }


                case 1993439662:
                {
                    this._font = ((global::System.Drawing.Font)(@value));
                    return(@value);
                }


                case 375895439:
                {
                    this._fontSize = ((double)(global::haxe.lang.Runtime.toDouble(@value)));
                    return(@value);
                }


                case 1828730163:
                {
                    this._lineWidth = ((double)(global::haxe.lang.Runtime.toDouble(@value)));
                    return(@value);
                }


                case 1178843300:
                {
                    this._color = ((global::System.Drawing.Color)(@value));
                    return(@value);
                }


                case 1059101146:
                {
                    this._pen = ((global::System.Drawing.Pen)(@value));
                    return(@value);
                }


                case 887070651:
                {
                    this._brush = ((global::System.Drawing.SolidBrush)(@value));
                    return(@value);
                }


                case 1658522975:
                {
                    this._currentY = ((float)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 1658522974:
                {
                    this._currentX = ((float)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 1760390271:
                {
                    this._currentPath = ((global::System.Drawing.Drawing2D.GraphicsPath)(@value));
                    return(@value);
                }


                case 1509814314:
                {
                    this._graphics = ((global::System.Drawing.Graphics)(@value));
                    return(@value);
                }


                case 1891834246:
                {
                    this._height = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 1179254087:
                {
                    this._width = ((int)(global::haxe.lang.Runtime.toInt(@value)));
                    return(@value);
                }


                case 961570460:
                {
                    this._image = ((global::System.Drawing.Bitmap)(@value));
                    return(@value);
                }


                default:
                {
                    return(base.__hx_setField(field, hash, @value, handleProperties));
                }
                }
            }
        }
Exemplo n.º 4
0
		public override   object __hx_setField(string field, int hash, object @value, bool handleProperties)
		{
			unchecked 
			{
				switch (hash)
				{
					case 672263473:
					{
						this._textBaseline = ((global::alphatab.model.TextBaseline) (@value) );
						return @value;
					}
					
					
					case 2002104775:
					{
						this._stringFormat = ((global::System.Drawing.StringFormat) (@value) );
						return @value;
					}
					
					
					case 371286681:
					{
						this._textAlign = ((global::alphatab.platform.model.TextAlign) (@value) );
						return @value;
					}
					
					
					case 1993439662:
					{
						this._font = ((global::System.Drawing.Font) (@value) );
						return @value;
					}
					
					
					case 375895439:
					{
						this._fontSize = ((double) (global::haxe.lang.Runtime.toDouble(@value)) );
						return @value;
					}
					
					
					case 1828730163:
					{
						this._lineWidth = ((double) (global::haxe.lang.Runtime.toDouble(@value)) );
						return @value;
					}
					
					
					case 1178843300:
					{
						this._color = ((global::System.Drawing.Color) (@value) );
						return @value;
					}
					
					
					case 1059101146:
					{
						this._pen = ((global::System.Drawing.Pen) (@value) );
						return @value;
					}
					
					
					case 887070651:
					{
						this._brush = ((global::System.Drawing.SolidBrush) (@value) );
						return @value;
					}
					
					
					case 1658522975:
					{
						this._currentY = ((float) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 1658522974:
					{
						this._currentX = ((float) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 1760390271:
					{
						this._currentPath = ((global::System.Drawing.Drawing2D.GraphicsPath) (@value) );
						return @value;
					}
					
					
					case 1509814314:
					{
						this._graphics = ((global::System.Drawing.Graphics) (@value) );
						return @value;
					}
					
					
					case 1891834246:
					{
						this._height = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 1179254087:
					{
						this._width = ((int) (global::haxe.lang.Runtime.toInt(@value)) );
						return @value;
					}
					
					
					case 961570460:
					{
						this._image = ((global::System.Drawing.Bitmap) (@value) );
						return @value;
					}
					
					
					default:
					{
						return base.__hx_setField(field, hash, @value, handleProperties);
					}
					
				}
				
			}
		}
Exemplo n.º 5
0
		public virtual   void setFont(global::alphatab.platform.model.Font font)
		{
			unchecked 
			{
				global::System.Drawing.FontStyle fontStyle = global::System.Drawing.FontStyle.Regular;
				if (( (( font.getStyle() & 1 )) != 0 )) 
				{
					fontStyle |= System.Drawing.FontStyle.Bold;
				}
				
				if (( (( font.getStyle() & 2 )) != 0 )) 
				{
					fontStyle |= System.Drawing.FontStyle.Italic;
				}
				
				this._fontSize = font.getSize();
				this._font = new global::System.Drawing.Font(global::haxe.lang.Runtime.toString(font.getFamily()), ((float) (font.getSize()) ), ((global::System.Drawing.FontStyle) (fontStyle) ), ((global::System.Drawing.GraphicsUnit) (global::System.Drawing.GraphicsUnit.Pixel) ));
			}
		}
Exemplo n.º 6
0
 public override void InternalSetFont(global::System.Drawing.Font value)
 {
     this.InternalGetTextField().style.font = this.Font.ToCssString();
 }