예제 #1
0
        private void LoadImage(string path)
        {
            string imageFilePath = this.lastImagePath = path;

            if (this.lastImage != null)
            {
                this.lastImage.Dispose();
                this.lastImage = null;
            }
            if (this.lastImagePath != null)
            {
                ImageChangedArgs args = new ImageChangedArgs(imageFilePath);
                this.lastImage = (Bitmap)args.Image.Clone();
                this.LoadImage(args);
                this.EnableControls();
                args.Dispose();
                args = null;
            }
        }
예제 #2
0
        private void LoadImage(ImageChangedArgs imageArgs)
        {
            try
            {
                //Set the thumbnail
                IBitmapImage ibi      = ImageUtils.CreateThumbnail(imageArgs.Stream, this.pbThumbnail.Size);
                Bitmap       bmpThumb = ImageUtils.IBitmapImageToBitmap(ibi);
                this.pbThumbnail.Image = bmpThumb;

                //Set the image
                ibi      = ImageUtils.CreateThumbnail(imageArgs.Stream, imageArgs.Image.Size);
                bmpThumb = ImageUtils.IBitmapImageToBitmap(ibi);
                this.imageViewer1.Image = bmpThumb;
            }
            catch
            {
                this.pbThumbnail.Image = null;
            }
        }