Android Question Resize bitmap : problem of (scale) width and height

Khalid.

Member
[CODE lang="b4x" title="bmpRose = xui.LoadBitmapResize ( File.DirAssets , " Untikktled.jpg " , 40,56 , True )"][/CODE]

How can I change the image size (pixels) width 40 columns, height 56 rows ...

The problem:
when executed it becomes 40 * 40
 
Solution
B4X:
bmpRose = xui.LoadBitmapResize ( File.DirAssets , " Untikktled.jpg " , 40,56 , True )"
How can I change the image size (pixels) width 40 columns, height 56 rows ...
The problem: when executed it becomes 40 * 40

According to Android Tutorial LoadBitmap / LoadBitmapResize / LoadBitmapSample :

LoadBitmapResize - Returns a bitmap that its size equals to the passed width and height values. If the KeepAspectRatio parameter is set to True (in most cases it should be) then the aspect ratio will be kept. In that case the width or height (not both) might be smaller than the passed values.

emexes

Expert
Licensed User
B4X:
bmpRose = xui.LoadBitmapResize ( File.DirAssets , " Untikktled.jpg " , 40,56 , True )"
How can I change the image size (pixels) width 40 columns, height 56 rows ...
The problem: when executed it becomes 40 * 40

According to Android Tutorial LoadBitmap / LoadBitmapResize / LoadBitmapSample :

LoadBitmapResize - Returns a bitmap that its size equals to the passed width and height values. If the KeepAspectRatio parameter is set to True (in most cases it should be) then the aspect ratio will be kept. In that case the width or height (not both) might be smaller than the passed values.
 
Upvote 1
Solution

Khalid.

Member
passed values
And how to give a value from the ((spinner)), substitute for the values 40,56

>>>It's error when adding <<<

[CODE lang="b4x" title="
For i = 8 To 100 Step 8
Spinnerwidth.Add(i)
Spinnerheight .Add(i)
Next


bmpRose = xui.LoadBitmapResize ( File.DirAssets , " Untikktled.jpg " , Spinnerwidth,Spinnerheight , True )"][/CODE]
 
Upvote 0
Top