Front: Smobiler is a development platform that uses. NET language to develop apps in the VS environment, perhaps more convenient than Xamarin
Style one by one, target style
We want to achieve the effect in the following actions:
1. Drag a Resourceuploader control and a ImageButton control to the form interface from "Smobiler components" on the toolbar
The Click event for 2.ImageButton
VB: As ObjectEventArgs)End Sub
C #: imagebutton1_click (}
3. Modify the properties of the Resourceuploader control A.maxselectcount property
Set the maximum number of resources a single upload, the default setting is "9", upload up to 9 images at a time, 1;
B.qualitymode Property
Gets or sets the camera component upload quality mode, the default setting is "Custom", that is, the compression upload and the original upload are supported, 2;
If the property is set to "compressed", it means that the upload can only be compressed;
If the property is set to "Original", it means that only the original image is uploaded;
C.uploading Events
VB: dim imglist as list (of string< span class= "str" >) = new list (of String) private Sub resourceuploader1_uploading" (Sender as objectas barcodedata) handles resourceuploader1.uploading try If e.iserror = False then e.savefile () imglist. ADD (E.resourceid) getimg () End If Catch ex as exception MessageBox.Show (ex. Message) End Try end Sub
C #: list<stringlistresourceuploader1_uploading (catch (Exception ex) { MessageBox.Show (ex. Message); } }
Note: Call the Resourceuploader control to get the picture
D. Other code
Vb:Private SubResourceuploader1_imagecaptured (SenderAs ObjectEAsBarcodedata)HandlesResourceuploader1. ImagecapturedIf imglist. Count > 0 & imglist. Count <= 9Then fori = 0 to imglist. CountStep 1Select case ICase 1 IMG1. Visible =True BTNDELIMG1. Visible =True IMG1. ResourceID = Imglist (i-1) img1. Refresh ()Case 2 Img2. Visible =True Btndelimg2. Visible =True Img2. ResourceID = Imglist (i-1) img2. Refresh ()Case 3 IMG3. Visible =True BTNDELIMG3. Visible =True IMG3. ResourceID = Imglist (i-1) img3. Refresh ()Case 4 Img4. Visible =True Btndelimg4. Visible =True Img4. ResourceID = Imglist (i-1) img4. Refresh ()Case 5 img5. Visible = true btndelimg5. Visible = true img5. ResourceID = Imglist (i-1) img5. Refresh () Case 6 Img6. Visible = true Btndelimg6. Visible = true Img6. ResourceID = Imglist (i-1) img6. Refresh () Case 7 Img7. Visible = true Btndelimg7. Visible = true Img7. ResourceID = Imglist (i-1) Img7. Refresh () Case 8 Img8. Visible = true Btndelimg8. Visible = true Img8. ResourceID = Imglist (i-1) Img8. Refresh () Case 9 img9. Visible = true btndelimg9. Visible = true img9. ResourceID = Imglist (i-1) img9. Refresh () End Select Next end If End Sub
C#:private voidGetimg (){if (imglist. Count > 0 & imglist. Count <= 9) {For(int i = 1; I <= imglist. Count; i++) {switch (i) {Case 1:IMG1. Visible =True Btndelimg1. Visible =True Img1. ResourceID = Imglist[i-1]; Img1. Refresh ();BreakCase 2:img2. Visible =True Btndelimg2. Visible =True Img2. ResourceID = Imglist[i-1]; Img2. Refresh ();BreakCase 3:IMG3. Visible =True Btndelimg3. Visible =True Img3. ResourceID = Imglist[i-1]; Img3. Refresh ();BreakCase 4:img4. Visible =True Btndelimg4. Visible =True Img4. ResourceID = Imglist[i-1]; Img4. Refresh ();BreakCase 5:img5. Visible =True Btndelimg5. Visible =true; img5. ResourceID = Imglist[i-1]; Img5. Refresh (); Break ; Case 6:img6. Visible = true; btndelimg6. Visible = true; img6. ResourceID = Imglist[i-1]; Img6. Refresh (); Break ; Case 7:img7. Visible = true; Btndelimg7. Visible = true; Img7. ResourceID = Imglist[i-1]; Img7. Refresh (); Break ; Case 8:img8. Visible = true; Btndelimg8. Visible = true; Img8. ResourceID = Imglist[i-1]; Img8. Refresh (); Break ; Case 9:img9. Visible = true; btndelimg9. Visible = true; img9. ResourceID = Imglist[i-1]; Img9. Refresh (); Break ;} } } }
Second, the mobile phone effect display
. NET Language app development platform--smobiler Learning log: Fast implementation of the application of image, sound and other file upload function