Esempio n. 1
0
        public void ShowZoomedSelectionArea()
        {
            if (_mouseSelectionArea == null)
            {
                return;
            }

            //show selected area preview
            int    width       = _mouseSelectionArea.getCroppedArea().Width / 2;
            int    height      = _mouseSelectionArea.getCroppedArea().Height / 2;
            Bitmap croppedArea = GraphicsTools.GetBitmapCroppedArea(bmpZXMonochromatic, new Point(_mouseSelectionArea.getCroppedArea().X / 2, _mouseSelectionArea.getCroppedArea().Y / 2),
                                                                    new Size(width, height));

            pictureZoomedArea.Image = croppedArea;
        }
Esempio n. 2
0
        private void buttonExportSelectionArea_Click(object sender, EventArgs e)
        {
            //export selection area to picture or bytes
            if (_mouseSelectionArea == null || _mouseSelectionArea.isSelected() == false)
            {
                return;
            }

            int width  = _mouseSelectionArea.getCroppedArea().Width / 2;
            int height = _mouseSelectionArea.getCroppedArea().Height / 2;

            Bitmap croppedArea = GraphicsTools.GetBitmapCroppedArea(bmpZXMonochromatic, new Point(_mouseSelectionArea.getCroppedArea().X / 2, _mouseSelectionArea.getCroppedArea().Y / 2),
                                                                    new Size(width, height));

            if (croppedArea == null)
            {
                Locator.Resolve <IUserMessage>().Warning("Could not get cropped area...nothing done!");
                return;
            }

            byte[] arrScreenBytes = GraphicsTools.GetBytesFromBitmap(croppedArea);
            SaveScreenBytes(arrScreenBytes, width, height);
            //croppedArea.Save(@"image_export_cropped.bmp");
        }