derez Expert Licensed User Longtime User Nov 15, 2010 #1 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.
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 Nov 15, 2010 #2 Ok I got it. The source rectangle does not need to change - it defines the partial rectangle of the image. Upvote 0
Ok I got it. The source rectangle does not need to change - it defines the partial rectangle of the image.
Erel B4X founder Staff member Licensed User Longtime User Nov 15, 2010 #3 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
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.
derez Expert Licensed User Longtime User Nov 20, 2010 #4 Then it would be beneficial to have a method that loads only partial rectangle from a picture (like jpeg library can do). Upvote 0
Then it would be beneficial to have a method that loads only partial rectangle from a picture (like jpeg library can do).