Beispiel #1
0
        private void OnTileCorrelationBegin(CorrelationTile tile, FreeImageAlgorithmsBitmap fib)
        {
            this.useCorrelationCheckBox.Checked = false;
            this.currentTile = tile;

            #if DEBUG

            FreeImageAlgorithmsBitmap fg = new FreeImageAlgorithmsBitmap(fib);

            fg.ConvertToStandardType(true);
            fg.ConvertTo24Bits();

            this.debugForm.TileImageView.Image = fg.ToBitmap();

            this.debugForm.BackgroundImageView.Refresh();
            this.debugForm.TileImageView.Refresh();

            fg.Dispose();

            #endif
        }
Beispiel #2
0
        public void AddTile(Rectangle bounds, FreeImageAlgorithmsBitmap fib)
        {
            if(fib == null)
                return;

            try
            {
                Rectangle imageBounds = TranslateVirtualRectangleToImageRectangle(bounds);

                if (this.xScaleFactor < 1.0f || this.yScaleFactor < 1.0f)
                    fib.Rescale(imageBounds.Size, FREE_IMAGE_FILTER.FILTER_BILINEAR);

                fib.ConvertToStandardType(true);

                if (this.forceGreyscale && !fib.IsGreyScale)
                    fib.ConvertToGreyscale();

                this.image.PasteFromTopLeft(fib, imageBounds.Location, this.blending);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }