示例#1
0
        public MapViewerForm()
        {
            InitializeComponent();
            this.toolbarForm.parentForm = this;
            this.formState = FormState.NORMAL;

            infoMgr = new MapInfoManager();

            this.pixelMap = null;
        }
示例#2
0
        private void viewerOpenFileDialog_FileOk(object sender, CancelEventArgs e)
        {
            try
            {
                this.pixelMap    = new PixelMap.PixelMap(this.viewerOpenFileDialog.FileName);
                this.mapFilepath = this.viewerOpenFileDialog.FileName;
                this.viewerPictureBox.BackgroundImage = this.pixelMap.GreyMap;
                this.viewerPictureBox.Size            = new Size(this.pixelMap.Header.Width, this.pixelMap.Header.Height);
                this.viewerPanel.AutoScroll           = true;
                this.toolbarForm.Visible = true;

                this.infoMgr.mapFilename = System.IO.Path.GetFileName(this.viewerOpenFileDialog.FileName);
                this.infoMgr.mapWidth    = this.pixelMap.Header.Width;
                this.infoMgr.mapHeight   = this.pixelMap.Header.Height;

                this.saveToolStripMenuItem.Enabled = true;
            }
            catch (Exception ex)
            {
                ShowException(ex);
            }
        }
        private string ConvertToJpeg(System.IO.FileInfo incomingInfo)
        {
            PixelMap.PixelMap pm = new PixelMap.PixelMap(incomingInfo.FullName);

            return pm.SaveBitmapAsJpeg(incomingInfo);
        }