static RectangleF GetOverlayRectF(Origin.Grade iGrade) { Rectangle overlayRect = I9Gfx.GetOverlayRect(iGrade); return(new RectangleF((float)overlayRect.X, (float)overlayRect.Y, (float)overlayRect.Width, (float)overlayRect.Height)); }
public static void DrawEnhancementAt( ref Graphics iTarget, Rectangle iDest, int iImageIndex, Origin.Grade iGrade, ImageAttributes imageAttributes) { if (iDest.Width > 30) { iDest.Width = 30; } if (iDest.Height > 30) { iDest.Height = 30; } if (iImageIndex < 0 | iImageIndex >= I9Gfx.Enhancements.Length) { return; } Graphics graphics = iTarget; Bitmap bitmap = I9Gfx.Borders.Bitmap; Rectangle destRect = iDest; Rectangle overlayRect = I9Gfx.GetOverlayRect(iGrade); int x = overlayRect.X; overlayRect = I9Gfx.GetOverlayRect(iGrade); int y = overlayRect.Y; ImageAttributes imageAttr = imageAttributes; graphics.DrawImage((Image)bitmap, destRect, x, y, 30, 30, GraphicsUnit.Pixel, imageAttr); iTarget.DrawImage((Image)I9Gfx.Enhancements[iImageIndex], iDest, 0, 0, 30, 30, GraphicsUnit.Pixel, imageAttributes); }
public static void DrawEnhancementAt(ref Graphics iTarget, Rectangle iDest, int iImageIndex, Origin.Grade iGrade) { if (iDest.Width > 30) { iDest.Width = 30; } if (iDest.Height > 30) { iDest.Height = 30; } if (!(iImageIndex < 0 | iImageIndex >= I9Gfx.Enhancements.Length)) { iTarget.DrawImage(I9Gfx.Borders.Bitmap, iDest, I9Gfx.GetOverlayRect(iGrade), GraphicsUnit.Pixel); iTarget.DrawImage(I9Gfx.Enhancements[iImageIndex], iDest, new Rectangle(0, 0, 30, 30), GraphicsUnit.Pixel); } }
private void DisplayIcon() { if (!string.IsNullOrWhiteSpace(mySet.Image)) { using var extendedBitmap1 = new ExtendedBitmap($"{I9Gfx.GetEnhancementsPath()}{mySet.Image}"); using var extendedBitmap2 = new ExtendedBitmap(30, 30); extendedBitmap2.Graphics.DrawImage(I9Gfx.Borders.Bitmap, extendedBitmap2.ClipRect, I9Gfx.GetOverlayRect(Origin.Grade.SetO), GraphicsUnit.Pixel); extendedBitmap2.Graphics.DrawImage(extendedBitmap1.Bitmap, extendedBitmap2.ClipRect, extendedBitmap2.ClipRect, GraphicsUnit.Pixel); btnImage.Image = new Bitmap(extendedBitmap2.Bitmap); btnImage.Text = mySet.Image; } else { using var extendedBitmap = new ExtendedBitmap(30, 30); extendedBitmap.Graphics.DrawImage(I9Gfx.Borders.Bitmap, extendedBitmap.ClipRect, I9Gfx.GetOverlayRect(Origin.Grade.SetO), GraphicsUnit.Pixel); btnImage.Image = new Bitmap(extendedBitmap.Bitmap); btnImage.Text = @"Select Image"; } }
void DisplayIcon() { if (mySet.Image != "") { ExtendedBitmap extendedBitmap1 = new ExtendedBitmap(I9Gfx.GetEnhancementsPath() + mySet.Image); ExtendedBitmap extendedBitmap2 = new ExtendedBitmap(30, 30); extendedBitmap2.Graphics.DrawImage((Image)I9Gfx.Borders.Bitmap, extendedBitmap2.ClipRect, I9Gfx.GetOverlayRect(Origin.Grade.SetO), System.Drawing.GraphicsUnit.Pixel); extendedBitmap2.Graphics.DrawImage((Image)extendedBitmap1.Bitmap, extendedBitmap2.ClipRect, extendedBitmap2.ClipRect, System.Drawing.GraphicsUnit.Pixel); btnImage.Image = (Image) new Bitmap((Image)extendedBitmap2.Bitmap); btnImage.Text = mySet.Image; } else { ExtendedBitmap extendedBitmap = new ExtendedBitmap(30, 30); extendedBitmap.Graphics.DrawImage((Image)I9Gfx.Borders.Bitmap, extendedBitmap.ClipRect, I9Gfx.GetOverlayRect(Origin.Grade.SetO), System.Drawing.GraphicsUnit.Pixel); btnImage.Image = (Image) new Bitmap((Image)extendedBitmap.Bitmap); btnImage.Text = "Select Image"; } }
void DisplayIcon() { if (this.mySet.Image != "") { ExtendedBitmap extendedBitmap = new ExtendedBitmap(I9Gfx.GetEnhancementsPath() + this.mySet.Image); ExtendedBitmap extendedBitmap2 = new ExtendedBitmap(30, 30); extendedBitmap2.Graphics.DrawImage(I9Gfx.Borders.Bitmap, extendedBitmap2.ClipRect, I9Gfx.GetOverlayRect(Origin.Grade.SetO), GraphicsUnit.Pixel); extendedBitmap2.Graphics.DrawImage(extendedBitmap.Bitmap, extendedBitmap2.ClipRect, extendedBitmap2.ClipRect, GraphicsUnit.Pixel); this.btnImage.Image = new Bitmap(extendedBitmap2.Bitmap); this.btnImage.Text = this.mySet.Image; } else { ExtendedBitmap extendedBitmap3 = new ExtendedBitmap(30, 30); extendedBitmap3.Graphics.DrawImage(I9Gfx.Borders.Bitmap, extendedBitmap3.ClipRect, I9Gfx.GetOverlayRect(Origin.Grade.SetO), GraphicsUnit.Pixel); this.btnImage.Image = new Bitmap(extendedBitmap3.Bitmap); this.btnImage.Text = "Select Image"; } }