Neue Testversion 20.40b12

Hier diskutieren die Betatester von PhotoLine untereinander und mit den Entwicklern
Benutzeravatar
photoken
Mitglied
Beiträge: 2162
Registriert: Sa 28 Sep 2013 01:25

Fixed: View 100% distorts text layer created by AddIn

Beitrag von photoken »

Win10 1607 x64
PL 20.40b12 x64

I have an AddIn, compiled as an executable (.EXE), that creates a text layer. When PL is first started, and the AddIn is run, the lines of text are distorted when the image is viewed at 100%:
view 100.jpg
view 100.jpg (51.88 KiB) 3203 mal betrachtet
If I change the View to another percentage, or export the image, the text lines look correct:
alt view.jpg
alt view.jpg (51.64 KiB) 3203 mal betrachtet
If I select the Text tool, and change the font, then after running the AddIn again the text looks correct at 100%.

The AddIn has a GUI form that contains one textbox (textBox1) and one button (OKbutton). In case the problem is with the AddIn code, here's the complete content of the Form1.cs (C#) file that creates the text layer:

Code: Alles auswählen

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HelloWorld {
	public partial class Form1 : Form {
		public Form1() {
		
			InitializeComponent();

			// Initialize a ResourceManager to retrieve localized strings.
			ResourceManager locRM = new ResourceManager("HelloWorld.Resource1", typeof(Form1).Assembly);

			// Populate the text box with either the default text or the saved user's text.
			if (Properties.Settings.Default.UserText == null || Properties.Settings.Default.UserText == "") {
				textBox1.Text = locRM.GetString("DefaultText");
			} else {
				textBox1.Text = Properties.Settings.Default.UserText;
			}
		}

		/// <summary>
		/// Create a text layer with the specified content and formatting.
		/// </summary>
		/// <param name="doc">The active document/image.</param>
		/// <param name="selectedlayer">The selected layer.</param>
		public void CreateTextLayer(PhotoLine.document doc, PhotoLine.layer selectedlayer) {

			// Initialize the arrays and variables that will be needed.
			int[] charrange = new int[] { 0, 1 };
			int[] RGBvalue = new int[] { 255, 255, 255 };
			string testtext;

			// Initialize the new text layer.
			PhotoLine.Text targetlayer = new PhotoLine.Text();

			// Get the text in the textbox.
			testtext = textBox1.Text;

			// Create the font attributes object.
			PhotoLine.Dictionary fontAttribute = new PhotoLine.Dictionary();
			fontAttribute.Add("FamilyName", "Arial");
			fontAttribute.Add("Size", 72);
			fontAttribute.Add("Weight", 700);

			// Create the paragraph attributes object.
			PhotoLine.Dictionary paragraphObject = new PhotoLine.Dictionary();
			paragraphObject.Add("Alignment", PhotoLine.ParagraphAlignment.PACenter);
			paragraphObject.Add("FixLine", true);
			paragraphObject.Add("Line", 50);

			// Set text of the new layer and the range of text characters that will be affected.
			targetlayer.Text = testtext;
			charrange[1] = targetlayer.TextLength;

			// Apply the paragraph and font attributes to the affected text characters.
			targetlayer.SetAttribute(charrange, "Paragraph", paragraphObject);
			targetlayer.SetAttribute(charrange, "Color", RGBvalue);
			targetlayer.SetAttribute(charrange, "Font", fontAttribute);

			// Set the vertical alignment of the text layer's content.
			targetlayer.VerticalAlignment = PhotoLine.TextVerticalAlignment.TVACenter;

			// Name the new text layer, size it to the document size and create the text layer.
			targetlayer.Name = "C# Add-In";
			targetlayer.Size = doc.Size;
			selectedlayer.Parent.Insert(targetlayer, selectedlayer);
		}

		/// <summary>
		/// Close the AddIn.
		/// </summary>
		public static void CloseAddIn() {
			Form1.ActiveForm.Dispose();
		}

		private void OKbutton_Click(object sender, EventArgs e) {

			PhotoLine.Application app = new PhotoLine.Application();

			if (app != null) {
				PhotoLine.document doc = app.ActiveDocument;

				if (doc != null) {
					PhotoLine.layer selectedlayer = (PhotoLine.layer)doc.ActivePage.ActiveLayer;

					if (selectedlayer != null) {
						try {
							CreateTextLayer(doc, selectedlayer);
						} catch (Exception appe) {
							MessageBox.Show(appe.InnerException.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
							throw;
						} finally {
							// Save the user's text and close the AddIn.
							Properties.Settings.Default.UserText = textBox1.Text;
							Properties.Settings.Default.Save();
							CloseAddIn();
						}
					}
				}
			}
		}
	}
}
Also, I notice that the text lines are not centered vertically -- there is more space below the text.
Zuletzt geändert von photoken am Mi 09 Aug 2017 01:54, insgesamt 1-mal geändert.
Ken
Yes, I think it can be eeeeeasily done....
Just take everything out on Highway 61.
Martin Huber
Entwickler
Entwickler
Beiträge: 4158
Registriert: Di 19 Nov 2002 15:49

Re: Prob: View 100% distorts text layer created by AddIn

Beitrag von Martin Huber »

photoken hat geschrieben: Mo 31 Jul 2017 03:12 I have an AddIn, compiled as an executable (.EXE), that creates a text layer. When PL is first started, and the AddIn is run, the lines of text are distorted when the image is viewed at 100%: (...)
There are two minor problems, that will be fixed in the next version (a missing redraw and fonts are not updated correctly).
photoken hat geschrieben: Mo 31 Jul 2017 03:12(...) here's the complete content of the Form1.cs (C#) file that creates the text layer:
A small note: colors are usually single precision floats with a default range of [0;1].
photoken hat geschrieben: Mo 31 Jul 2017 03:12Also, I notice that the text lines are not centered vertically -- there is more space below the text.
I think, that is because of the descenders (or missing descenders in your text). Maybe it is reasonable to ignore the descenders of the last line, because the visual weight of descenders is usually quite low.

Martin
Benutzeravatar
photoken
Mitglied
Beiträge: 2162
Registriert: Sa 28 Sep 2013 01:25

Re: Prob: View 100% distorts text layer created by AddIn

Beitrag von photoken »

Martin Huber hat geschrieben: Mo 31 Jul 2017 11:10 A small note: colors are usually single precision floats with a default range of [0;1].
Hmmmm....
It's easier for me to imagine the colour when thinking in terms of RGB values.
Also, it's easier for me to get a neutral gray:
int[] RGBvalue = new int[] { 90, 90, 90};
or a slightly bluish gray:
int[] RGBvalue = new int[] { 90, 90, 110};
Martin Huber hat geschrieben: Mo 31 Jul 2017 11:10
photoken hat geschrieben: Mo 31 Jul 2017 03:12Also, I notice that the text lines are not centered vertically -- there is more space below the text.
I think, that is because of the descenders (or missing descenders in your text). Maybe it is reasonable to ignore the descenders of the last line, because the visual weight of descenders is usually quite low.
Yes, I had not thought of the descenders. That sounds like a reasonable solution, and if the result is obviously "bad" one can always Optimize the text layer size and use the Layer tool to center that optimized text layer horizontally and vertically.
Ken
Yes, I think it can be eeeeeasily done....
Just take everything out on Highway 61.
Martin Huber
Entwickler
Entwickler
Beiträge: 4158
Registriert: Di 19 Nov 2002 15:49

Re: Prob: View 100% distorts text layer created by AddIn

Beitrag von Martin Huber »

photoken hat geschrieben: Di 01 Aug 2017 01:38
Martin Huber hat geschrieben: Mo 31 Jul 2017 11:10 A small note: colors are usually single precision floats with a default range of [0;1].
Hmmmm....
It's easier for me to imagine the colour when thinking in terms of RGB values.
Also, it's easier for me to get a neutral gray:
int[] RGBvalue = new int[] { 90, 90, 90};
or a slightly bluish gray:
int[] RGBvalue = new int[] { 90, 90, 110};
Floats in the range [0;1] have a some of advantages:
- You can easily define HDR values.
- Compared to ints, with floats you can declare nearly any brightness value.

And if you really cant get used to float, you should be able to write:
single[] RGBvalue = new single[] { 90/255, 90/255, 90/255};

Martin
Ashcraaft
Mitglied
Beiträge: 487
Registriert: Fr 26 Nov 2010 10:39
Wohnort: Kempen
Kontaktdaten:

Re: Neue Testversion 20.40b12

Beitrag von Ashcraaft »

Kann grad mal bitte jemand schauen, ob in der aktuellen PL-Version oder auch in der BETA 20.40 ein Finder-Preview für PLD-Dateien angezeigt wird?

Bei mir unter OS Sierra 10.12.6 kommt nur ein anwendungsspezifisches Dokument-Icon :?
Bitte besuche & teile PhotoLine auf folgenden Seiten:
PhotoLine bei Facebook | YouTube

Danke, Sascha Ballweg
(Photoline-Nutzung: Mac OS-X & Windows 10)
bkh
Betatester
Beiträge: 3674
Registriert: Do 26 Nov 2009 22:59

Re: Neue Testversion 20.40b12

Beitrag von bkh »

Ashcraaft hat geschrieben: Do 03 Aug 2017 12:05 Kann grad mal bitte jemand schauen, ob in der aktuellen PL-Version oder auch in der BETA 20.40 ein Finder-Preview für PLD-Dateien angezeigt wird?

Bei mir unter OS Sierra 10.12.6 kommt nur ein anwendungsspezifisches Dokument-Icon :?
Mit OS X 10.11.6 bekomme ich mit Finder -> Get Info, in der Icon-Ansicht und per QuickView (Leertaste) Vorschauen. Nur in der Listenansicht sehe ich links vom Dateinamen nur ein allgemeines Icon (was ich auch nicht weiter schlimm finde).

L.G.

Burkhard.
Martin Huber
Entwickler
Entwickler
Beiträge: 4158
Registriert: Di 19 Nov 2002 15:49

Re: Neue Testversion 20.40b12

Beitrag von Martin Huber »

bkh hat geschrieben: Do 03 Aug 2017 15:47
Ashcraaft hat geschrieben: Do 03 Aug 2017 12:05 Kann grad mal bitte jemand schauen, ob in der aktuellen PL-Version oder auch in der BETA 20.40 ein Finder-Preview für PLD-Dateien angezeigt wird?

Bei mir unter OS Sierra 10.12.6 kommt nur ein anwendungsspezifisches Dokument-Icon :?
Mit OS X 10.11.6 bekomme ich mit Finder -> Get Info, in der Icon-Ansicht und per QuickView (Leertaste) Vorschauen. Nur in der Listenansicht sehe ich links vom Dateinamen nur ein allgemeines Icon (was ich auch nicht weiter schlimm finde).
Bei mir ist es unter 10.12.6 wie bei Burkhard.

Martin
Ashcraaft
Mitglied
Beiträge: 487
Registriert: Fr 26 Nov 2010 10:39
Wohnort: Kempen
Kontaktdaten:

Re: Neue Testversion 20.40b12

Beitrag von Ashcraaft »

Martin Huber hat geschrieben: Do 03 Aug 2017 17:06 Bei mir ist es unter 10.12.6 wie bei Burkhard.
Irgendeine Idee, warum die Dokumente im Finder per Quickview nicht angezeigt werden?
Bitte besuche & teile PhotoLine auf folgenden Seiten:
PhotoLine bei Facebook | YouTube

Danke, Sascha Ballweg
(Photoline-Nutzung: Mac OS-X & Windows 10)
bkh
Betatester
Beiträge: 3674
Registriert: Do 26 Nov 2009 22:59

Re: Neue Testversion 20.40b12

Beitrag von bkh »

Ashcraaft hat geschrieben: Do 03 Aug 2017 17:08
Martin Huber hat geschrieben: Do 03 Aug 2017 17:06 Bei mir ist es unter 10.12.6 wie bei Burkhard.
Irgendeine Idee, warum die Dokumente im Finder per Quickview nicht angezeigt werden?
Ich habe gerade gesehen, dass einige plds auch bei mir keine Vorschau haben. Es scheinen durchweg ältere Dateien (2013 und davor) zu sein. Wenn ich sie mit PL 20.02 oder der aktuellen Beta neu speichere, erscheint dann auch die Vorschau.

Bei Interesse kann ich eine Beispieldatei an support mailen.

L.G.

Burkhard.
Benutzeravatar
photoken
Mitglied
Beiträge: 2162
Registriert: Sa 28 Sep 2013 01:25

PL dialog components as VS toolbox items?

Beitrag von photoken »

I don't know if this can be done, but I'll ask anyway:

Would it be possible to supply the components of a PL dialog window as VS toolbox items?

For example:
  • An empty dialog window (which would automatically inherit the user's UI colour scheme)
  • Slider
  • Spinbox
  • Combobox
  • Entry field
  • Before/After panel
  • Preview button
  • OK button
  • Cancel button
  • Adjustment layer button
  • General purpose button
I'm looking for a solution which would relieve me of the burden of coding the "plumbing" -- things like previewing, and undoing when the dialog is cancelled, etc.
Ken
Yes, I think it can be eeeeeasily done....
Just take everything out on Highway 61.
Martin Huber
Entwickler
Entwickler
Beiträge: 4158
Registriert: Di 19 Nov 2002 15:49

Re: Neue Testversion 20.40b12

Beitrag von Martin Huber »

bkh hat geschrieben: Do 03 Aug 2017 18:32 Ich habe gerade gesehen, dass einige plds auch bei mir keine Vorschau haben. Es scheinen durchweg ältere Dateien (2013 und davor) zu sein.
Ich habe nun bei mir gesucht und auch ein paar gefunden. Es sind wie bei dir durchgängig ältere Dateien.

Seltsamerweise funktioniert die Vorschau mit unserem Quicklook-Plug-In, wenn ich es im Debugger teste. Ich vermute, es hängt mit dem Wechsel der Dateityp-UTI zusammen, die wir mal vorgenommen haben (von "com.computerinsel.pld" auf "de.pl32.pld"). Ich habe dem Quicklook-Plug-In daher nun beide UTIs zugewiesen, aber das hatte keine Auswirkung. Das mag aber daran liegen, dass ich hier Dutzende PhotoLines mit ebensovielen Quicklook-Plug-Ins habe und es daher kaum möglich ist, macOS dazu zu zwingen, die neue Version zu verwenden.

Martin
Martin Huber
Entwickler
Entwickler
Beiträge: 4158
Registriert: Di 19 Nov 2002 15:49

Re: PL dialog components as VS toolbox items?

Beitrag von Martin Huber »

photoken hat geschrieben: Fr 04 Aug 2017 07:12Would it be possible to supply the components of a PL dialog window as VS toolbox items?
No, this would be too much work.

Martin
Ashcraaft
Mitglied
Beiträge: 487
Registriert: Fr 26 Nov 2010 10:39
Wohnort: Kempen
Kontaktdaten:

Re: Neue Testversion 20.40b12

Beitrag von Ashcraaft »

bkh hat geschrieben: Do 03 Aug 2017 18:32 Ich habe gerade gesehen, dass einige plds auch bei mir keine Vorschau haben. Es scheinen durchweg ältere Dateien (2013 und davor) zu sein. Wenn ich sie mit PL 20.02 oder der aktuellen Beta neu speichere, erscheint dann auch die Vorschau.
Hier ebenfalls geprüft. Eine Vorschau von 2013-03 hatte keine Finder-Vorschau, wohingegen eine von 2013-10 bereits eine hatte. Der Wechsel scheint also Mitte 2013 stattgefunden zu haben.

Wenn man weiß, dass man die Dateien neu abspeichern muss ist das natürlich schnell getan (und eröffnet gleich auch die Möglichkeit sich von altem Mist zu trennen :D ) DANKE
Bitte besuche & teile PhotoLine auf folgenden Seiten:
PhotoLine bei Facebook | YouTube

Danke, Sascha Ballweg
(Photoline-Nutzung: Mac OS-X & Windows 10)
evren
Mitglied
Beiträge: 140
Registriert: Mi 04 Dez 2013 05:48
Kontaktdaten:

PDF opening with wrong colors

Beitrag von evren »

Whats wrong with this PDF file? PDF viewer or chrome displays correct but editor opens all in orange.

http://www.evrencomert.com/logo.pdf
Benutzeravatar
photoken
Mitglied
Beiträge: 2162
Registriert: Sa 28 Sep 2013 01:25

English translation needed

Beitrag von photoken »

blur dialog.png
blur dialog.png (13.49 KiB) 3050 mal betrachtet
Ken
Yes, I think it can be eeeeeasily done....
Just take everything out on Highway 61.
Antworten