示例#1
0
 internal static global::System.Drawing.Bitmap Crop(global::System.Drawing.Bitmap image, global::System.Drawing.Rectangle srcRect)
 {
     object[] args = new object[] {
         image,
         srcRect};
     global::System.Drawing.Bitmap ret = ((global::System.Drawing.Bitmap)(m_privateType.InvokeStatic("Crop", new System.Type[] {
             typeof(global::System.Drawing.Bitmap),
             typeof(global::System.Drawing.Rectangle)}, args)));
     return ret;
 }
示例#2
0
 public void Dispose()
 {
     if (Bitmap != null)
     {
         Bitmap.Dispose();
         Bitmap = null;
     }
     Envelope         = null;
     SpatialReference = null;
 }
示例#3
0
 public virtual void recreateImage()
 {
     unchecked
     {
         global::System.Drawing.Bitmap   newImage    = new global::System.Drawing.Bitmap(((int)(this._width)), ((int)(this._height)), ((global::System.Drawing.Imaging.PixelFormat)(global::System.Drawing.Imaging.PixelFormat.Format32bppArgb)));
         global::System.Drawing.Graphics newGraphics = global::System.Drawing.Graphics.FromImage(newImage);
         newGraphics.SmoothingMode     = global::System.Drawing.Drawing2D.SmoothingMode.HighQuality;
         newGraphics.TextRenderingHint = global::System.Drawing.Text.TextRenderingHint.AntiAlias;
         newGraphics.Clear(global::System.Drawing.Color.Transparent);
         this._image.Dispose();
         this._graphics.Dispose();
         this._image    = newImage;
         this._graphics = newGraphics;
     }
 }
示例#4
0
        /// <summary>
        /// .NET FrameworkのBitmapをベースにTexture化する。
        /// </summary>
        /// <remarks>これがあれば、.NETのGraphics等で描画したものを
        /// テクスチャー化して描画できる。ただし、内部的には何度もメモリ
        /// コピーを行なう必要があるためあまり速くはない。なるべくなら動的には
        /// 行なわないほうが良い。</remarks>
        /// <code>
        ///		Bitmap bmp = new Bitmap(100, 100);
        ///		Graphics g = Graphics.FromImage(bmp);
        ///		g.DrawLine(new Pen(Color.Aqua, 10), 0, 0, 100, 100);
        ///		GlTexture txt = new GlTexture();
        ///		txt.SetBitmap(bmp);
        ///		g.Dispose();
        ///		scr.Blt(txt, 100, 100);
        ///		txt.Dispose();
        /// </code>
        /// <param name="bmp"></param>
        /// <returns></returns>
        public YanesdkResult SetBitmap(global::System.Drawing.Bitmap bmp)
        {
            //	転送元と転送先のサイズが同じで転送先がα付きのときは
            //	glTextureSubImageで転送したほうが良いのだが
            //	そんなに再々呼び出すことはないので、このままにしておこう…。

            Surface       surface;
            YanesdkResult result = BitmapHelper.BitmapToSurface(bmp, out surface);

            if (result != YanesdkResult.NoError)
            {
                return(result);
            }
            this.SetSurface(surface);
            surface.Dispose();

            return(YanesdkResult.NoError);
        }
示例#5
0
 public void MakeTransparent(Color transColor)
 {
     if (Bitmap == null)
     {
         return;
     }
     try
     {
         Bitmap b = new global::System.Drawing.Bitmap(Bitmap.Width, Bitmap.Height, global::System.Drawing.Imaging.PixelFormat.Format32bppArgb);
         using (global::System.Drawing.Graphics g = global::System.Drawing.Graphics.FromImage(b))
         {
             g.DrawImage(Bitmap, 0, 0);
         }
         b.MakeTransparent(transColor);
         Bitmap.Dispose();
         Bitmap = b;
     }
     catch { }
 }
示例#6
0
 public GeorefBitmap(global::System.Drawing.Bitmap bitmap)
 {
     Bitmap = bitmap;
 }
示例#7
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));
                }
                }
            }
        }
示例#8
0
 /// <summary>
 /// このメソッドはこのクラスではサポートされていない
 /// </summary>
 /// <param name="bmp"></param>
 /// <returns></returns>
 public YanesdkResult SetBitmap(global::System.Drawing.Bitmap bmp)
 {
     return(YanesdkResult.NotImplemented);
 }
示例#9
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);
					}
					
				}
				
			}
		}
示例#10
0
		public virtual   void recreateImage()
		{
			unchecked 
			{
				global::System.Drawing.Bitmap newImage = new global::System.Drawing.Bitmap(((int) (this._width) ), ((int) (this._height) ), ((global::System.Drawing.Imaging.PixelFormat) (global::System.Drawing.Imaging.PixelFormat.Format32bppArgb) ));
				global::System.Drawing.Graphics newGraphics = global::System.Drawing.Graphics.FromImage(newImage);
				newGraphics.SmoothingMode = global::System.Drawing.Drawing2D.SmoothingMode.HighQuality;
				newGraphics.TextRenderingHint = global::System.Drawing.Text.TextRenderingHint.AntiAlias;
				newGraphics.Clear(global::System.Drawing.Color.Transparent);
				this._image.Dispose();
				this._graphics.Dispose();
				this._image = newImage;
				this._graphics = newGraphics;
			}
		}