Exemple #1
0
 public void hide()
 {
     /*button.Visible = false;
      * pictureBoxFuck.Visible = false;*/
     button.Dispose();
     pictureBoxFuck.Dispose();
     labelM.Dispose();
     labelMin.Dispose();
     labelSec.Dispose();
 }
 public void ProfileImage(System.Windows.Forms.PictureBox image, string userID)
 {
     try
     {
         image.Dispose();
         if (System.IO.File.Exists($"UserImages\\{userID}.jpg"))
         {
             System.IO.File.Delete($"UserImages\\{userID}.jpg");
         }
         image.Image.Save($"UserImages\\{userID}.jpg");
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.ToString());
     }
 }
Exemple #3
0
 public void Dispose()
 {
     _content.Dispose();
     if (webCam != null)
     {
         webCam.Dispose();
     }
     if (ip != IntPtr.Zero)
     {
         Marshal.FreeCoTaskMem(ip);
         ip = IntPtr.Zero;
     }
     System.Windows.Forms.Control.FromHandle(GameEngine.WindowPtr).Controls.Clear();
     stillImageBox.Dispose();
     cameraFeedBox.Dispose();
     webCamDevices.Dispose();
 }
Exemple #4
0
            // Автомобиль уезжает из депо
            private void Quit(object _)
            {
                Bitmap bitmap1 = client.AutoType == Auto.vehicle ? BankService.Properties.Resources.car : BankService.Properties.Resources.bus;
                int    x = picture.Location.X, y = picture.Location.Y;

                bitmap1.RotateFlip(RotateFlipType.Rotate180FlipY);
                picture.Image = bitmap1;
                if (x < 350)
                {
                    x++;
                    picture.Invoke((Action)(() => picture.Location = new Point(x, y)));
                }
                else
                {
                    timer.Change(Timeout.Infinite, Timeout.Infinite);
                    timer.Dispose();

                    picture.Invoke((Action)(() => picture.Dispose()));
                }
            }
Exemple #5
0
 public void Dispose()
 {
     if (webCam != null)
     {
         webCam.Dispose();
     }
     if (cameraFeedBox != null)
     {
         cameraFeedBox.Dispose();
     }
     if (stillImageBox != null)
     {
         stillImageBox.Dispose();
     }
     if (originalPicture != null)
     {
         originalPicture.Dispose();
     }
     if (webCamDevices != null)
     {
         webCamDevices.Dispose();
     }
 }
Exemple #6
0
 public void Destroy()
 {
     parent.Controls.Remove(shortcut);
     shortcut.Dispose();
 }
Exemple #7
0
        //-------------------------------------------------------------------------
        private Bitmap GetBitmapFromPDFPage(PDFLibNet.PDFWrapper pdfDoc, int pageNumber)
        {
            if (pdfDoc == null) return null;
            //try
            //{
            pdfDoc.CurrentPage = pageNumber;
            double dpi = pdfDoc.RenderDPI;
            System.Windows.Forms.PictureBox pic = new System.Windows.Forms.PictureBox();
            pic.Width = 2560 + 17;//PhysicalDimension = {Width = 2560.0 Height = 3328.0}
            //pic.Height = 3328;//PhysicalDimension = {Width = 2560.0 Height = 3312.0}
            pdfDoc.FitToWidth(pic.Handle);
            pic.Height = pdfDoc.PageHeight;
            //pictureBox1.Height = pdfDoc.PageHeight;
            pdfDoc.RenderPage(pic.Handle);
            pdfDoc.ClientBounds = new System.Drawing.Rectangle(0, 0, pdfDoc.PageWidth, pdfDoc.PageHeight);
            Bitmap backbuffer = new Bitmap(pdfDoc.PageWidth, pdfDoc.PageHeight);
            using (Graphics g = Graphics.FromImage(backbuffer))
            {//недопустимый параметр при 8 потоках
                pdfDoc.DrawPageHDC(g.GetHdc());
                g.ReleaseHdc();
            }
            pic.Dispose();
            //var entryBitmap = (Bitmap)backbuffer.Clone();
            //backbuffer.Dispose();

            return backbuffer;// entryBitmap;
            //}
            //catch (Exception)
            //{
            //    return null;
            //}
        }