DaftHacker
Jet fuel can't melt steel beams
Ok so what im trying to do is read an images length and then from the image length read the image and i have to use an int which is shorter than the byte or whatever length im suppose to read.
For example here is my code
So what i need is FirstBitmapImage.StreamSource = new MemoryStream(br.ReadBytes(0x2137));
but br.ReadBytes() will only allow either an int or 0x2137 in plain.
When i try to read the file using the int length the picture will only load a little.
Here is a picture of the file in hxd:
For example here is my code
Code:
//IMAGE SIZE
br.BaseStream.Position = 0x1712;
int FirstImageSize = Convert.ToInt32(BitConverter.ToString(br.ReadBytes(4)).Replace("-", ""));
//WHAT I READ LOOKS LIKE: 00 00 21 37 or 00 00 0C 0F
//PICTURE
br.BaseStream.Position = 0x171A;
BitmapImage FirstBitmapImage = new BitmapImage();
FirstBitmapImage.BeginInit();
FirstBitmapImage.StreamSource = new MemoryStream(br.ReadBytes(FirstImageSize));
FirstBitmapImage.EndInit();
picture.Source = FirstBitmapImage;
So what i need is FirstBitmapImage.StreamSource = new MemoryStream(br.ReadBytes(0x2137));
but br.ReadBytes() will only allow either an int or 0x2137 in plain.
When i try to read the file using the int length the picture will only load a little.
Here is a picture of the file in hxd: