S
Stephen.Schoenberger
I am working with some images as byte[] arrays and am not sure nor can
I figure out if as I am reading the image and saving smaller sub-
images I am reading across and down the image or down and back up or
randomly? I need to know so in turn I can realize what the coordinates
are of the sub-images. Here is a snippet of the code that is
performing this task...
for (int a = 1; a < 4800; a++) //will create 4800 sub images if a
goes to numsubimages
{
Bitmap tempbitmap;
//this declares the size of tbyte to be 768 which is
the number of bytes needed for 16x16 sub image
byte[] tbyte = new byte[(stride * height) / ((height /
16) * (width / 16))];
byte[] holding2 = new byte[tbyte.Length];
for (int b = 1; b < tbyte.Length; b++)
{
tbyte.Initialize();
byte holding = (byte) bytebitmap.GetValue(b*a);
tbyte.SetValue(holding, b);
}
tempbitmap = BytesToBmp(tbyte, tempSize); //save the
output of the 16x16 sub image so results can be seen
}
BytesToBmp is simply a function that coverts a byte array into a
bitmap image.
Thanks!
I figure out if as I am reading the image and saving smaller sub-
images I am reading across and down the image or down and back up or
randomly? I need to know so in turn I can realize what the coordinates
are of the sub-images. Here is a snippet of the code that is
performing this task...
for (int a = 1; a < 4800; a++) //will create 4800 sub images if a
goes to numsubimages
{
Bitmap tempbitmap;
//this declares the size of tbyte to be 768 which is
the number of bytes needed for 16x16 sub image
byte[] tbyte = new byte[(stride * height) / ((height /
16) * (width / 16))];
byte[] holding2 = new byte[tbyte.Length];
for (int b = 1; b < tbyte.Length; b++)
{
tbyte.Initialize();
byte holding = (byte) bytebitmap.GetValue(b*a);
tbyte.SetValue(holding, b);
}
tempbitmap = BytesToBmp(tbyte, tempSize); //save the
output of the 16x16 sub image so results can be seen
}
BytesToBmp is simply a function that coverts a byte array into a
bitmap image.
Thanks!