public static ConvToRect ( PixelFarm r ) : |
||
r | PixelFarm | |
Résultat |
public override void DrawImages(Image image, RectangleF[] destAndSrcPairs) { int j = destAndSrcPairs.Length; if (j > 1) { if ((j % 2) != 0) { //make it even number j -= 1; } //loop draw SKBitmap inner = ResolveInnerBmp(image); for (int i = 0; i < j;) { //gx.DrawImage(inner, // destAndSrcPairs[i], // destAndSrcPairs[i + 1]); skCanvas.DrawBitmap( inner, Conv1.ConvToRect(destAndSrcPairs[i]), Conv1.ConvToRect(destAndSrcPairs[i + 1])); i += 2; } } }
/// <summary> /// Draws the specified portion of the specified <see cref="T:System.Drawing.Image"/> at the specified location and with the specified size. /// </summary> /// <param name="image"><see cref="T:System.Drawing.Image"/> to draw. </param> /// <param name="destRect"><see cref="T:System.Drawing.RectangleF"/> structure that specifies the location and size of the drawn image. The image is scaled to fit the rectangle. </param> /// <param name="srcRect"><see cref="T:System.Drawing.RectangleF"/> structure that specifies the portion of the <paramref name="image"/> object to draw. </param> /// <exception cref="T:System.ArgumentNullException"><paramref name="image"/> is null.</exception> public override void DrawImage(Image image, RectangleF destRect, RectangleF srcRect) { var bmp = Image.GetCacheInnerImage(image) as SkiaSharp.SKBitmap; if (bmp != null) { skCanvas.DrawBitmap( bmp, Conv1.ConvToRect(srcRect), Conv1.ConvToRect(destRect)); } }