Reminisce
Active Member
I needed to use the "FILLIMAGEVIEW" and the Roundimage in my imagedownloader, so i used two different imagedownloader services instead, i dont want to use this technique is there a way i can incorporate the 2?
using
AND
Doesnt work, one works and the other doesnt, how do i use both?
DOE
using
FILLIMAGEVIEW:
Sub FillImageToView(bmp As B4XBitmap, ImageView As B4XView)
Dim bmpRatio As Float = bmp.Width / bmp.Height
Dim viewRatio As Float = ImageView.Width / ImageView.Height
If viewRatio > bmpRatio Then
Dim NewHeight As Int = bmp.Width / viewRatio
bmp = bmp.Crop(0, bmp.Height / 2 - NewHeight / 2, bmp.Width, NewHeight)
Else if viewRatio < bmpRatio Then
Dim NewWidth As Int = bmp.Height * viewRatio
bmp = bmp.Crop(bmp.Width / 2 - NewWidth / 2, 0, NewWidth, bmp.Height)
End If
ImageView.SetBitmap(bmp.Resize(ImageView.Width, ImageView.Height, True))
End Sub
AND
CODE TO SET ROUND BITMAP:
nativeme.InitializeContext
Dim bm As Bitmap
bm.Initialize3(bmp)
Dim bordercolor,borderwidth As Int
bordercolor = Starter.colourpurple
borderwidth = 0
Dim bm1 As Bitmap = nativeme.RunMethod("getRoundBitmap",Array(bm,bordercolor, borderwidth))
Doesnt work, one works and the other doesnt, how do i use both?
DOE