コード例 #1
0
ファイル: WizardForm.cs プロジェクト: w103csh/CDLOD
        private void buttonBrowseHeightmap_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog( );

            openFileDialog.Filter = "Tiled bitmap (.tbmp) |*.tbmp";
            openFileDialog.Title  = "Open Heightmap";

            if (openFileDialog.ShowDialog( ) == DialogResult.OK)
            {
                TiledBitmap heightmap = TiledBitmap.Open(openFileDialog.FileName, true);

                if (heightmap.PixelFormat != TiledBitmapPixelFormat.Format16BitGrayScale)
                {
                    MessageBox.Show("Heightmap format must be 16 bit grayscale.");
                }
                else
                {
                    // Set path into heightmap text box
                    textBoxHeightmap.Text = openFileDialog.FileName;
                    SetupInitialParameters(heightmap.Width, heightmap.Height);
                }

                heightmap.Close( );
            }
        }
コード例 #2
0
ファイル: WizardForm.cs プロジェクト: w103csh/CDLOD
        private void buttonBrowseOverlay_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog( );

            openFileDialog.Filter = "Tiled bitmap (.tbmp) |*.tbmp";
            openFileDialog.Title  = "Open Overlay Image";

            if (openFileDialog.ShowDialog( ) == DialogResult.OK)
            {
                TiledBitmap overlaymap = TiledBitmap.Open(openFileDialog.FileName, true);

                if (overlaymap.PixelFormat != TiledBitmapPixelFormat.Format24BitRGB)
                {
                    MessageBox.Show("Overlay image format must be 24 bit RGB.");
                }
                else
                {
                    // Set path into overlay image text box
                    textBoxOverlayImage.Text = openFileDialog.FileName;
                }

                overlaymap.Close( );
            }
        }