Waldemar Lima Well-Known Member Licensed User Longtime User May 12, 2020 #1 i am trying this code > B4X: MainForm = Form1 MainForm.RootPane.LoadLayout("main") 'Load the layout file. MainForm.Show cv.Initialize("cv") Dim bc As BitmapCreator bc.Initialize(MainForm.WindowWidth, MainForm.WindowHeight) Dim bmp As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "img.jpg", 600, 800, True) 'cv.DrawImage(bc.Bitmap, bc.Bitmap.Width, bc.Bitmap.Width, bc.Bitmap.Width, bc.Bitmap.Height) cv.DrawCircle(50, 50, 20, fx.Colors.Red, True, 0) ImageView_Bmp.SetImage(cv.Snapshot) but dont show nothing on imageview
i am trying this code > B4X: MainForm = Form1 MainForm.RootPane.LoadLayout("main") 'Load the layout file. MainForm.Show cv.Initialize("cv") Dim bc As BitmapCreator bc.Initialize(MainForm.WindowWidth, MainForm.WindowHeight) Dim bmp As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "img.jpg", 600, 800, True) 'cv.DrawImage(bc.Bitmap, bc.Bitmap.Width, bc.Bitmap.Width, bc.Bitmap.Width, bc.Bitmap.Height) cv.DrawCircle(50, 50, 20, fx.Colors.Red, True, 0) ImageView_Bmp.SetImage(cv.Snapshot) but dont show nothing on imageview
TILogistic Expert Licensed User Longtime User May 12, 2020 #2 tips: Dim b As B4XBitmap = cvs.CreateBitmap ImageView_Bmp.SetImage(b) ImageView_Bmp.SetImage(b.Crop(0, 0, cvs.TargetRect.Width, cvs.TargetRect.Height)) but dont show nothing on imageview Gravity = FILL or CENTER Last edited: May 12, 2020 Upvote 0
tips: Dim b As B4XBitmap = cvs.CreateBitmap ImageView_Bmp.SetImage(b) ImageView_Bmp.SetImage(b.Crop(0, 0, cvs.TargetRect.Width, cvs.TargetRect.Height)) but dont show nothing on imageview Gravity = FILL or CENTER
Waldemar Lima Well-Known Member Licensed User Longtime User May 12, 2020 #3 I need ser imageview gravity - Fill ir center ? Upvote 0
TILogistic Expert Licensed User Longtime User May 12, 2020 #4 you need to export to PNG, JPG or BASE64? Upvote 0
Waldemar Lima Well-Known Member Licensed User Longtime User May 12, 2020 #6 oparra said: you need to export to PNG, JPG or BASE64? Click to expand... Any image format ( png , bitmap , jpg , othr ) Upvote 0
oparra said: you need to export to PNG, JPG or BASE64? Click to expand... Any image format ( png , bitmap , jpg , othr )
TILogistic Expert Licensed User Longtime User May 12, 2020 #7 see: cv.DrawCircle(50, 50, 20, fx.Colors.Red, True, 0) cv.Invalidate Dim b As B4XBitmap = cv.CreateBitmap or Dim b As B4XBitmap = cv.CreateBitmap.Crop(0, 0, cv.TargetRect.Width, cv.TargetRect.Height) ImageView_Bmp.SetImage(b.Resize(350, 350, True)) Upvote 0
see: cv.DrawCircle(50, 50, 20, fx.Colors.Red, True, 0) cv.Invalidate Dim b As B4XBitmap = cv.CreateBitmap or Dim b As B4XBitmap = cv.CreateBitmap.Crop(0, 0, cv.TargetRect.Width, cv.TargetRect.Height) ImageView_Bmp.SetImage(b.Resize(350, 350, True))
Waldemar Lima Well-Known Member Licensed User Longtime User May 12, 2020 #8 I Just dont understand how can i show image on imageview Upvote 0
Waldemar Lima Well-Known Member Licensed User Longtime User May 12, 2020 #9 I need call " cv.createbitmap " to show ? Upvote 0
TILogistic Expert Licensed User Longtime User May 12, 2020 #10 B4X: MainForm = Form1 MainForm.RootPane.LoadLayout("main") 'Load the layout file. MainForm.Show cv.Initialize("cv") Dim bc As BitmapCreator bc.Initialize(MainForm.WindowWidth, MainForm.WindowHeight) Dim bmp As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "img.jpg", 600, 800, True) 'cv.DrawImage(bc.Bitmap, bc.Bitmap.Width, bc.Bitmap.Width, bc.Bitmap.Width, bc.Bitmap.Height) cv.DrawCircle(50, 50, 20, fx.Colors.Red, True, 0) ImageView_Bmp.SetImage(cv.Snapshot) Do you need to add a circle to the image? is what I see ... do you want that? Upvote 0
B4X: MainForm = Form1 MainForm.RootPane.LoadLayout("main") 'Load the layout file. MainForm.Show cv.Initialize("cv") Dim bc As BitmapCreator bc.Initialize(MainForm.WindowWidth, MainForm.WindowHeight) Dim bmp As B4XBitmap = xui.LoadBitmapResize(File.DirAssets, "img.jpg", 600, 800, True) 'cv.DrawImage(bc.Bitmap, bc.Bitmap.Width, bc.Bitmap.Width, bc.Bitmap.Width, bc.Bitmap.Height) cv.DrawCircle(50, 50, 20, fx.Colors.Red, True, 0) ImageView_Bmp.SetImage(cv.Snapshot) Do you need to add a circle to the image? is what I see ... do you want that?
TILogistic Expert Licensed User Longtime User May 12, 2020 #11 I need call " cv.createbitmap " to show ? Yes Upvote 0
TILogistic Expert Licensed User Longtime User May 12, 2020 #14 you add: cv.Invalidate after creating the canvas Upvote 0
TILogistic Expert Licensed User Longtime User May 13, 2020 #16 ImageView_Bmp.SetImage(cv.Snapshot) ??? Not ImageView_Bmp.SetImage(cv.createbitmap ) YES Upvote 0