Dim bc As BitmapCreator
Dim bmp As B4XBitmap= xui.LoadBitmap(File.DirAssets, "test.jpg")
bc.Initialize(bmp.Width, bmp.Height)
bc.CopyPixelsFromBitmap(bmp)
ImageView1.SetBitmap(bc.Bitmap) 'looks good here
BasePanel=xui.CreatePanel("")
BasePanel.SetLayoutAnimated(0,0,0,bmp.Width,bmp.Height)
Dim cnv As B4XCanvas
cnv.Initialize(BasePanel)
'**** add the following line *****
GetNativeCanvas(cnv).As(JavaObject).RunMethodjo("getGraphicsContext2D",Null).RunMethod("setImageSmoothing",Array(False))
cnv.DrawBitmap(bc.Bitmap, cnv.TargetRect)
ImageView1.SetBitmap(cnv.CreateBitmap) 'looks good here as well!!!
Sub GetNativeCanvas (b4x As B4XCanvas) As Canvas
Dim jo As JavaObject = b4x
jo = jo.GetFieldJO("cvs")
If xui.IsB4J Then Return jo.RunMethod("getObject", Null)
Return jo
End Sub