[Beamer] - Add 'Right' aligment.

This commit is contained in:
Ivandro Ismael 2016-05-14 02:35:37 +01:00
parent ab381d4fe2
commit 0ef735e290
No known key found for this signature in database
GPG Key ID: A8832757DEFB7EDC
2 changed files with 13 additions and 4 deletions

View File

@ -79,7 +79,8 @@
this.comboBoxHAlign.FormattingEnabled = true;
this.comboBoxHAlign.Items.AddRange(new object[] {
"Left",
"Center"});
"Center",
"Right"});
this.comboBoxHAlign.Location = new System.Drawing.Point(100, 78);
this.comboBoxHAlign.Name = "comboBoxHAlign";
this.comboBoxHAlign.Size = new System.Drawing.Size(121, 21);

View File

@ -145,10 +145,18 @@ namespace Nikse.SubtitleEdit.Forms
}
var bmp = GenerateImageFromTextWithStyle(text);
pictureBox1.Top = groupBoxImageSettings.Top + groupBoxImageSettings.Height + 5;
pictureBox1.Left = 5;
if (comboBoxHAlign.SelectedIndex == 1) // center
// Aligment direction.
switch (comboBoxHAlign.SelectedIndex)
{
case 0: // Left.
pictureBox1.Left = 5;
break;
case 1: // Center.
pictureBox1.Left = ((groupBoxImageSettings.Width - bmp.Width) / 2);
break;
case 2: // Right.
pictureBox1.Left = groupBoxImageSettings.Width - bmp.Width;
break;
}
pictureBox1.Image = bmp;
pictureBox1.Height = bmp.Height;