private void ChangeObjectTexture2(object sender, EventArgs e) { if (TextureFileDialog.ShowDialog() == DialogResult.OK) { Bitmap oldImage = IoTextureBox2.BackgroundImage as Bitmap; Bitmap bitmap = new Bitmap(TextureFileDialog.FileName); IoTextureBox2.BackgroundImage = bitmap; colorsForPolygonFill2.SetObjectTexture(bitmap); oldImage?.Dispose(); drawingArea.Refresh(); } }
private void ChangeHeightMap(object sender, EventArgs e) { if (TextureFileDialog.ShowDialog() == DialogResult.OK) { Bitmap oldImage = DisruptionVectorTextureBox.BackgroundImage as Bitmap; Bitmap bitmap = new Bitmap(TextureFileDialog.FileName); DisruptionVectorTextureBox.BackgroundImage = Image.FromFile(TextureFileDialog.FileName); colorsForPolygonFill.SetHeightMap(bitmap); colorsForPolygonFill2.SetHeightMap(bitmap); oldImage?.Dispose(); drawingArea.Refresh(); } }