private void btExport_Click(object sender, EventArgs e) { ExportImgDialog.ShowDialog(); string newfile = ExportImgDialog.FileName; if (newfile.Length > 0) { System.Drawing.Bitmap saveimage = new Bitmap(1600, 1600); canvasptc.Width = saveimage.Width; canvasptc.Height = saveimage.Height; rendercontext(); canvasptc.Refresh(); canvasptc.DrawToBitmap(saveimage, new Rectangle(0, 0, saveimage.Width, saveimage.Height)); saveimage.Save(newfile, System.Drawing.Imaging.ImageFormat.Jpeg); resize_canvas(); } }
private void ToolStripButton1_Click(object sender, EventArgs e) { if (this.propertyGrid.SelectedObject == null || !(this.propertyGrid.SelectedObject is FileFormats.Pure3D.BaseNode)) { MessageBox.Show("G1zm0 says: Select an item frist.", "Unable to Export", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var node = (FileFormats.Pure3D.BaseNode) this.propertyGrid.SelectedObject; if (node.Exportable == false) { MessageBox.Show("G1zm0 says: It's not an Exportable item.", "Unable to Export", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (node.TypeId == 102400) { if (ExportImgDialog.ShowDialog() == DialogResult.OK) { string _filename = ExportImgDialog.SelectedPath; FileFormats.Pure3D.Texture _text = (FileFormats.Pure3D.Texture)node; _filename = Path.Combine(_filename, Path.ChangeExtension(_text.Name, ".png")); if (File.Exists(_filename)) { File.Delete(_filename); } node.TextureExport(_filename); MessageBox.Show("G1zm0 says: Texture Exported.", "Export Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("G1zm0 says: It's not an image Texture.", "Unable to Export", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btExport_Click(object sender, EventArgs e) { ExportImgDialog.ShowDialog(); string newfile = ExportImgDialog.FileName; if (newfile.Length > 0) { if (ExportImgDialog.FilterIndex == 1) { laser_viewer3D._model3D.export_to_obj(newfile); } else if (ExportImgDialog.FilterIndex == 2) { laser_viewer3D._model3D.export_to_3ds(newfile); } else if (ExportImgDialog.FilterIndex == 3) { laser_viewer3D._model3D.export_to_vrml(newfile); } } }