Exemplo n.º 1
0
        public void addbutton(List <byte[]> Imagedata, List <string> strimg)
        {
            for (int icount = 0; icount < Imagedata.Count; icount++)
            {
                iEbutton button = new iEbutton();
                // button.creation(icount, Imagedata[icount]);
                button.getText(strimg[icount]);

                button.click += Button_click;

                UIbutton.Add(button);
            }
        }
Exemplo n.º 2
0
        private void Button_click(int number, string text, iEbutton iebutton)
        {
            if (img.imG.isSelect() == false)
            {
                try
                {
                    if ((iebutton._isvideor()))
                    {
                        UIStoryboard storyboard = UIStoryboard.FromName("boardimg", null);

                        var view = storyboard.InstantiateViewController("idVid") as AMvideo;


                        //   view.creat(iebutton.retbyet());
                        //  var but = (UIButton)sender;
                        //  int info = Convert.ToUInt16(but.TitleLabel.Text );

                        view.file(iebutton.setText(), iebutton.retbyet());
                        img.imG.NavigationController.PushViewController(view, true);
                        // view.getimge(iebutton.image(), iebutton.setText(), iebutton.buttonnumber());
                    }
                    else
                    {
                        UIStoryboard storyboard = UIStoryboard.FromName("boardimg", null);

                        var view = storyboard.InstantiateViewController("imageview") as ViewWer;



                        //  var but = (UIButton)sender;
                        //  int info = Convert.ToUInt16(but.TitleLabel.Text );

                        img.imG.NavigationController.PushViewController(view, true);
                        view.getimge(iebutton.image(), iebutton.setText(), iebutton.buttonnumber(), iebutton.retbyet());
                    }
                }
                catch { }
            }
            else
            {
                sourcecollection._collectionViewCell[number].BorderColor();

                iebutton.booldelert();
            }
        }
Exemplo n.º 3
0
        private void setbutton()
        {
            for (int icount = 0; icount <= DataSql.databyet.Count; icount++)
            {
                iEbutton button = new iEbutton();
                button.ext(extfile[icount]);
                button.whate_is_byte(listByete[icount], icount);
                //    button.creation(icount, DataSql.databyet[icount]);
                button.getText(nameimage[icount]);

                button.click += Button_click;

                if (button._isvideor())
                {//change
                 //string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                 //string localFilename = nameimage[icount] + ".mov"; //same if I save the file as .mp4
                 //string localPath = Path.Combine(documentsPath, localFilename);

                    //File.WriteAllBytes(localPath, DataSql.databyet[icount].ToArray());

                    //var avasset = AVAsset.FromUrl(NSUrl.FromFilename(localPath));
                    //var avplayerItem = new AVPlayerItem(avasset);
                    //var avplayer = new AVPlayer(avplayerItem);
                    //var avplayerLayer = AVPlayerLayer.FromPlayer(avplayer);
                    //button.localstring(localPath);
                    //File.Delete(localPath);


                    button.creatFilemov(tumbmaillist[icount]);

                    // var capture = UIScreen.MainScreen.Capture();
                }

                else
                {
                    button.creationimge();
                }


                UIbutton.Add(button);
                //  Thread.Sleep(1000);
            }
        }
Exemplo n.º 4
0
      //puls button;
      private void Picker_FinishedPickingAssets(object sender, MultiAssetEventArgs args)
      {
          UrlVideoString.Clear();
          Imagedata.Clear();
          // Imagedata = null;
          bool    isvideo = false;
          int     i       = buttonnumber;
          PHAsset pHAsset = args.Assets[0];

          // imgView.Image= pHAsset.Location

          //    uIImage. = pHAsset.Location();
          //   List<  UIImage> uIImage = new List<UIImage> ();
          PHImageManager imageManager = new PHImageManager();

          foreach (var asset in args.Assets)
          {  //
              string      date   = string.Empty;
              UIImageView imag   = new UIImageView();
              iEbutton    button = new iEbutton();
              string      endex  = string.Empty;


              UIImage  image1   = new UIImage();
              AVPlayer avplayer = new AVPlayer();
              if (asset.MediaType == PHAssetMediaType.Video)
              {
                  isvideo = true;
                  // NSUrl videoUrl = null;

                  imageManager.RequestAvAsset(asset, null, (avsset, avaudio, NsD) =>
                    {
                        //   string UrlConvertString = null;

                        var videoUrl            = ((AVFoundation.AVUrlAsset)avsset).Url;
                        string UrlConvertString = (videoUrl.AbsoluteString);

                        UrlVideoString.Add(UrlConvertString);
                    });
              }

              imageManager.RequestImageForAsset(asset,
                                                new CGSize(asset.PixelWidth, asset.PixelHeight),
                                                PHImageContentMode.Default,
                                                null,
                                                (image, info) =>
                {
                    //  endex = image.AccessibilityPath.ToString();

                    //  endex = "jpg";

                    //

                    if (isvideo == false)
                    {
                        image1 = image;

                        imag.Image = image;
                        Imagedata.Add(image1);
                        // button.creation(i, image);
                    }

                    //  date = DateTime.Now.ToString("MMddHHmmss");

                    Thread.Sleep(1000);
                });

              //button.getText(date);
              //button.click += Button_TouchUpInside; ;
              isvideo = false;

              //UIbutton.Add(button);
              //  lab.Text = ImageView.Count.ToString();

              // Imagedata.Add(image1);
          }  //end foreach

          // finshpluse = 1;

          //  imgView.Image = uIImage[uIImage.Count-1];



          //  scoll = new UIScrollView();
          //if (scoll.Frame.Height > scoll.Frame.Width )
          //{

          //    scoll.ContentSize = new CGSize(uiv.Frame.Width -70, ImageView.Count * 15);
          //    putimage(50,70,14);

          //}

          //else { scoll.ContentSize = new CGSize(ImageView.Count+20, ImageView.Count * 15);


          //    putimage(80, 90, 40);



          //}
          finshpluse = 1;
          todatabese();
      }