I have this error Type does not match (B4IPanelView), I use this:
This is my code:
Logs error
[B4X] BitmapsAsync
Don't use this. Better implementation in SimpleMediaManager: https://www.b4x.com/android/forum/threads/b4x-simplemediamanager-smm-framework-for-images-videos-and-more.134716/#content A cross platform library that allows loading images using background threads. It can be useful with keeping the...
www.b4x.com
This is my code:
B4X:
Wait For (ImageLoader.LoadFromFile(Directorio, FileName, DimensionMax, DimensionMax)) Complete (bmp As B4XBitmap)
If bmp.IsInitialized And img.Parent.IsInitialized Then
ResizeImageViewBasedOnBitmapRatio(img, bmp)
End If
B4X:
Private Sub ResizeImageViewBasedOnBitmapRatio(iv As B4XView, bmp As B4XBitmap)
Dim bmpRatio As Float = bmp.Width / bmp.Height
Dim viewRatio As Float = iv.Parent.Width / iv.Parent.Height
Dim Height, Width As Int
If viewRatio > bmpRatio Then
Height = iv.Parent.Height
Width = iv.Parent.Height * bmpRatio
Else
Width = iv.Parent.Width
Height = iv.Parent.Width / bmpRatio
End If
iv.SetLayoutAnimated(0, iv.Parent.Width / 2 - Width / 2, iv.Parent.Height / 2 - Height / 2, Width, Height)
iv.SetBitmap(bmp) ' <<ERROR in this line, Type does not match (B4IPanelView)
#if B4A
Dim iiv As ImageView = iv
iiv.Gravity = Gravity.FILL
#End If
End Sub
Logs error
B4X:
Error occurred on line: 402 (a02)
Type does not match (B4IPanelView)
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
NameApp -[B4XViewWrapper throwTypeDoesNotMatch] + 96
NameApp -[B4XViewWrapper SetBitmap:] + 212
NameApp -[b4i_a02_simbolos _resizeimageviewbasedonbitmapratio:::] + 1960
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 292
NameApp +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
NameApp -[B4IShell runMethod:] + 448
NameApp -[B4IShell raiseEventImpl:method:args::] + 1648
NameApp -[B4IShellBI raiseEvent:event:params:] + 1580
NameApp -[B4IDebugResumableSub resume::] + 356
NameApp -[B4I checkAndRunWaitForEvent:event:params:] + 516
NameApp -[B4IShellBI raiseEvent:event:params:] + 1436
NameApp __37-[B4ICommon ReturnFromResumableSub::]_block_invoke + 368
libdispatch.dylib <redacted> + 24
libdispatch.dylib <redacted> + 16
libdispatch.dylib <redacted> + 1068
CoreFoundation <redacted> + 12
CoreFoundation <redacted> + 1924
CoreFoundation CFRunLoopRunSpecific + 436
GraphicsServices GSEventRunModal + 104
UIKitCore UIApplicationMain + 212
NameApp main + 124
libdyld.dylib <redacted> + 4
)