Beispiel #1
0
        void myBrowser_WBLButtonDown(object sender, csExWB.HTMLMouseEventArgs e)
        {
            if (cropping)
            {
                try
                {
                    System.Diagnostics.Debug.WriteLine("myBrowser_WBLButtonDown");
                    // load image
                    image = (Bitmap)myBrowser.DrawThumb(myBrowser.ClientSize.Width, myBrowser.ClientSize.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb);

                    // format image
                    AForge.Imaging.Image.FormatImage(ref image);
                    UpdateSize();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                e.Handled = true;
                // start dragging
                dragging = true;
                // set mouse capture
                //myBrowser.Capture = true;

                // get selection start point
                GetImageAndScreenPoints(new Point(e.ClientX, e.ClientY), out start, out startW);

                // end point is the same as start
                end  = start;
                endW = startW;

                // draw frame
                Graphics g = myBrowser.CreateGraphics();
                DrawSelectionFrame(g);
                g.Dispose();
            }
        }