appie21 Active Member Licensed User Longtime User Aug 27, 2015 #1 Hello I have made a photo viewer When a user click on a next button a new set of images will be loaded But some times the images are big and it take a moment to load how can i set a progressbar when the image is loaded, and disapear when the image is loaded succesfull? B4X: If Blznr = 0 Then ImgVBlad1.Bitmap = LoadBitmap(File.DirAssets, "1.png") ImgVBlad2.Bitmap = LoadBitmap(File.DirAssets, "2.png") BtnVorige.Visible = False Else if Blznr <= 1 Then BtnVorige.Visible = True ImgVBlad1.Bitmap = LoadBitmap(File.DirAssets, "3.png") ImgVBlad2.Bitmap = LoadBitmap(File.DirAssets, "4.png") End if
Hello I have made a photo viewer When a user click on a next button a new set of images will be loaded But some times the images are big and it take a moment to load how can i set a progressbar when the image is loaded, and disapear when the image is loaded succesfull? B4X: If Blznr = 0 Then ImgVBlad1.Bitmap = LoadBitmap(File.DirAssets, "1.png") ImgVBlad2.Bitmap = LoadBitmap(File.DirAssets, "2.png") BtnVorige.Visible = False Else if Blznr <= 1 Then BtnVorige.Visible = True ImgVBlad1.Bitmap = LoadBitmap(File.DirAssets, "3.png") ImgVBlad2.Bitmap = LoadBitmap(File.DirAssets, "4.png") End if
S sorex Expert Licensed User Longtime User Aug 27, 2015 #2 you can use the standard progress dialogue to indicate it's doing something B4X: ProgressDialogShow("Loading image...") If Blznr = 0 Then ImgVBlad1.Bitmap = LoadBitmap(File.DirAssets, "1.png") ImgVBlad2.Bitmap = LoadBitmap(File.DirAssets, "2.png") BtnVorige.Visible = False Else if Blznr <= 1 Then BtnVorige.Visible = True ImgVBlad1.Bitmap = LoadBitmap(File.DirAssets, "3.png") ImgVBlad2.Bitmap = LoadBitmap(File.DirAssets, "4.png") End if ProgressDialogHide Upvote 0
you can use the standard progress dialogue to indicate it's doing something B4X: ProgressDialogShow("Loading image...") If Blznr = 0 Then ImgVBlad1.Bitmap = LoadBitmap(File.DirAssets, "1.png") ImgVBlad2.Bitmap = LoadBitmap(File.DirAssets, "2.png") BtnVorige.Visible = False Else if Blznr <= 1 Then BtnVorige.Visible = True ImgVBlad1.Bitmap = LoadBitmap(File.DirAssets, "3.png") ImgVBlad2.Bitmap = LoadBitmap(File.DirAssets, "4.png") End if ProgressDialogHide
appie21 Active Member Licensed User Longtime User Aug 27, 2015 #3 Hi I have do that but without resuilt ( i did not see the progressbar) Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 27, 2015 #4 Use LoadBitmapSample and it will load the image quickly (on a real device). Upvote 0
J JohnK Active Member Licensed User Longtime User Aug 28, 2015 #5 appie21 said: Hi I have do that but without resuilt ( i did not see the progressbar) Click to expand... The progress dialogue needs "DoEvents" between the show and hide. "The more the merrier", but it slows down the actual app. Last edited: Aug 29, 2015 Upvote 0
appie21 said: Hi I have do that but without resuilt ( i did not see the progressbar) Click to expand... The progress dialogue needs "DoEvents" between the show and hide. "The more the merrier", but it slows down the actual app.