/// <summary> /// Sets the clipping rectangle. /// </summary> /// <param name="x">X</param> /// <param name="y">Y</param> /// <param name="width">Width</param> /// <param name="height">Height</param> public void SetClippingRectangle(int x, int y, int width, int height) { //need implementation here TinyCLR2.Glide.BitmapHelper helper = new TinyCLR2.Glide.BitmapHelper(_bitmap); helper.SetClippingRectangle(x, y, width, height); //_bitmap.SetClippingRectangle(x, y, width, height); }
//public void SetPixel(int xPos, int yPos, Color color); /// <summary> /// Stretch an image. /// </summary> /// <param name="xDst">Destination X.</param> /// <param name="yDst">Destination Y.</param> /// <param name="bitmap">Bitmap</param> /// <param name="width">Width</param> /// <param name="height">Height</param> /// <param name="opacity">Opacity</param> public void StretchImage(int xDst, int yDst, Bitmap bitmap, int width, int height, ushort opacity) { TinyCLR2.Glide.BitmapHelper helper = new TinyCLR2.Glide.BitmapHelper(_bitmap); helper.StretchImage(xDst, yDst, bitmap, width, height, opacity); //_bitmap.DrawImage(bitmap, new System.Drawing.Rectangle(xDst, yDst, width, height), new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), GraphicsUnit.Pixel); //_bitmap.StretchImage(xDst, yDst, bitmap, width, height, opacity); }
/// <summary> /// Resizes images without distortion. /// </summary> /// <param name="xDst">Destination X.</param> /// <param name="yDst">Destination Y.</param> /// <param name="widthDst">Width</param> /// <param name="heightDst">Height</param> /// <param name="bitmap">Bitmap</param> /// <param name="border">Border</param> /// <param name="opacity">Opacity</param> public void Scale9Image(int xDst, int yDst, int widthDst, int heightDst, Bitmap bitmap, int border, ushort opacity) { //_bitmap.DrawImage(bitmap, new System.Drawing.Rectangle(xDst, yDst, widthDst, heightDst), new System.Drawing.Rectangle(border, border, bitmap.Width-border, bitmap.Height-border), GraphicsUnit.Pixel); TinyCLR2.Glide.BitmapHelper helper = new TinyCLR2.Glide.BitmapHelper(_bitmap); helper.Scale9Image(xDst, yDst, widthDst, heightDst, bitmap, border, border, border, border, opacity); //_bitmap.Scale9Image(xDst, yDst, widthDst, heightDst, bitmap, border, border, border, border, opacity); }