mirror of
https://github.com/kwsch/pkNX.git
synced 2026-08-22 02:14:32 -05:00
Add image scaling
This commit is contained in:
@@ -228,5 +228,16 @@ public static Color Blend(Color color, Color backColor, double amount)
|
||||
byte b = (byte)((color.B * amount) + (backColor.B * (1 - amount)));
|
||||
return Color.FromArgb(r, g, b);
|
||||
}
|
||||
|
||||
public static Bitmap ScaleImage(Bitmap rawImg, int s)
|
||||
{
|
||||
var bigImg = new Bitmap(rawImg.Width * s, rawImg.Height * s);
|
||||
for (int x = 0; x < bigImg.Width; x++)
|
||||
{
|
||||
for (int y = 0; y < bigImg.Height; y++)
|
||||
bigImg.SetPixel(x, y, rawImg.GetPixel(x / s, y / s));
|
||||
}
|
||||
return bigImg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4238
pkNX.Sprites/Properties/Resources.Designer.cs
generated
4238
pkNX.Sprites/Properties/Resources.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user