I have an ImageView 100dip x 100dip. To set its bitmap I use this simple code:
The first line is in a sub routine, to which I pass the size of the ImageView, then SampleWidth and SampleHeight will be 100dip.
Well, some images (jpg) larger than 100x100 are displayed completely (resized), other images appear the central part only.
(if I set gravity to FILL, the smaller image (256 x 256) appears fine, the largest is distorted, as it is rectangular, 3543 x 2215).
[Another strange thing is that Windows shows a preview of some pictures but not of others, although they are all jpg - pictures of the device connected to my PC]
The question is... guess... why?
P.S. Perhaps the question is badly expressed; in summary:
ImageView 100dip x 100dip - Gravity: Center
Picture1 3543 x 2215 - OK (small, resized but ok)
Picture2 256 x 256 - only the central part is displayed.
B4X:
bmp = LoadBitmapSample(Dir, FileName, SampleWidth, SampleHeight)
ImageView1.Gravity = Gravity.CENTER
ImageView1.Bitmap = bmp
Well, some images (jpg) larger than 100x100 are displayed completely (resized), other images appear the central part only.
(if I set gravity to FILL, the smaller image (256 x 256) appears fine, the largest is distorted, as it is rectangular, 3543 x 2215).
[Another strange thing is that Windows shows a preview of some pictures but not of others, although they are all jpg - pictures of the device connected to my PC]
The question is... guess... why?
P.S. Perhaps the question is badly expressed; in summary:
ImageView 100dip x 100dip - Gravity: Center
Picture1 3543 x 2215 - OK (small, resized but ok)
Picture2 256 x 256 - only the central part is displayed.
Last edited: