bitmap sample

derez

Expert
Licensed User
Longtime User
The method initializesample defines the file, the maxwidth and maxheight of the sample.
It does not define where the startpoint of the sample on the bitmap is.
Is it defined by a source rectangle ?

I'd appreciate some elaboration.
 

derez

Expert
Licensed User
Longtime User
Ok I got it.
The source rectangle does not need to change - it defines the partial rectangle of the image.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Bitmap.InitializeSample (which is similar to LoadBitmapSample keyword) loads the whole image. It down samples the image if it is larger than the specified dimensions.

For example, cameras usually produce huge images. In almost all cases there is no reason to load the whole image (which is much larger than the screen anyway). So when you use these methods the whole image is loaded by its resolution will be something like 200 x 200 instead of 4000 x 4000.
 
Upvote 0

derez

Expert
Licensed User
Longtime User
Then it would be beneficial to have a method that loads only partial rectangle from a picture (like jpeg library can do).
 
Upvote 0
Top