コード例 #1
0
ファイル: ContextBackendHandler.cs プロジェクト: Clancey/xwt
        public void DrawImage(object backend, object img, Rectangle srcRect, Rectangle destRect, double alpha)
        {
            var c = (DrawingContext)backend;

            Bitmap bmp = DataConverter.AsBitmap(img);

            DrawImageCore(c.Graphics, bmp, srcRect, destRect, (float)alpha);
        }
コード例 #2
0
ファイル: ContextBackendHandler.cs プロジェクト: Clancey/xwt
        public void DrawImage(object backend, object img, double x, double y, double width, double height, double alpha)
        {
            var c = (DrawingContext)backend;

            Bitmap bmp = DataConverter.AsBitmap(img);

            DrawImageCore(c.Graphics, bmp, (float)x, (float)y, (float)width, (float)height, (float)alpha);
        }
コード例 #3
0
ファイル: ImageHandler.cs プロジェクト: d5nguyenvan/xwt
		public override object ChangeOpacity (object backend, double opacity)
		{
			Bitmap bitmap = DataConverter.AsBitmap (backend);
			if (bitmap == null)
				throw new ArgumentException ();
			Bitmap result = new Bitmap (bitmap.Width, bitmap.Height, bitmap.PixelFormat);
			Graphics g = Graphics.FromImage (result);
			ContextBackendHandler.DrawImageCore (g, bitmap, 0, 0, bitmap.Width, bitmap.Height, (float)opacity);
			g.Dispose ();
			return result;
		}
コード例 #4
0
        public object Create(object img)
        {
            Bitmap bmp = DataConverter.AsBitmap(img);

            return(new TextureBrush(bmp, System.Drawing.Drawing2D.WrapMode.Tile));
        }