summaryrefslogtreecommitdiffstats
path: root/win/C#/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-06-07 23:04:05 +0000
committersr55 <[email protected]>2009-06-07 23:04:05 +0000
commit2b3ac1f2ae64e8591ffa6f3485bd131b8ff7d9ef (patch)
tree4594d79c72ac0e4f48fa69b8b260ac9128eabb16 /win/C#/Controls
parenta4bc7d65af62d27c3b8d9a2f3c50f5938a46d9da (diff)
WinGui:
- Checkin of the new picutre settings panel (before I end up accidentally losing working code) - Modes: None, Strict and Loose work (mostly). Custom does not work (yet) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2497 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Controls')
-rw-r--r--win/C#/Controls/PictureSettings.Designer.cs569
-rw-r--r--win/C#/Controls/PictureSettings.cs729
-rw-r--r--win/C#/Controls/PictureSettings.resx120
3 files changed, 1418 insertions, 0 deletions
diff --git a/win/C#/Controls/PictureSettings.Designer.cs b/win/C#/Controls/PictureSettings.Designer.cs
new file mode 100644
index 000000000..a5a79d85a
--- /dev/null
+++ b/win/C#/Controls/PictureSettings.Designer.cs
@@ -0,0 +1,569 @@
+using System.Windows.Forms;
+
+namespace Handbrake.Controls
+{
+ partial class PictureSettings
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.text_height = new System.Windows.Forms.NumericUpDown();
+ this.text_width = new System.Windows.Forms.NumericUpDown();
+ this.label4 = new System.Windows.Forms.Label();
+ this.lbl_max = new System.Windows.Forms.Label();
+ this.lbl_src_res = new System.Windows.Forms.Label();
+ this.label7 = new System.Windows.Forms.Label();
+ this.label6 = new System.Windows.Forms.Label();
+ this.drp_anamorphic = new System.Windows.Forms.ComboBox();
+ this.label26 = new System.Windows.Forms.Label();
+ this.lbl_Aspect = new System.Windows.Forms.Label();
+ this.Label91 = new System.Windows.Forms.Label();
+ this.Label55 = new System.Windows.Forms.Label();
+ this.lbl_modulus = new System.Windows.Forms.Label();
+ this.drop_modulus = new System.Windows.Forms.ComboBox();
+ this.txt_displayWidth = new System.Windows.Forms.TextBox();
+ this.lbl_displayWidth = new System.Windows.Forms.Label();
+ this.lbl_parWidth = new System.Windows.Forms.Label();
+ this.txt_parWidth = new System.Windows.Forms.TextBox();
+ this.lbl_parHeight = new System.Windows.Forms.Label();
+ this.txt_parHeight = new System.Windows.Forms.TextBox();
+ this.check_KeepAR = new System.Windows.Forms.CheckBox();
+ this.check_customCrop = new System.Windows.Forms.RadioButton();
+ this.check_autoCrop = new System.Windows.Forms.RadioButton();
+ this.crop_bottom = new System.Windows.Forms.NumericUpDown();
+ this.crop_top = new System.Windows.Forms.NumericUpDown();
+ this.crop_left = new System.Windows.Forms.NumericUpDown();
+ this.crop_right = new System.Windows.Forms.NumericUpDown();
+ this.label8 = new System.Windows.Forms.Label();
+ this.Label53 = new System.Windows.Forms.Label();
+ this.Label52 = new System.Windows.Forms.Label();
+ this.Label51 = new System.Windows.Forms.Label();
+ this.Label15 = new System.Windows.Forms.Label();
+ this.lbl_anamorphic = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.text_height)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.text_width)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.crop_bottom)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.crop_top)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.crop_left)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.crop_right)).BeginInit();
+ this.SuspendLayout();
+ //
+ // text_height
+ //
+ this.text_height.Location = new System.Drawing.Point(206, 59);
+ this.text_height.Maximum = new decimal(new int[] {
+ 2560,
+ 0,
+ 0,
+ 0});
+ this.text_height.Minimum = new decimal(new int[] {
+ 64,
+ 0,
+ 0,
+ 0});
+ this.text_height.Name = "text_height";
+ this.text_height.Size = new System.Drawing.Size(64, 20);
+ this.text_height.TabIndex = 50;
+ this.text_height.Value = new decimal(new int[] {
+ 64,
+ 0,
+ 0,
+ 0});
+ this.text_height.ValueChanged += new System.EventHandler(this.text_height_ValueChanged);
+ //
+ // text_width
+ //
+ this.text_width.Location = new System.Drawing.Point(68, 59);
+ this.text_width.Maximum = new decimal(new int[] {
+ 2560,
+ 0,
+ 0,
+ 0});
+ this.text_width.Minimum = new decimal(new int[] {
+ 64,
+ 0,
+ 0,
+ 0});
+ this.text_width.Name = "text_width";
+ this.text_width.Size = new System.Drawing.Size(64, 20);
+ this.text_width.TabIndex = 49;
+ this.text_width.Value = new decimal(new int[] {
+ 64,
+ 0,
+ 0,
+ 0});
+ this.text_width.ValueChanged += new System.EventHandler(this.text_width_ValueChanged);
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.BackColor = System.Drawing.Color.Transparent;
+ this.label4.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label4.ForeColor = System.Drawing.Color.Black;
+ this.label4.Location = new System.Drawing.Point(152, 63);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(48, 13);
+ this.label4.TabIndex = 48;
+ this.label4.Text = "Height:";
+ //
+ // lbl_max
+ //
+ this.lbl_max.AutoSize = true;
+ this.lbl_max.Location = new System.Drawing.Point(273, 80);
+ this.lbl_max.Name = "lbl_max";
+ this.lbl_max.Size = new System.Drawing.Size(34, 13);
+ this.lbl_max.TabIndex = 47;
+ this.lbl_max.Text = "{max}";
+ //
+ // lbl_src_res
+ //
+ this.lbl_src_res.AutoSize = true;
+ this.lbl_src_res.BackColor = System.Drawing.Color.Transparent;
+ this.lbl_src_res.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_src_res.Location = new System.Drawing.Point(66, 36);
+ this.lbl_src_res.Name = "lbl_src_res";
+ this.lbl_src_res.Size = new System.Drawing.Size(72, 12);
+ this.lbl_src_res.TabIndex = 41;
+ this.lbl_src_res.Text = "Select a Title";
+ //
+ // label7
+ //
+ this.label7.AutoSize = true;
+ this.label7.BackColor = System.Drawing.Color.Transparent;
+ this.label7.Location = new System.Drawing.Point(13, 35);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(44, 13);
+ this.label7.TabIndex = 40;
+ this.label7.Text = "Source:";
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.BackColor = System.Drawing.Color.Transparent;
+ this.label6.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label6.Location = new System.Drawing.Point(13, 91);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(80, 13);
+ this.label6.TabIndex = 45;
+ this.label6.Text = "Anamorphic:";
+ //
+ // drp_anamorphic
+ //
+ this.drp_anamorphic.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.drp_anamorphic.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.drp_anamorphic.FormattingEnabled = true;
+ this.drp_anamorphic.Items.AddRange(new object[] {
+ "None",
+ "Strict",
+ "Loose",
+ "Custom"});
+ this.drp_anamorphic.Location = new System.Drawing.Point(109, 88);
+ this.drp_anamorphic.Name = "drp_anamorphic";
+ this.drp_anamorphic.Size = new System.Drawing.Size(110, 21);
+ this.drp_anamorphic.TabIndex = 46;
+ this.drp_anamorphic.SelectedIndexChanged += new System.EventHandler(this.drp_anamorphic_SelectedIndexChanged);
+ //
+ // label26
+ //
+ this.label26.AutoSize = true;
+ this.label26.BackColor = System.Drawing.Color.Transparent;
+ this.label26.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label26.Location = new System.Drawing.Point(13, 13);
+ this.label26.Name = "label26";
+ this.label26.Size = new System.Drawing.Size(34, 13);
+ this.label26.TabIndex = 39;
+ this.label26.Text = "Size";
+ //
+ // lbl_Aspect
+ //
+ this.lbl_Aspect.AutoSize = true;
+ this.lbl_Aspect.BackColor = System.Drawing.Color.Transparent;
+ this.lbl_Aspect.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_Aspect.Location = new System.Drawing.Point(241, 36);
+ this.lbl_Aspect.Name = "lbl_Aspect";
+ this.lbl_Aspect.Size = new System.Drawing.Size(72, 12);
+ this.lbl_Aspect.TabIndex = 43;
+ this.lbl_Aspect.Text = "Select a Title";
+ //
+ // Label91
+ //
+ this.Label91.AutoSize = true;
+ this.Label91.BackColor = System.Drawing.Color.Transparent;
+ this.Label91.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Label91.Location = new System.Drawing.Point(152, 35);
+ this.Label91.Name = "Label91";
+ this.Label91.Size = new System.Drawing.Size(83, 13);
+ this.Label91.TabIndex = 42;
+ this.Label91.Text = "Aspect Ratio:";
+ //
+ // Label55
+ //
+ this.Label55.AutoSize = true;
+ this.Label55.BackColor = System.Drawing.Color.Transparent;
+ this.Label55.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Label55.ForeColor = System.Drawing.Color.Black;
+ this.Label55.Location = new System.Drawing.Point(13, 63);
+ this.Label55.Name = "Label55";
+ this.Label55.Size = new System.Drawing.Size(44, 13);
+ this.Label55.TabIndex = 44;
+ this.Label55.Text = "Width:";
+ //
+ // lbl_modulus
+ //
+ this.lbl_modulus.AutoSize = true;
+ this.lbl_modulus.BackColor = System.Drawing.Color.Transparent;
+ this.lbl_modulus.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_modulus.Location = new System.Drawing.Point(13, 118);
+ this.lbl_modulus.Name = "lbl_modulus";
+ this.lbl_modulus.Size = new System.Drawing.Size(58, 13);
+ this.lbl_modulus.TabIndex = 51;
+ this.lbl_modulus.Text = "Modulus:";
+ //
+ // drop_modulus
+ //
+ this.drop_modulus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.drop_modulus.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.drop_modulus.FormattingEnabled = true;
+ this.drop_modulus.Items.AddRange(new object[] {
+ "16",
+ "8",
+ "4",
+ "2"});
+ this.drop_modulus.Location = new System.Drawing.Point(109, 115);
+ this.drop_modulus.Name = "drop_modulus";
+ this.drop_modulus.Size = new System.Drawing.Size(110, 21);
+ this.drop_modulus.TabIndex = 52;
+ //
+ // txt_displayWidth
+ //
+ this.txt_displayWidth.Location = new System.Drawing.Point(109, 142);
+ this.txt_displayWidth.Name = "txt_displayWidth";
+ this.txt_displayWidth.Size = new System.Drawing.Size(100, 20);
+ this.txt_displayWidth.TabIndex = 53;
+ this.txt_displayWidth.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txt_displayWidth_Keyup);
+ //
+ // lbl_displayWidth
+ //
+ this.lbl_displayWidth.AutoSize = true;
+ this.lbl_displayWidth.BackColor = System.Drawing.Color.Transparent;
+ this.lbl_displayWidth.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_displayWidth.Location = new System.Drawing.Point(13, 145);
+ this.lbl_displayWidth.Name = "lbl_displayWidth";
+ this.lbl_displayWidth.Size = new System.Drawing.Size(90, 13);
+ this.lbl_displayWidth.TabIndex = 54;
+ this.lbl_displayWidth.Text = "Display Width:";
+ //
+ // lbl_parWidth
+ //
+ this.lbl_parWidth.AutoSize = true;
+ this.lbl_parWidth.BackColor = System.Drawing.Color.Transparent;
+ this.lbl_parWidth.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_parWidth.Location = new System.Drawing.Point(13, 171);
+ this.lbl_parWidth.Name = "lbl_parWidth";
+ this.lbl_parWidth.Size = new System.Drawing.Size(71, 13);
+ this.lbl_parWidth.TabIndex = 56;
+ this.lbl_parWidth.Text = "PAR Width:";
+ //
+ // txt_parWidth
+ //
+ this.txt_parWidth.Location = new System.Drawing.Point(109, 168);
+ this.txt_parWidth.Name = "txt_parWidth";
+ this.txt_parWidth.Size = new System.Drawing.Size(100, 20);
+ this.txt_parWidth.TabIndex = 55;
+ this.txt_parWidth.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txt_parWidth_Keyup);
+ //
+ // lbl_parHeight
+ //
+ this.lbl_parHeight.AutoSize = true;
+ this.lbl_parHeight.BackColor = System.Drawing.Color.Transparent;
+ this.lbl_parHeight.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_parHeight.Location = new System.Drawing.Point(13, 197);
+ this.lbl_parHeight.Name = "lbl_parHeight";
+ this.lbl_parHeight.Size = new System.Drawing.Size(75, 13);
+ this.lbl_parHeight.TabIndex = 58;
+ this.lbl_parHeight.Text = "PAR Height:";
+ //
+ // txt_parHeight
+ //
+ this.txt_parHeight.Location = new System.Drawing.Point(109, 194);
+ this.txt_parHeight.Name = "txt_parHeight";
+ this.txt_parHeight.Size = new System.Drawing.Size(100, 20);
+ this.txt_parHeight.TabIndex = 57;
+ this.txt_parHeight.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txt_parHeight_Keyup);
+ //
+ // check_KeepAR
+ //
+ this.check_KeepAR.AutoSize = true;
+ this.check_KeepAR.Location = new System.Drawing.Point(276, 60);
+ this.check_KeepAR.Name = "check_KeepAR";
+ this.check_KeepAR.Size = new System.Drawing.Size(69, 17);
+ this.check_KeepAR.TabIndex = 59;
+ this.check_KeepAR.Text = "Keep AR";
+ this.check_KeepAR.UseVisualStyleBackColor = true;
+ this.check_KeepAR.CheckedChanged += new System.EventHandler(this.check_KeepAR_CheckedChanged);
+ //
+ // check_customCrop
+ //
+ this.check_customCrop.AutoSize = true;
+ this.check_customCrop.Location = new System.Drawing.Point(387, 57);
+ this.check_customCrop.Name = "check_customCrop";
+ this.check_customCrop.Size = new System.Drawing.Size(63, 17);
+ this.check_customCrop.TabIndex = 70;
+ this.check_customCrop.Text = "Custom:";
+ this.check_customCrop.UseVisualStyleBackColor = true;
+ this.check_customCrop.CheckedChanged += new System.EventHandler(this.check_customCrop_CheckedChanged);
+ //
+ // check_autoCrop
+ //
+ this.check_autoCrop.AutoSize = true;
+ this.check_autoCrop.Checked = true;
+ this.check_autoCrop.Location = new System.Drawing.Point(387, 33);
+ this.check_autoCrop.Name = "check_autoCrop";
+ this.check_autoCrop.Size = new System.Drawing.Size(72, 17);
+ this.check_autoCrop.TabIndex = 69;
+ this.check_autoCrop.TabStop = true;
+ this.check_autoCrop.Text = "Automatic";
+ this.check_autoCrop.UseVisualStyleBackColor = true;
+ this.check_autoCrop.CheckedChanged += new System.EventHandler(this.check_autoCrop_CheckedChanged);
+ //
+ // crop_bottom
+ //
+ this.crop_bottom.Enabled = false;
+ this.crop_bottom.Location = new System.Drawing.Point(467, 146);
+ this.crop_bottom.Maximum = new decimal(new int[] {
+ 1080,
+ 0,
+ 0,
+ 0});
+ this.crop_bottom.Name = "crop_bottom";
+ this.crop_bottom.Size = new System.Drawing.Size(44, 20);
+ this.crop_bottom.TabIndex = 67;
+ //
+ // crop_top
+ //
+ this.crop_top.Enabled = false;
+ this.crop_top.Location = new System.Drawing.Point(467, 100);
+ this.crop_top.Maximum = new decimal(new int[] {
+ 1080,
+ 0,
+ 0,
+ 0});
+ this.crop_top.Name = "crop_top";
+ this.crop_top.Size = new System.Drawing.Size(44, 20);
+ this.crop_top.TabIndex = 64;
+ //
+ // crop_left
+ //
+ this.crop_left.Enabled = false;
+ this.crop_left.Location = new System.Drawing.Point(416, 122);
+ this.crop_left.Maximum = new decimal(new int[] {
+ 1920,
+ 0,
+ 0,
+ 0});
+ this.crop_left.Name = "crop_left";
+ this.crop_left.Size = new System.Drawing.Size(44, 20);
+ this.crop_left.TabIndex = 62;
+ //
+ // crop_right
+ //
+ this.crop_right.Enabled = false;
+ this.crop_right.Location = new System.Drawing.Point(518, 122);
+ this.crop_right.Maximum = new decimal(new int[] {
+ 1920,
+ 0,
+ 0,
+ 0});
+ this.crop_right.Name = "crop_right";
+ this.crop_right.Size = new System.Drawing.Size(44, 20);
+ this.crop_right.TabIndex = 65;
+ //
+ // label8
+ //
+ this.label8.AutoSize = true;
+ this.label8.BackColor = System.Drawing.Color.Transparent;
+ this.label8.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label8.Location = new System.Drawing.Point(384, 13);
+ this.label8.Name = "label8";
+ this.label8.Size = new System.Drawing.Size(37, 13);
+ this.label8.TabIndex = 60;
+ this.label8.Text = "Crop";
+ //
+ // Label53
+ //
+ this.Label53.AutoSize = true;
+ this.Label53.BackColor = System.Drawing.Color.Transparent;
+ this.Label53.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Label53.Location = new System.Drawing.Point(465, 170);
+ this.Label53.Name = "Label53";
+ this.Label53.Size = new System.Drawing.Size(48, 13);
+ this.Label53.TabIndex = 68;
+ this.Label53.Text = "Bottom";
+ //
+ // Label52
+ //
+ this.Label52.AutoSize = true;
+ this.Label52.BackColor = System.Drawing.Color.Transparent;
+ this.Label52.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Label52.Location = new System.Drawing.Point(474, 85);
+ this.Label52.Name = "Label52";
+ this.Label52.Size = new System.Drawing.Size(28, 13);
+ this.Label52.TabIndex = 63;
+ this.Label52.Text = "Top";
+ //
+ // Label51
+ //
+ this.Label51.AutoSize = true;
+ this.Label51.BackColor = System.Drawing.Color.Transparent;
+ this.Label51.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Label51.Location = new System.Drawing.Point(561, 124);
+ this.Label51.Name = "Label51";
+ this.Label51.Size = new System.Drawing.Size(36, 13);
+ this.Label51.TabIndex = 66;
+ this.Label51.Text = "Right";
+ //
+ // Label15
+ //
+ this.Label15.AutoSize = true;
+ this.Label15.BackColor = System.Drawing.Color.Transparent;
+ this.Label15.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Label15.Location = new System.Drawing.Point(384, 124);
+ this.Label15.Name = "Label15";
+ this.Label15.Size = new System.Drawing.Size(28, 13);
+ this.Label15.TabIndex = 61;
+ this.Label15.Text = "Left";
+ //
+ // lbl_anamorphic
+ //
+ this.lbl_anamorphic.AutoSize = true;
+ this.lbl_anamorphic.BackColor = System.Drawing.Color.Transparent;
+ this.lbl_anamorphic.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbl_anamorphic.Location = new System.Drawing.Point(107, 222);
+ this.lbl_anamorphic.Name = "lbl_anamorphic";
+ this.lbl_anamorphic.Size = new System.Drawing.Size(72, 12);
+ this.lbl_anamorphic.TabIndex = 74;
+ this.lbl_anamorphic.Text = "Select a Title";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.BackColor = System.Drawing.Color.Transparent;
+ this.label3.Location = new System.Drawing.Point(13, 221);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(66, 13);
+ this.label3.TabIndex = 73;
+ this.label3.Text = "Anamorphic:";
+ //
+ // PictureSettings
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.Controls.Add(this.lbl_anamorphic);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.check_customCrop);
+ this.Controls.Add(this.check_autoCrop);
+ this.Controls.Add(this.crop_bottom);
+ this.Controls.Add(this.crop_top);
+ this.Controls.Add(this.crop_left);
+ this.Controls.Add(this.crop_right);
+ this.Controls.Add(this.label8);
+ this.Controls.Add(this.Label53);
+ this.Controls.Add(this.Label52);
+ this.Controls.Add(this.Label51);
+ this.Controls.Add(this.Label15);
+ this.Controls.Add(this.check_KeepAR);
+ this.Controls.Add(this.lbl_parHeight);
+ this.Controls.Add(this.txt_parHeight);
+ this.Controls.Add(this.lbl_parWidth);
+ this.Controls.Add(this.txt_parWidth);
+ this.Controls.Add(this.lbl_displayWidth);
+ this.Controls.Add(this.txt_displayWidth);
+ this.Controls.Add(this.lbl_modulus);
+ this.Controls.Add(this.drop_modulus);
+ this.Controls.Add(this.text_height);
+ this.Controls.Add(this.text_width);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.lbl_max);
+ this.Controls.Add(this.lbl_src_res);
+ this.Controls.Add(this.label7);
+ this.Controls.Add(this.label6);
+ this.Controls.Add(this.drp_anamorphic);
+ this.Controls.Add(this.label26);
+ this.Controls.Add(this.lbl_Aspect);
+ this.Controls.Add(this.Label91);
+ this.Controls.Add(this.Label55);
+ this.Name = "PictureSettings";
+ this.Size = new System.Drawing.Size(666, 279);
+ ((System.ComponentModel.ISupportInitialize)(this.text_height)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.text_width)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.crop_bottom)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.crop_top)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.crop_left)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.crop_right)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ internal System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label lbl_max;
+ internal System.Windows.Forms.Label lbl_src_res;
+ internal System.Windows.Forms.Label label7;
+ internal System.Windows.Forms.Label label6;
+ internal System.Windows.Forms.ComboBox drp_anamorphic;
+ internal System.Windows.Forms.Label label26;
+ internal System.Windows.Forms.Label lbl_Aspect;
+ internal System.Windows.Forms.Label Label91;
+ internal System.Windows.Forms.Label Label55;
+ internal System.Windows.Forms.Label lbl_modulus;
+ internal System.Windows.Forms.ComboBox drop_modulus;
+ internal System.Windows.Forms.Label lbl_displayWidth;
+ internal System.Windows.Forms.Label lbl_parWidth;
+ internal System.Windows.Forms.Label lbl_parHeight;
+ internal System.Windows.Forms.RadioButton check_customCrop;
+ internal System.Windows.Forms.RadioButton check_autoCrop;
+ internal System.Windows.Forms.NumericUpDown crop_bottom;
+ internal System.Windows.Forms.NumericUpDown crop_top;
+ internal System.Windows.Forms.NumericUpDown crop_left;
+ internal System.Windows.Forms.NumericUpDown crop_right;
+ internal System.Windows.Forms.Label label8;
+ internal System.Windows.Forms.Label Label53;
+ internal System.Windows.Forms.Label Label52;
+ internal System.Windows.Forms.Label Label51;
+ internal System.Windows.Forms.Label Label15;
+ internal System.Windows.Forms.NumericUpDown text_height;
+ internal System.Windows.Forms.NumericUpDown text_width;
+ internal System.Windows.Forms.TextBox txt_displayWidth;
+ internal System.Windows.Forms.TextBox txt_parWidth;
+ internal System.Windows.Forms.TextBox txt_parHeight;
+ internal System.Windows.Forms.CheckBox check_KeepAR;
+ internal System.Windows.Forms.Label lbl_anamorphic;
+ internal System.Windows.Forms.Label label3;
+
+ }
+}
diff --git a/win/C#/Controls/PictureSettings.cs b/win/C#/Controls/PictureSettings.cs
new file mode 100644
index 000000000..77be0dbc6
--- /dev/null
+++ b/win/C#/Controls/PictureSettings.cs
@@ -0,0 +1,729 @@
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+using Handbrake.Parsing;
+
+namespace Handbrake.Controls
+{
+ /*
+ * ***** WARNING *****
+ * This file is incomplete.
+ * - Custom Anamorphic mode does not work.
+ * - Several Out of bound exceptions on the numeric up down width/height inputs need fixed.
+ * - Code needs cleaned up and a ton of bugs probably need fixed.
+ */
+
+
+
+ /*
+ * DISPLAY WIDTH STORAGE WIDTH PIXEL WIDTH
+ * HEIGHT KEEP ASPECT PIXEL HEIGHT
+ *
+ * --- NOT KEEPING DISPLAY ASPECT ---
+ * Changing STORAGE WIDTH changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT
+ * Changing PIXEL dimensions changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT
+ * Changing DISPLAY WIDTH changes PIXEL WIDTH to DISPLAY WIDTH and PIXEL HEIGHT to STORAGE WIDTH
+ * Changing HEIGHT just....changes the height.
+ *
+ * --- KEEPING DISPLAY ASPECT RATIO ---
+ * DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
+ * Disable editing: PIXEL WIDTH, PIXEL HEIGHT
+ * Changing DISPLAY WIDTH:
+ * Changes HEIGHT to keep DAR
+ * Changes PIXEL WIDTH to new DISPLAY WIDTH
+ * Changes PIXEL HEIGHT to STORAGE WIDTH
+ * Changing HEIGHT
+ * Changes DISPLAY WIDTH to keep DAR
+ * Changes PIXEL WIDTH to new DISPLAY WIDTH
+ * Changes PIXEL HEIGHT to STORAGE WIDTH
+ * Changing STORAGE_WIDTH:
+ * Changes PIXEL WIDTH to DISPLAY WIDTH
+ * Changes PIXEL HEIGHT to new STORAGE WIDTH
+ */
+
+ public partial class PictureSettings : UserControl
+ {
+ // Globals
+ int maxWidth, maxHeight;
+ int widthVal, heightVal;
+ private double darValue;
+ private double storageAspect = 0; // Storage Aspect Cache for current source and title
+ public Title selectedTitle { get; set; }
+ private Boolean heightChangeGuard;
+ private Boolean looseAnamorphicHeightGuard;
+
+ // Window Setup
+ public PictureSettings()
+ {
+ InitializeComponent();
+ lbl_max.Text = "";
+ drop_modulus.SelectedIndex = 0;
+ storageAspect = 0;
+ }
+ public void setComponentsAfterScan(Title st)
+ {
+ storageAspect = 0;
+ selectedTitle = st;
+ // Set the Aspect Ratio
+ lbl_Aspect.Text = selectedTitle.AspectRatio.ToString();
+ lbl_src_res.Text = selectedTitle.Resolution.Width + " x " + selectedTitle.Resolution.Height;
+
+ // Set the Recommended Cropping values
+ crop_top.Text = selectedTitle.AutoCropDimensions[0].ToString();
+ crop_bottom.Text = selectedTitle.AutoCropDimensions[1].ToString();
+ crop_left.Text = selectedTitle.AutoCropDimensions[2].ToString();
+ crop_right.Text = selectedTitle.AutoCropDimensions[3].ToString();
+
+
+ // Set the Resolution Boxes
+ text_width.Value = selectedTitle.Resolution.Width;
+ text_height.Value = cacluateHeight(selectedTitle.Resolution.Width);
+
+ if (drp_anamorphic.SelectedIndex == 3)
+ {
+ txt_parWidth.Text = selectedTitle.ParVal.Width.ToString();
+ txt_parHeight.Text = selectedTitle.ParVal.Height.ToString();
+ txt_displayWidth.Text = displayWidth().ToString();
+ }
+ }
+ public void setMax()
+ {
+ if (maxWidth != 0 && maxHeight != 0)
+ lbl_max.Text = "Max Width / Height";
+ else if (maxWidth != 0)
+ lbl_max.Text = "Max Width";
+ else
+ lbl_max.Text = "";
+ }
+
+ // Basic Picture Setting Controls
+ private void text_width_ValueChanged(object sender, EventArgs e)
+ {
+ // Get the Modulus
+ int mod;
+ int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);
+
+ // Increase or decrease value by the correct mod.
+ text_width.Value = widthChangeMod(mod);
+
+ // Mode Switch
+ switch (drp_anamorphic.SelectedIndex)
+ {
+ case 0:
+ if (calculateUnchangeValue(true) != -1)
+ text_height.Value = calculateUnchangeValue(true);
+ break;
+ case 1:
+ lbl_anamorphic.Text = strictAnamorphic();
+ break;
+ case 2:
+ lbl_anamorphic.Text = looseAnamorphic();
+ break;
+ case 3:
+ customAnamorphic(text_width);
+ break;
+ }
+
+ }
+ private void text_height_ValueChanged(object sender, EventArgs e)
+ {
+ // Get the Modulus
+ int mod;
+ int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);
+
+ // Increase or decrease value by the correct mod.
+ if (drp_anamorphic.SelectedIndex != 2)
+ {
+ decimal val = heightChangeMod(mod);
+ heightChangeGuard = true;
+ if (text_height.Value != val)
+ {
+ heightChangeGuard = false;
+ text_height.Value = val;
+ }
+ }
+
+ // Mode Switch
+ switch (drp_anamorphic.SelectedIndex)
+ {
+ case 0:
+ if (drp_anamorphic.SelectedIndex != 3)
+ {
+ if (calculateUnchangeValue(false) != -1)
+ text_width.Value = calculateUnchangeValue(false);
+ }
+ break;
+ case 1:
+ lbl_anamorphic.Text = strictAnamorphic();
+ break;
+ case 2:
+ if (!looseAnamorphicHeightGuard)
+ lbl_anamorphic.Text = looseAnamorphic();
+ break;
+ case 3:
+ if (!heightChangeGuard)
+ customAnamorphic(text_height);
+ break;
+ }
+ heightChangeGuard = false;
+ looseAnamorphicHeightGuard = false;
+ }
+ private void check_KeepAR_CheckedChanged(object sender, EventArgs e)
+ {
+ // Recalculate Height based on width when enabled
+ if (drp_anamorphic.SelectedIndex != 3 && check_KeepAR.Checked && selectedTitle != null)
+ text_height.Value = cacluateHeight(widthVal);
+
+ // Enable Par Width/Height Check boxes if Keep AR is enabled, otherwise disable them
+ if (check_KeepAR.Checked)
+ {
+ txt_parWidth.Enabled = false;
+ txt_parHeight.Enabled = false;
+ }
+ else
+ {
+ txt_parWidth.Enabled = true;
+ txt_parHeight.Enabled = true;
+ }
+ }
+ private void drp_anamorphic_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ switch (drp_anamorphic.SelectedIndex)
+ {
+ case 0: // None
+ text_height.BackColor = Color.White;
+ text_width.BackColor = Color.White;
+ text_height.Enabled = true;
+ text_width.Enabled = true;
+ check_KeepAR.CheckState = CheckState.Checked;
+ check_KeepAR.Enabled = true;
+ disableCustomAnaControls();
+ text_width.Text = widthVal.ToString();
+ text_height.Text = heightVal.ToString();
+ check_KeepAR.Enabled = true;
+ lbl_anamorphic.Text = "";
+ break;
+ case 1: // Strict
+ text_height.BackColor = Color.LightGray;
+ text_width.BackColor = Color.LightGray;
+ text_height.Text = "";
+ text_width.Text = "";
+ text_height.Enabled = false;
+ text_width.Enabled = false;
+ check_KeepAR.CheckState = CheckState.Unchecked;
+ check_KeepAR.Enabled = false;
+ disableCustomAnaControls();
+ lbl_anamorphic.Text = strictAnamorphic();
+ break;
+ case 2: // Loose
+ storageAspect = 0;
+ text_width.Text = widthVal.ToString();
+ text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
+ text_height.Enabled = false;
+ text_height.BackColor = Color.LightGray;
+ text_width.Enabled = true;
+ text_width.BackColor = Color.White;
+ disableCustomAnaControls();
+ lbl_anamorphic.Text = looseAnamorphic();
+ break;
+ case 3: // Custom
+
+ // Display Elements
+ enableCustomAnaControls();
+ text_height.BackColor = Color.White;
+ text_width.BackColor = Color.White;
+ text_height.Enabled = true;
+ text_width.Enabled = true;
+
+ // Actual Work
+ text_width.Text = widthVal.ToString();
+ text_height.Text = cacluateHeight(widthVal).ToString(); // Bug here
+
+ txt_parWidth.Text = selectedTitle.ParVal.Width.ToString();
+ txt_parHeight.Text = selectedTitle.ParVal.Height.ToString();
+ txt_displayWidth.Text = displayWidth().ToString();
+
+ darValue = calculateDar();
+
+ check_KeepAR.CheckState = CheckState.Checked;
+ check_KeepAR.Enabled = true;
+
+
+ break;
+ }
+ }
+
+ // Custom Anamorphic Controls
+ private void txt_displayWidth_Keyup(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ customAnamorphic(txt_displayWidth);
+ }
+ private void txt_parHeight_Keyup(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ customAnamorphic(txt_parHeight);
+ }
+ private void txt_parWidth_Keyup(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ customAnamorphic(txt_parWidth);
+ }
+
+ // Cropping Control
+ private void check_autoCrop_CheckedChanged(object sender, EventArgs e)
+ {
+ crop_left.Enabled = false;
+ crop_right.Enabled = false;
+ crop_top.Enabled = false;
+ crop_bottom.Enabled = false;
+ }
+ private void check_customCrop_CheckedChanged(object sender, EventArgs e)
+ {
+ crop_left.Enabled = true;
+ crop_right.Enabled = true;
+ crop_top.Enabled = true;
+ crop_bottom.Enabled = true;
+ if (selectedTitle != null)
+ {
+ crop_top.Text = selectedTitle.AutoCropDimensions[0].ToString();
+ crop_bottom.Text = selectedTitle.AutoCropDimensions[1].ToString();
+ crop_left.Text = selectedTitle.AutoCropDimensions[2].ToString();
+ crop_right.Text = selectedTitle.AutoCropDimensions[3].ToString();
+ }
+ else
+ {
+ crop_left.Text = "0";
+ crop_right.Text = "0";
+ crop_top.Text = "0";
+ crop_bottom.Text = "0";
+ }
+ }
+
+ // Custom Anamorphic Code
+ private void customAnamorphic(Control control)
+ {
+ // Get and parse all the required values
+ int cropLeft = (int)crop_left.Value;
+ int cropRight = (int)crop_right.Value;
+
+ int width = (int)text_width.Value;
+ int cropped_width = width - cropLeft - cropRight;
+
+ int mod = 16;
+ int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);
+
+ int parW, parH;
+ double displayWidth;
+ int.TryParse(txt_parWidth.Text, out parW);
+ int.TryParse(txt_parHeight.Text, out parH);
+ double.TryParse(txt_displayWidth.Text, out displayWidth);
+
+ /* NOT KEEPING DISPLAY ASPECT
+ * Changing STORAGE WIDTH changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT
+ * Changing PIXEL dimensions changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT
+ * Changing DISPLAY WIDTH changes PIXEL WIDTH to DISPLAY WIDTH and PIXEL HEIGHT to STORAGE WIDTH
+ * Changing HEIGHT just....changes the height.
+ */
+ if (!check_KeepAR.Checked)
+ {
+ switch (control.Name) // TODO Check if CroppedWidth or just Width
+ {
+ case "text_width":
+ double dw = (double)cropped_width * parW / parH;
+ txt_displayWidth.Text = dw.ToString();
+ break;
+ case "txt_parWidth":
+ double dwpw = (double)cropped_width * parW / parH;
+ txt_displayWidth.Text = dwpw.ToString();
+ break;
+ case "txt_parHeight":
+ double dwph = (double)cropped_width * parW / parH;
+ txt_displayWidth.Text = dwph.ToString();
+ break;
+ case "txt_displayWidth":
+ txt_parWidth.Text = txt_displayWidth.Text;
+ txt_parHeight.Text = text_width.Text;
+ break;
+ }
+ }
+
+ /*
+ * KEEPING DISPLAY ASPECT RATIO
+ * DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
+ * Disable editing: PIXEL WIDTH, PIXEL HEIGHT
+ * Changing DISPLAY WIDTH:
+ * Changes HEIGHT to keep DAR
+ * Changes PIXEL WIDTH to new DISPLAY WIDTH
+ * Changes PIXEL HEIGHT to STORAGE WIDTH
+ * Changing HEIGHT
+ * Changes DISPLAY WIDTH to keep DAR
+ * Changes PIXEL WIDTH to new DISPLAY WIDTH
+ * Changes PIXEL HEIGHT to STORAGE WIDTH
+ * Changing STORAGE_WIDTH:
+ * Changes PIXEL WIDTH to DISPLAY WIDTH
+ * Changes PIXEL HEIGHT to new STORAGE WIDTH
+ */
+
+ if (check_KeepAR.Checked)
+ {
+ switch (control.Name)
+ {
+ case "txt_displayWidth":
+ heightChangeGuard = true;
+ text_height.Value = (decimal)getHeightKeepDar(); //Changes HEIGHT to keep DAR
+ txt_parWidth.Text = txt_displayWidth.Text;
+ txt_parHeight.Text = cropped_width.ToString();
+ break;
+ case "text_height":
+ heightChangeGuard = true;
+ txt_displayWidth.Text = getDisplayWidthKeepDar().ToString(); //Changes DISPLAY WIDTH to keep DAR
+ txt_parWidth.Text = txt_displayWidth.Text;
+ txt_parHeight.Text = cropped_width.ToString();
+ break;
+ case "text_width":
+ txt_parWidth.Text = txt_displayWidth.Text;
+ txt_parHeight.Text = cropped_width.ToString();
+ break;
+ }
+ }
+ }
+ private double getDisplayWidthKeepDar()
+ {
+ double displayWidth;
+ double.TryParse(txt_displayWidth.Text, out displayWidth);
+ double currentDar = calculateDar();
+ double newDwValue = displayWidth;
+
+ // Correct display width up or down to correct for dar.
+ if (currentDar > darValue)
+ {
+ while (currentDar > darValue)
+ {
+ displayWidth--;
+ newDwValue = displayWidth;
+ currentDar = calculateDarByVal(text_height.Value, displayWidth);
+ }
+ }
+ else
+ {
+ while (currentDar < darValue)
+ {
+ displayWidth++;
+ newDwValue = displayWidth;
+ currentDar = calculateDarByVal(text_height.Value, displayWidth);
+ }
+ }
+
+ darValue = calculateDar(); // Cache the dar value
+ return newDwValue;
+ }
+ private double getHeightKeepDar()
+ {
+ double displayWidth;
+ double.TryParse(txt_displayWidth.Text, out displayWidth);
+ double currentDar = calculateDar();
+ double newHeightVal = heightVal;
+
+ // Correct display width up or down.
+ if (currentDar > darValue)
+ {
+ while (currentDar > darValue)
+ {
+ heightVal++;
+ newHeightVal = heightVal;
+ currentDar = calculateDarByVal(heightVal, displayWidth);
+ }
+ }
+ else
+ {
+ while (currentDar < darValue)
+ {
+ heightVal--;
+ newHeightVal = heightVal;
+ currentDar = calculateDarByVal(heightVal, displayWidth);
+ }
+ }
+
+ darValue = calculateDar(); // Cache the dar value
+ return newHeightVal;
+ }
+ private double calculateDar()
+ {
+ // DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
+ int cropTop = (int)crop_top.Value;
+ int cropBottom = (int)crop_bottom.Value;
+ int croppedHeight = (int)text_height.Value - cropTop - cropBottom;
+
+ double displayWidth;
+ double.TryParse(txt_displayWidth.Text, out displayWidth);
+
+ double calculatedDar = displayWidth / croppedHeight;
+
+ return calculatedDar;
+ }
+ private double calculateDarByVal(decimal height, double displayWidth)
+ {
+ // DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
+ int cropTop = (int)crop_top.Value;
+ int cropBottom = (int)crop_bottom.Value;
+ int croppedHeight = (int)height - cropTop - cropBottom;
+
+ double calculatedDar = darValue;
+ if (croppedHeight > 0)
+ calculatedDar = displayWidth / croppedHeight;
+
+ return calculatedDar;
+ }
+ private int displayWidth()
+ {
+ if (selectedTitle != null)
+ {
+ int actualWidth = (int)text_width.Value;
+ int displayWidth = 0;
+ int parW, parH;
+
+ int.TryParse(txt_parWidth.Text, out parW);
+ int.TryParse(txt_parHeight.Text, out parH);
+
+ if (drp_anamorphic.SelectedIndex != 3)
+ displayWidth = (actualWidth * selectedTitle.ParVal.Width / selectedTitle.ParVal.Height);
+ else if (parW > 0 && parH > 0)
+ displayWidth = (actualWidth * parW / parH);
+
+ return displayWidth;
+ }
+ return -1;
+ }
+
+ // Resolution calculation and controls
+ private decimal widthChangeMod(int mod)
+ {
+ // Increase or decrease the height based on the users input.
+ decimal returnVal = text_width.Value > widthVal ? getResolutionJump(mod, text_width.Value, true) : getResolutionJump(mod, text_width.Value, false);
+
+ // Make sure we don't go above source value
+ if (selectedTitle != null)
+ if (selectedTitle.Resolution.Width < returnVal)
+ returnVal = selectedTitle.Resolution.Width;
+
+ // Set the global tracker
+ widthVal = (int)returnVal;
+
+ return returnVal;
+ }
+ private decimal heightChangeMod(int mod)
+ {
+ // Increase or decrease the height based on the users input.
+ decimal returnVal = text_height.Value > heightVal ? getResolutionJump(mod, text_height.Value, true) : getResolutionJump(mod, text_height.Value, false);
+
+ // Make sure we don't go above source value
+ if (selectedTitle != null)
+ if (selectedTitle.Resolution.Height < returnVal)
+ returnVal = selectedTitle.Resolution.Height;
+
+ // Set the global tracker
+ heightVal = (int)returnVal; // TODO THIS IS CAUSING PROBLEM
+
+ return returnVal;
+ }
+ private decimal calculateUnchangeValue(Boolean widthChangeFromControl)
+ {
+ decimal newValue = -1;
+ if (selectedTitle != null && drp_anamorphic.SelectedIndex != 3 && drp_anamorphic.SelectedIndex != 2)
+ if (widthChangeFromControl)
+ newValue = cacluateHeight(widthVal);
+ else
+ {
+ if (check_KeepAR.Checked)
+ newValue = cacluateWidth(heightVal);
+ }
+
+ return newValue;
+ }
+ private int getResolutionJump(int mod, decimal value, Boolean up)
+ {
+ if (up)
+ while ((value % mod) != 0)
+ value++;
+ else
+ while ((value % mod) != 0)
+ value--;
+
+ return (int)value;
+ }
+ private double getModulusAuto(int mod, double value)
+ {
+ int modDiv2 = mod / 2;
+
+ if ((value % mod) != 0)
+ {
+ double modVal = (int)value % mod;
+ if (modVal >= modDiv2)
+ {
+ modVal = 16 - modVal;
+ value = (int)value + (int)modVal;
+ }
+ else
+ {
+ value = (int)value - (int)modVal;
+ }
+ }
+ return value;
+ }
+ private int cacluateHeight(int width)
+ {
+ int aw = 0;
+ int ah = 0;
+ if (selectedTitle.AspectRatio.ToString() == "1.78")
+ {
+ aw = 16;
+ ah = 9;
+ }
+ else if (selectedTitle.AspectRatio.ToString() == "1.33")
+ {
+ aw = 4;
+ ah = 3;
+ }
+
+ if (aw != 0)
+ {
+ // Crop_Width = Title->Width - crop_Left - crop_right
+ // Crop_Height = Title->Height - crop_top - crop_bottom
+ double crop_width = selectedTitle.Resolution.Width - (double)crop_left.Value - (double)crop_right.Value;
+ double crop_height = selectedTitle.Resolution.Height - (double)crop_top.Value - (double)crop_bottom.Value;
+
+ double new_height = (width * selectedTitle.Resolution.Width * ah * crop_height) /
+ (selectedTitle.Resolution.Height * aw * crop_width);
+
+ if (drp_anamorphic.SelectedIndex == 3)
+ new_height = getModulusAuto(int.Parse(drop_modulus.SelectedItem.ToString()), new_height);
+ else
+ new_height = getModulusAuto(16, new_height);
+
+ //16 * (421 / 16)
+ //double z = ( 16 * (( y + 8 ) / 16 ) );
+ int x = int.Parse(new_height.ToString());
+ if (x < 64)
+ x = 64;
+ return x;
+ }
+ return 0;
+ }
+ private int cacluateWidth(int height)
+ {
+ int aw = 0;
+ int ah = 0;
+ if (selectedTitle.AspectRatio.ToString() == "1.78")
+ {
+ aw = 16;
+ ah = 9;
+ }
+ else if (selectedTitle.AspectRatio.ToString() == "1.33")
+ {
+ aw = 4;
+ ah = 3;
+ }
+
+ if (aw != 0)
+ {
+
+ double crop_width = selectedTitle.Resolution.Width - (double)crop_left.Value - (double)crop_right.Value;
+ double crop_height = selectedTitle.Resolution.Height - (double)crop_top.Value - (double)crop_bottom.Value;
+
+ double new_width = (height * selectedTitle.Resolution.Height * aw * crop_width) /
+ (selectedTitle.Resolution.Width * ah * crop_height);
+
+ if (drp_anamorphic.SelectedIndex == 3)
+ new_width = getModulusAuto(int.Parse(drop_modulus.SelectedItem.ToString()), new_width);
+ else
+ new_width = getModulusAuto(16, new_width);
+
+ //16 * (421 / 16)
+ //double z = ( 16 * (( y + 8 ) / 16 ) );
+ int x = int.Parse(new_width.ToString());
+ return x;
+ }
+ return 0;
+ }
+
+ // Calculate Resolution for Anamorphic functions
+ private string strictAnamorphic()
+ {
+ // TODO Make sure cropping is Mod2
+ if (selectedTitle != null)
+ {
+ // Calculate the Actual Height
+ int actualWidth = (int)text_width.Value - (int)crop_left.Value - (int)crop_right.Value; ;
+ int actualHeight = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
+ if (drp_anamorphic.SelectedIndex == 2)
+ actualHeight = (int)getModulusAuto(16, actualHeight);
+
+ // Calculate Actual Width
+ double displayWidth = ((double)actualWidth * selectedTitle.ParVal.Width / selectedTitle.ParVal.Height);
+ return Math.Round(displayWidth, 0) + "x" + actualHeight;
+ }
+ return "Select a Title";
+ }
+ private string looseAnamorphic()
+ {
+ if (selectedTitle != null)
+ {
+ // Get some values
+ int actualWidth = (int)text_width.Value - (int)crop_left.Value - (int)crop_right.Value;
+
+ int source_display_width = selectedTitle.Resolution.Width * selectedTitle.ParVal.Width / selectedTitle.ParVal.Height;
+ int source_cropped_height = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
+
+ // Calculate storage Aspect and cache it for reuse
+ if (storageAspect == 0)
+ storageAspect = (double)actualWidth / source_cropped_height;
+
+ // Calculate the new height based on the input cropped width
+ double hcalc = actualWidth / storageAspect;
+ double newHeight = getModulusAuto(16, hcalc);
+ looseAnamorphicHeightGuard = true;
+ text_height.Value = (decimal)newHeight; // BUG Out of Range Exception with Width too low here.
+
+ // Calculate the anamorphic width
+ double parW = newHeight * source_display_width / source_cropped_height;
+ double parH = actualWidth;
+ double displayWidth = (actualWidth * parW / parH);
+
+ // Now correct DisplayWidth to maintain Aspect ratio. ActualHeight was mod16'd and thus AR is slightly different than the worked out displayWidths
+ return Math.Round(displayWidth, 0) + "x" + newHeight;
+ }
+ return "Select a Title";
+
+ }
+
+ // GUI
+ private void disableCustomAnaControls()
+ {
+ // Disable Custom Anamorphic Stuff
+ lbl_modulus.Visible = false;
+ lbl_displayWidth.Visible = false;
+ lbl_parWidth.Visible = false;
+ lbl_parHeight.Visible = false;
+ drop_modulus.Visible = false;
+ txt_displayWidth.Visible = false;
+ txt_parWidth.Visible = false;
+ txt_parHeight.Visible = false;
+ check_KeepAR.Enabled = false;
+ }
+ private void enableCustomAnaControls()
+ {
+ // Disable Custom Anamorphic Stuff
+ lbl_modulus.Visible = true;
+ lbl_displayWidth.Visible = true;
+ lbl_parWidth.Visible = true;
+ lbl_parHeight.Visible = true;
+ drop_modulus.Visible = true;
+ txt_displayWidth.Visible = true;
+ txt_parWidth.Visible = true;
+ txt_parHeight.Visible = true;
+ check_KeepAR.Enabled = true;
+ }
+
+ }
+} \ No newline at end of file
diff --git a/win/C#/Controls/PictureSettings.resx b/win/C#/Controls/PictureSettings.resx
new file mode 100644
index 000000000..ff31a6db5
--- /dev/null
+++ b/win/C#/Controls/PictureSettings.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file