Пример #1
0
        public EnlargeImageImp(Image image, Point point, int realImageWidth, int realImageHeight)
        {
            startPoint           = point;
            souceImage           = image;
            this.realImageWidth  = realImageWidth;
            this.realImageHeight = realImageHeight;
            if (image != null)
            {
                //ImageUtil.CaptureImage(image, );
                // 放大图片
                enLargeImage = ImageUtil.EnlargeImage(image, (image.Height * enlargeRate), (image.Width * enlargeRate));

                enlargeImagePopuForm = new EnlargeImagePopuForm(enLargeImage);
                enlargeImagePopuForm.Show();
                width  = enlargeImagePopuForm.Width;
                height = enlargeImagePopuForm.Height;
            }
        }
Пример #2
0
        public void MoveEnlargePicture(Point movePoint, string info = "")
        {
            // 放大窗体的位置定位(注意在边缘的展示的问题)
            Point point = ReCalculatePosition(width, height, movePoint);

            // 如果窗体已被释放
            if (enlargeImagePopuForm.IsDisposed || !enlargeImagePopuForm.IsHandleCreated || !enlargeImagePopuForm.Created)
            {
                enlargeImagePopuForm = new EnlargeImagePopuForm(enLargeImage);
                enlargeImagePopuForm.Show();
            }

            // 进行定位
            enlargeImagePopuForm.Location = point;

            // 进行放大图像定位
            //Point enLargePoint = new Point((int)(movePoint.X * enlargeRate), (int)(movePoint.Y * enlargeRate));
            Point enLargePoint = new Point((movePoint.X * enLargeImage.Width / realImageWidth), (movePoint.Y * enLargeImage.Height / realImageHeight));

            enlargeImagePopuForm.Move2Target(enLargePoint);
        }