public void Draw(STR_Bitmap <T> strbmBitmap, int iXOffset, int iYOffset, int iXo, int iYo, int iW, int iH, T gen_Color) { for (int y = 0; y < strbmBitmap.miHeightPx; y++) { int iYPixelCoord = y + iYOffset; if (iYPixelCoord < 0 || iYPixelCoord > miHeightPx) { continue; } for (int x = 0; x < strbmBitmap.miWidthPx; x++) { int iXPixelCoord = x + iXOffset; if (iXPixelCoord < 0 || iXPixelCoord > miWidthPx) { continue; } T gen_SourceColor = strbmBitmap.GetPixelAtCoord(x, y); int iColor = (STR_Utilities.GenericCast <T, int> .Do(gen_SourceColor)) * (STR_Utilities.GenericCast <T, int> .Do(gen_Color)); this.SetPixelAtCoord(x, y, STR_Utilities.GenericCast <int, T> .Do(iColor)); } } }
public void Blit(STR_Bitmap <T> strbmBitmap, int iXOffset, int iYOffset) { for (int y = 0; y < strbmBitmap.miHeightPx; y++) { int iYPixelCoord = y + iYOffset; if (iYPixelCoord < 0 || iYPixelCoord > miHeightPx) { continue; } for (int x = 0; x < strbmBitmap.miWidthPx; x++) { int iXPixelCoord = x + iXOffset; if (iXPixelCoord < 0 || iXPixelCoord > miWidthPx) { continue; } T gen_SourceColor = strbmBitmap.GetPixelAtCoord(x, y); this.SetPixelAtCoord(x, y, gen_SourceColor); } } }