Popular Post xod Posted January 14, 2017 Popular Post Share Posted January 14, 2017 (edited) A very simple plugin to render clock. Clock.zip Spoiler Edited February 5, 2017 by xod 1 9 Quote Link to comment Share on other sites More sharing options...
Eli Posted January 14, 2017 Share Posted January 14, 2017 Thank you xod, This is a cool clock maker. May I suggest an option for different colors for the hour and minute handles. Quote Link to comment Share on other sites More sharing options...
xod Posted January 14, 2017 Author Share Posted January 14, 2017 Thanks Eli. I think the GUI is already quite high. Adding two color wheels would make GUI more bigger. Quote Link to comment Share on other sites More sharing options...
Eli Posted January 14, 2017 Share Posted January 14, 2017 (edited) I asked that because when the handles overlap it is hard to read the hour. Perhaps an outline? EDIT: One more thing : Increase the font size. If I use it on a very large canvas, the font size 40 is not large enough. Edited January 14, 2017 by Eli Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted January 14, 2017 Share Posted January 14, 2017 The 'Century Gothic' font is provided by MS Office. People who don't have Office installed will not be able to use this plugin. Spoiler C:\Program Files\paint.net\Effects\Clock.dll, version 1.0.6223.26977 Name: Clock Type: ClockEffect.ClockEffectPlugin Version: 1.0.6223.26977 Author: Copyright © xod Copyright: Render the clock. Website: http://www.getpaint.net/redirect/plugins.html System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Font 'Century Gothic' cannot be found. at System.Drawing.FontFamily.CreateFontFamily(String name, FontCollection fontCollection) at ClockEffect.ClockEffectPlugin..ctor() --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at PaintDotNet.Menus.EffectMenuBase.AddEffectsToMenu() in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 602 You'll want to use an alternative default font, or have a fallback font for when 'Century Gothic' fails. 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
xod Posted January 14, 2017 Author Share Posted January 14, 2017 (edited) @Eli: Font size increased to 100. Download the new version. @toe_head: For me, on Win10, when the plugin starts, it automatically chooses the first font in the list of installed fonts - one that starts with the letter A (Arial in most cases). Edited January 14, 2017 by xod Quote Link to comment Share on other sites More sharing options...
Eli Posted January 14, 2017 Share Posted January 14, 2017 (edited) @xod, The Font size is good now. I do not know if possible but an option to render longer handles that cover or touch the numbers Spoiler Edited January 14, 2017 by Eli Quote Link to comment Share on other sites More sharing options...
IRON67 Posted January 14, 2017 Share Posted January 14, 2017 (edited) Doesn't work for me. Spoiler C:\Program Files\Paint.NET4\Effects\Clock.dll, Version 1.0.6223.29215 Name: Clock Typ: ClockEffect.ClockEffectPlugin Version: 1.0.6223.29215 Autor: Copyright © xod Copyright: Render the clock. Webseite: http://www.getpaint.net/redirect/plugins.html System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.ArgumentException: Die Schriftart Century Gothic kann nicht gefunden werden. bei System.Drawing.FontFamily.CreateFontFamily(String name, FontCollection fontCollection) bei ClockEffect.ClockEffectPlugin..ctor() --- Ende der internen Ausnahmestapelüberwachung --- bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) bei System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) bei PaintDotNet.Menus.EffectMenuBase.AddEffectsToMenu() in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:Zeile 602. I don't have that font. A standard like Arial would be better. Edited January 14, 2017 by IRON67 Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted January 14, 2017 Share Posted January 14, 2017 2 hours ago, xod said: ... when the plugin starts, it automatically chooses the first font in the list of installed fonts - one that starts with the letter A (Arial in most cases). Yes, but you have the FontFamily value initialized as 'Century Gothic', so that is what's used in the Render until the UI loads (the time span here is just a few milliseconds). Once the UI has loaded, the EffectToken updates (which includes the new value for the FontFamily... usually 'Arial'), and the Render is restarted. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
xod Posted January 14, 2017 Author Share Posted January 14, 2017 I made the changes specified by Eli and toe_head2001. See first post. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 14, 2017 Share Posted January 14, 2017 I like this xod! Well done. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
dipstick Posted January 14, 2017 Share Posted January 14, 2017 The updated version still doesn't work for me. Maybe force Arial instead? Quote Link to comment Share on other sites More sharing options...
Eli Posted January 14, 2017 Share Posted January 14, 2017 Thanks Again Xod, I enhanced the results with some shadows and bevels. I also changed the colors of the handles by selecting each one separately and using color adjustments. Spoiler I like the longer handles but some people may prefer short ones as the ones on your first post. Maybe you can add a "shorter indicators" option to keep them. As you see, having different colors for the handles is also very nice and more readable. Maybe using a GUI with tabs could make it possible ( It is easy to say for me but I know that it could mean a great effort) 6 Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted January 14, 2017 Share Posted January 14, 2017 1 hour ago, dipstick said: The updated version still doesn't work for me. That's a different issue from before. @xod, to fix this one properly, you'd have to migrate from CodeLab to Visual Studio. Currently, all installed fonts on the system are being made available to the plugin UI. The code looks like this: FontFamily[] Amount4FontFamilies = new InstalledFontCollection().Families; props.Add(new StaticListChoiceProperty(PropertyNames.Amount4, Amount4FontFamilies, 0, false)); You need to filter out the incompatible fonts. Something like this: FontFamily[] intstalledFontFamilies = new InstalledFontCollection().Families; List<FontFamily> usableFonts = new List<FontFamily>(); foreach (FontFamily font in intstalledFontFamilies) { if (font.IsStyleAvailable(FontStyle.Regular)) usableFonts.Add(font); } FontFamily[] Amount4FontFamilies = usableFonts.ToArray(); props.Add(new StaticListChoiceProperty(PropertyNames.Amount4, Amount4FontFamilies, 0, false)); 2 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
IRON67 Posted January 15, 2017 Share Posted January 15, 2017 Thanks for new version. Now it works. Quote Link to comment Share on other sites More sharing options...
Seerose Posted January 15, 2017 Share Posted January 15, 2017 (edited) Dear Xod! Thank you so much for the plugin and for your effort. Edited April 19, 2018 by Seerose 5 Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
Pixey Posted January 15, 2017 Share Posted January 15, 2017 Bravo @XOD - what a wonderful Plugin you have created. Many thanks . 5 Quote How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon. Link to comment Share on other sites More sharing options...
xod Posted January 15, 2017 Author Share Posted January 15, 2017 Thanks to all who have appreciated my work. I am convinced that someone else could do the work much better because I'm just a beginner in C #. If someone wants to make another plugin is my guest and I will remove my plugin. I do not know how to port the code to Visual Studio. I have not found any detailed explanation about this except one of EER from VS2010. I think it would be useful to make a post for explaining in detail with screenshots for those who don't know english very well. 1 Quote Link to comment Share on other sites More sharing options...
BoltBait Posted January 15, 2017 Share Posted January 15, 2017 15 minutes ago, xod said: I do not know how to port the code to Visual Studio. http://boltbait.com/pdn/codelab/help/tutorial5.asp 1 Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
dipstick Posted January 15, 2017 Share Posted January 15, 2017 14 minutes ago, xod said: Thanks to all who have appreciated my work. I am convinced that someone else could do the work much better because I'm just a beginner in C #. If someone wants to make another plugin is my guest and I will remove my plugin. I do not know how to port the code to Visual Studio. I have not found any detailed explanation about this except one of EER from VS2010. I think it would be useful to make a post for explaining in detail with screenshots for those who don't know english very well. Don't worry about it. If I wanted to make a clock, I would likely make it by hand manually anyway. Most people would probably be able to use your plugin the way it is anyway..... Quote Link to comment Share on other sites More sharing options...
sashwilko Posted January 15, 2017 Share Posted January 15, 2017 How do you add numbers ? I don't see this option in the GUI. Quote Link to comment Share on other sites More sharing options...
xod Posted January 15, 2017 Author Share Posted January 15, 2017 (edited) @BoltBait, I have some question: Because it's a Class Library file and not an exe file the code can not be run in VS. Correct? But if I make the GUI and the code in VS how to transform the exe file to dll file that can be run in paint.net? What should I do besides adding references to PDN and transform Windows Form App to Class Library? @sashwilko Change the Font color (white) to another one. I added an option for digital clock. You must install the font found in the zip archive. Spoiler Edited January 15, 2017 by xod 1 Quote Link to comment Share on other sites More sharing options...
BoltBait Posted January 15, 2017 Share Posted January 15, 2017 11 minutes ago, xod said: Because it's a Class Library file and not an exe file the code can not be run in VS. Correct? That's right. You'll need to compile, then copy the dll file into the proper paint.net directory in order to test. 11 minutes ago, xod said: But if I make the GUI and the code in VS how to transform the exe file to dll file that can be run in paint.net? Just follow the instructions in the tutorial I posted above and the output of VS will be DLL and not EXE. 11 minutes ago, xod said: What should I do besides adding references to PDN and transform Windows Form App to Class Library? All the instructions are given in the tutorial for moving a CodeLab script to a VS project. Those instructions will NOT change your project into something that can use a custom UI--it will still be using IndirectUI. 1 Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 15, 2017 Share Posted January 15, 2017 @xod Sounds like you're moving to a WinForms UI. If you want I can send you a link to my updated user guide for the VS template. That should help you get started. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
xod Posted January 15, 2017 Author Share Posted January 15, 2017 Thanks EER, I'm waiting the link. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.