I am trying to create a very basic sprite image.
First off i have an existing image (Width=100px, Height=100px).
I will be looping through this image betwee
Let me try with some pseudocode:
Bitmap originalImage; // that is your image of 100x100 pixels
Bitmap bigImage; // this is your 3000x3000 canvas
int xPut = 0;
int yPut = 0;
int maxHeight = 0;
while (someExitCondition)
{
Bitmap imagePiece = GetImagePieceAccordingToSomeParameters(originalImage);
if (xPut + imagePiece.Width > 3000)
{
xPut = 0;
yPut += maxHeight;
maxHeight = 0;
}
DrawPieceToCanvas(bigImage, xPut, yPut, imagePiece);
xPut += imagePiece.Width;
if (imagePiece.Height > maxHeight) maxHeight = imagePiece.Height;
// iterate until done
}