SurfacePlotDialog.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. using PaintDotNet.Data.SurfacePlot;
  2. using System;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Windows.Forms;
  6. namespace PaintDotNet.Instrument
  7. {
  8. internal class SurfacePlotDialog : PdnBaseForm
  9. {
  10. private GroupBox groupBox1;
  11. private GroupBox groupBox2;
  12. private Button button1;
  13. private PictureBox pictureBox1;
  14. private Button button2;
  15. private AppWorkspace appWorkspace;
  16. private Bitmap map;
  17. [Browsable(false)]
  18. public AppWorkspace AppWorkspace
  19. {
  20. get
  21. {
  22. return this.appWorkspace;
  23. }
  24. set
  25. {
  26. this.appWorkspace = value;
  27. }
  28. }
  29. public SurfacePlotDialog(AppWorkspace AppWorkspace)
  30. {
  31. //
  32. // Required for Windows Form Designer support
  33. //
  34. InitializeComponent();
  35. this.appWorkspace = AppWorkspace;
  36. this.MaximizeBox = true;
  37. string textFormat = PdnResources.GetString("AboutDialog.Text.Format");
  38. this.Text = string.Format(textFormat, PdnInfo.GetBareProductName());
  39. this.Icon = PdnInfo.AppIcon;
  40. //this.okButton.Text = PdnResources.GetString("Form.OkButton.Text");
  41. //this.okButton.Location = new Point((this.ClientSize.Width - this.okButton.Width) / 2, this.okButton.Top);
  42. //this.creditsLabel.Text = PdnResources.GetString("AboutDialog.CreditsLabel.Text");
  43. Interactive3DSurfacePlot plot = new Interactive3DSurfacePlot();
  44. plot.run(AppWorkspace.ActiveDocumentWorkspace.CompositionSurface.CreateAliasedBitmap());
  45. }
  46. #region Windows Form Designer generated code
  47. /// <summary>
  48. /// Required method for Designer support - do not modify
  49. /// the contents of this method with the code editor.
  50. /// </summary>
  51. private void InitializeComponent()
  52. {
  53. this.groupBox1 = new System.Windows.Forms.GroupBox();
  54. this.pictureBox1 = new System.Windows.Forms.PictureBox();
  55. this.groupBox2 = new System.Windows.Forms.GroupBox();
  56. this.button1 = new System.Windows.Forms.Button();
  57. this.button2 = new System.Windows.Forms.Button();
  58. this.groupBox1.SuspendLayout();
  59. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
  60. this.groupBox2.SuspendLayout();
  61. this.SuspendLayout();
  62. //
  63. // groupBox1
  64. //
  65. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  66. | System.Windows.Forms.AnchorStyles.Left)
  67. | System.Windows.Forms.AnchorStyles.Right)));
  68. this.groupBox1.Controls.Add(this.pictureBox1);
  69. this.groupBox1.Location = new System.Drawing.Point(13, 70);
  70. this.groupBox1.Name = "groupBox1";
  71. this.groupBox1.Size = new System.Drawing.Size(709, 479);
  72. this.groupBox1.TabIndex = 5;
  73. this.groupBox1.TabStop = false;
  74. this.groupBox1.Text = "Ô¤ÀÀ";
  75. //
  76. // pictureBox1
  77. //
  78. this.pictureBox1.Location = new System.Drawing.Point(7, 21);
  79. this.pictureBox1.Name = "pictureBox1";
  80. this.pictureBox1.Size = new System.Drawing.Size(696, 452);
  81. this.pictureBox1.TabIndex = 0;
  82. this.pictureBox1.TabStop = false;
  83. //
  84. // groupBox2
  85. //
  86. this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  87. | System.Windows.Forms.AnchorStyles.Right)));
  88. this.groupBox2.Controls.Add(this.button2);
  89. this.groupBox2.Controls.Add(this.button1);
  90. this.groupBox2.Location = new System.Drawing.Point(13, 12);
  91. this.groupBox2.Name = "groupBox2";
  92. this.groupBox2.Size = new System.Drawing.Size(709, 52);
  93. this.groupBox2.TabIndex = 6;
  94. this.groupBox2.TabStop = false;
  95. this.groupBox2.Text = "²Ù×÷";
  96. //
  97. // button1
  98. //
  99. this.button1.Location = new System.Drawing.Point(628, 20);
  100. this.button1.Name = "button1";
  101. this.button1.Size = new System.Drawing.Size(75, 23);
  102. this.button1.TabIndex = 0;
  103. this.button1.Text = "button1";
  104. this.button1.UseVisualStyleBackColor = true;
  105. this.button1.Click += new System.EventHandler(this.button1_Click);
  106. //
  107. // button2
  108. //
  109. this.button2.Location = new System.Drawing.Point(546, 21);
  110. this.button2.Name = "button2";
  111. this.button2.Size = new System.Drawing.Size(75, 23);
  112. this.button2.TabIndex = 1;
  113. this.button2.Text = "button2";
  114. this.button2.UseVisualStyleBackColor = true;
  115. this.button2.Click += new System.EventHandler(this.button2_Click);
  116. //
  117. // SurfacePlotDialog
  118. //
  119. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  120. this.ClientSize = new System.Drawing.Size(734, 561);
  121. this.Controls.Add(this.groupBox2);
  122. this.Controls.Add(this.groupBox1);
  123. this.Name = "SurfacePlotDialog";
  124. this.Controls.SetChildIndex(this.groupBox1, 0);
  125. this.Controls.SetChildIndex(this.groupBox2, 0);
  126. this.groupBox1.ResumeLayout(false);
  127. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
  128. this.groupBox2.ResumeLayout(false);
  129. this.ResumeLayout(false);
  130. }
  131. #endregion
  132. private void button1_Click(object sender, EventArgs e)
  133. {
  134. map = new Bitmap("C:\\Users\\zyh\\Desktop\\ͼƬ\\0e2442a7d933c8956c0e8eeadb1373f08202002a.jpg");
  135. pictureBox1.Image = map;
  136. }
  137. private void button2_Click(object sender, EventArgs e)
  138. {
  139. Interactive3DSurfacePlot plot = new Interactive3DSurfacePlot();
  140. plot.run(map);
  141. }
  142. }
  143. }