Read a Bitmap subsection from disk in C #

I am writing some kind of card software for my smartphone and have encountered a problem because of which I do not want to load all the (large) image files into memory when only a part is displayed.

Is there a way to read only the subsection (visible part) of a large image, given that you know the offsets and widths of x and y? I know that perhaps this is possible by reading the file byte at a time, but I'm not sure how to do this.

Thanks Nico

+3
source share
5 answers

, , , . , , - , JPEG PNG, .

+2

, -, . - , BMP, .

+1

?

256x256 , . - Google .

+1

BMP, .

, 44 , .

, , , . , , , . , , .

FileStream , ; a Read Seek .

+1

, ...

public BitmapCropBitmap(BitMap fullBitmap, Rectangle rectangle)
{
  return proBitmap.clone(fullBitmap, rectangle, fullBitmap.PixelFormat);
}
0

Source: https://habr.com/ru/post/1712710/


All Articles