Popular Post BoltBait Posted July 15, 2018 Popular Post Share Posted July 15, 2018 (edited) Calendar Creator v1.6 I needed this for work, so I coded it up. And, because I'm so nice I'm sharing it with you. I'm not so nice, however, to entertain requests for format changes to the calendar itself. The drop-down list boxes default to the current month and year. Download Download as part of my plugin pack: https://forums.getpaint.net/BoltBaitPluginPack Version 1.6 changes year entry into a slider instead of a drop-down list box. Source Code This is a little too complicated for CodeLab. Visual Studio is required to build this. I whipped this together quickly and never went back to clean it up--you have been warned. Spoiler using System; using System.Drawing; using System.Reflection; using System.Drawing.Drawing2D; using System.Globalization; using System.Collections.Generic; using System.Runtime.InteropServices; using PaintDotNet; using PaintDotNet.Effects; using PaintDotNet.IndirectUI; using PaintDotNet.PropertySystem; using IntSliderControl = System.Int32; using CheckboxControl = System.Boolean; using ListBoxControl = System.Byte; [assembly: AssemblyTitle("Calendar plugin for paint.net")] [assembly: AssemblyDescription("Calendar Creator")] [assembly: AssemblyConfiguration("calendar")] [assembly: AssemblyCompany("BoltBait")] [assembly: AssemblyProduct("Calendar")] [assembly: AssemblyCopyright("Copyright ©2018 by BoltBait")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.6.*")] namespace CalendarEffect { public class PluginSupportInfo : IPluginSupportInfo { public string Author { get { return ((AssemblyCopyrightAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]).Copyright; } } public string Copyright { get { return ((AssemblyDescriptionAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description; } } public string DisplayName { get { return ((AssemblyProductAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]).Product; } } public Version Version { get { return base.GetType().Assembly.GetName().Version; } } public Uri WebsiteUri { get { return new Uri("http://BoltBait.com/pdn"); } } } [PluginSupportInfo(typeof(PluginSupportInfo), DisplayName = "Calendar")] public class CalendarEffectPlugin : PropertyBasedEffect { public static string StaticName { get { return "Calendar"; } } public static Image StaticIcon { get { return new Bitmap(typeof(CalendarEffectPlugin), "Calendar.png"); } } public static string SubmenuName { get { return SubmenuNames.Render; } } public CalendarEffectPlugin() : base(StaticName, StaticIcon, SubmenuName, EffectFlags.Configurable | EffectFlags.ForceAliasedSelectionQuality) { } public enum PropertyNames { Amount1, Amount2, Amount3, Amount4, Amount5, Amount6, Amount7, Amount8, Amount9, Amount10 } public enum Amount3Options { Amount3Option1, Amount3Option2, Amount3Option3, Amount3Option4, Amount3Option5, Amount3Option6, Amount3Option7, Amount3Option8, Amount3Option9, Amount3Option10, Amount3Option11, Amount3Option12 } protected override PropertyCollection OnCreatePropertyCollection() { List<Property> props = new List<Property>(); props.Add(new Int32Property(PropertyNames.Amount1, 2, 1, 100)); props.Add(new Int32Property(PropertyNames.Amount2, 12, 8, 72)); Amount3Options Amount3Default = (Amount3Options)(DateTime.Now.Month - 1); props.Add(StaticListChoiceProperty.CreateForEnum<Amount3Options>(PropertyNames.Amount3, Amount3Default, false)); props.Add(new Int32Property(PropertyNames.Amount4, DateTime.Now.Year, DateTime.Now.AddYears(-120).Year, DateTime.Now.AddYears(120).Year)); props.Add(new BooleanProperty(PropertyNames.Amount5, true)); props.Add(new BooleanProperty(PropertyNames.Amount6, false)); props.Add(new BooleanProperty(PropertyNames.Amount7, true)); props.Add(new BooleanProperty(PropertyNames.Amount8, true)); props.Add(new BooleanProperty(PropertyNames.Amount9, false)); props.Add(new BooleanProperty(PropertyNames.Amount10, false)); return new PropertyCollection(props); } protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.Amount1, ControlInfoPropertyNames.DisplayName, "Border Width"); configUI.SetPropertyControlValue(PropertyNames.Amount2, ControlInfoPropertyNames.DisplayName, "Font Size"); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.DisplayName, "Month"); PropertyControlInfo Amount3Control = configUI.FindControlForPropertyName(PropertyNames.Amount3); DateTime monthNames = new DateTime(2000, 1, 1); for (int i = 0; i < 12; i++) { Amount3Control.SetValueDisplayName((Amount3Options)i, monthNames.AddMonths(i).ToString("MMMM") + " (" + (i+1).ToString() + ")"); } configUI.SetPropertyControlValue(PropertyNames.Amount4, ControlInfoPropertyNames.DisplayName, "Year"); configUI.SetPropertyControlValue(PropertyNames.Amount5, ControlInfoPropertyNames.DisplayName, "Options"); configUI.SetPropertyControlValue(PropertyNames.Amount5, ControlInfoPropertyNames.Description, "Show surrounding days"); configUI.SetPropertyControlValue(PropertyNames.Amount6, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Amount6, ControlInfoPropertyNames.Description, "Short day of week labels"); configUI.SetPropertyControlValue(PropertyNames.Amount7, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Amount7, ControlInfoPropertyNames.Description, "Show horizontal dividers"); configUI.SetPropertyControlValue(PropertyNames.Amount8, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Amount8, ControlInfoPropertyNames.Description, "Show vertical dividers"); configUI.SetPropertyControlValue(PropertyNames.Amount9, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Amount9, ControlInfoPropertyNames.Description, "Week starts with Monday"); configUI.SetPropertyControlValue(PropertyNames.Amount10, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlValue(PropertyNames.Amount10, ControlInfoPropertyNames.Description, "Show weekends in Red"); return configUI; } protected override void OnCustomizeConfigUIWindowProperties(PropertyCollection props) { // Change the effect's window title props[ControlInfoPropertyNames.WindowTitle].Value = "BoltBait's Calendar Creator v1.6"; // Add help button to effect UI props[ControlInfoPropertyNames.WindowHelpContentType].Value = WindowHelpContentType.PlainText; props[ControlInfoPropertyNames.WindowHelpContent].Value = "Calendar Creator v1.6\nCopyright ©2018 by BoltBait\nAll rights reserved."; base.OnCustomizeConfigUIWindowProperties(props); } protected override void OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) { Amount1 = newToken.GetProperty<Int32Property>(PropertyNames.Amount1).Value; Amount2 = newToken.GetProperty<Int32Property>(PropertyNames.Amount2).Value; Amount3 = (byte)((int)newToken.GetProperty<StaticListChoiceProperty>(PropertyNames.Amount3).Value); Amount4 = newToken.GetProperty<Int32Property>(PropertyNames.Amount4).Value; Amount5 = newToken.GetProperty<BooleanProperty>(PropertyNames.Amount5).Value; Amount6 = newToken.GetProperty<BooleanProperty>(PropertyNames.Amount6).Value; Amount7 = newToken.GetProperty<BooleanProperty>(PropertyNames.Amount7).Value; Amount8 = newToken.GetProperty<BooleanProperty>(PropertyNames.Amount8).Value; Amount9 = newToken.GetProperty<BooleanProperty>(PropertyNames.Amount9).Value; Amount10 = newToken.GetProperty<BooleanProperty>(PropertyNames.Amount10).Value; base.OnSetRenderInfo(newToken, dstArgs, srcArgs); } protected override unsafe void OnRender(Rectangle[] rois, int startIndex, int length) { if (length == 0) return; for (int i = startIndex; i < startIndex + length; ++i) { Render(DstArgs.Surface, SrcArgs.Surface, rois[i]); } } IntSliderControl Amount1 = 2; // [1,100] Border Width IntSliderControl Amount2 = 12; // [8,72] Font Size ListBoxControl Amount3 = 0; // Month|(list is built dynamically) IntSliderControl Amount4 = 0; // [-1918,2118] Year CheckboxControl Amount5 = true; // [0,1] Show surrounding days CheckboxControl Amount6 = false; // [0,1] Short day of week labels CheckboxControl Amount7 = true; // [0,1] Show horizontal dividers CheckboxControl Amount8 = true; // [0,1] Show vertical dividers CheckboxControl Amount9 = false; // [0,1] Week starts with Monday CheckboxControl Amount10 = false; // [0,1] Show weekends in Red // Here is the main render loop function void Render(Surface dst, Surface src, Rectangle rect) { dst.CopySurface(src, rect.Location, rect); Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((selection.Right - selection.Left) / 2) + selection.Left; int DayWidth = (int)((selection.Width - Amount1 * 4) / 7); int calRight = selection.Left + Amount1 + DayWidth * 7; if (IsCancelRequested) return; DateTime m = new DateTime(Amount4, Amount3 + 1, 1); string title = m.ToString("y").Replace(',', ' '); DateTime startDay = m.AddDays(-(int)m.DayOfWeek); if (Amount9) { startDay = startDay.AddDays(1); if (startDay.Day == 2) startDay = startDay.AddDays(-7); } using (Pen myPen = new Pen(Color.Black)) using (Graphics g = new RenderArgs(dst).Graphics) using (SolidBrush Brush1 = new SolidBrush(Color.Black)) using (SolidBrush Brush2 = new SolidBrush(Color.Red)) using (Font SelectedFont = new Font("Arial", Amount2)) { myPen.Width = Amount1; myPen.StartCap = LineCap.Round; myPen.EndCap = LineCap.Round; g.Clip = new Region(rect); g.SmoothingMode = SmoothingMode.AntiAlias; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; SizeF stringSize = new SizeF(g.MeasureString(title, SelectedFont)); int tableTop = (int)stringSize.Height + Amount1 * 2; int DayHeight = (int)((selection.Height - Amount1 * 4 - stringSize.Height * 2) / 6); int calBottom = (int)(stringSize.Height * 2 + Amount1 * 2 + selection.Top + DayHeight * 6); StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; format.LineAlignment = StringAlignment.Near; // Title g.DrawString(title, SelectedFont, Brush1, CenterX, selection.Top,format); // Outline - top, left, right, bottom, header g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height + Amount1 + selection.Top), calRight, (int)(stringSize.Height + Amount1 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height + Amount1 + selection.Top), Amount1 + selection.Left, calBottom); g.DrawLine(myPen, calRight, (int)(stringSize.Height + Amount1 + selection.Top), calRight, calBottom); g.DrawLine(myPen, Amount1 + selection.Left, calBottom, calRight, calBottom); myPen.StartCap = LineCap.Flat; myPen.EndCap = LineCap.Flat; g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + selection.Top)); // DOW Titles string s=""; string dateformat = "dddd"; if (Amount6) dateformat = "ddd"; for (int i=0; i<7; i++) { s = startDay.AddDays(i).ToString(dateformat); stringSize = new SizeF(g.MeasureString(s, SelectedFont)); if (Amount10 && (startDay.AddDays(i).DayOfWeek == DayOfWeek.Saturday || startDay.AddDays(i).DayOfWeek == DayOfWeek.Sunday)) { g.DrawString(s, SelectedFont, Brush2, selection.Left + Amount1 + DayWidth / 2 + DayWidth * i, tableTop + selection.Top, format); } else { g.DrawString(s, SelectedFont, Brush1, selection.Left + Amount1 + DayWidth / 2 + DayWidth * i, tableTop + selection.Top, format); } } // Vertical separators if (Amount8) { g.DrawLine(myPen, Amount1 + DayWidth * 1 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 1 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 2 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 2 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 3 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 3 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 4 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 4 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 5 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 5 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 6 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 6 + selection.Left, calBottom); } // Horizontal separators if (Amount7) { g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 1 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 1 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 2 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 2 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 3 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 3 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 4 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 4 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 5 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 5 + selection.Top)); } // Day numbers tableTop *= 2; format.Alignment = StringAlignment.Near; for (int d = 0; d < 42; d++) { DateTime currentDate = startDay.AddDays(d); ColorBgra textColor = Amount5 ? ColorBgra.Black.NewAlpha(64) : ColorBgra.Transparent; if (currentDate.Month == (Amount3 + 1)) { textColor = ColorBgra.Black; } // red weekends? if (Amount10 && (currentDate.DayOfWeek == DayOfWeek.Saturday || currentDate.DayOfWeek == DayOfWeek.Sunday)) { textColor = ColorBgra.Red.NewAlpha(textColor.A); } string text = currentDate.Day.ToString(); stringSize = new SizeF(g.MeasureString(text, SelectedFont)); using (SolidBrush Brush3 = new SolidBrush(textColor)) { g.DrawString(text, SelectedFont, Brush3, selection.Left + (DayWidth * ((d % 7) + 1)) - stringSize.Width, (DayHeight * (int)(d / 7)) + tableTop + selection.Top, format); } } } } } } If someone wants to compile this for Paint.NET v3.5.11 (won't be easy), I wouldn't mind. Here's the icon: and here's a CodeLab script: Spoiler // Name: Calendar // Submenu: Render // Author: BoltBait // Title: BoltBait's Calendar v1.0 // Version: 1.0 // Desc: Calendar Creator // Keywords: calendar // URL: http://BoltBait.com/pdn // Force Aliased Selection #region UICode IntSliderControl Amount1 = 2; // [0,100] Border Width IntSliderControl Amount2 = 12; // [8,72] Font Size ListBoxControl Amount3 = 5; // Month|January (01)|February (02)|March (03)|April (04)|May (05)|June (06)|July (07)|August (08)|September (09)|October (10)|November (11)|December (12) ListBoxControl Amount4 = 8; // Year|2010|2011|2012|2013|2014|2015|2016|2017|2018|2019|2020|2021|2022|2023|2024|2025 CheckboxControl Amount5 = true; // [0,1] Show surrounding days CheckboxControl Amount6 = false; // [0,1] Short day of week labels CheckboxControl Amount7 = true; // [0,1] Show horizontal dividers CheckboxControl Amount8 = true; // [0,1] Show vertical dividers CheckboxControl Amount9 = false; // [0,1] Week starts with Monday CheckboxControl Amount10 = false; // [0,1] Show weekends in Red #endregion int BaseYear = 2010; void Render(Surface dst, Surface src, Rectangle rect) { dst.CopySurface(src, rect.Location, rect); Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); int CenterX = ((selection.Right - selection.Left) / 2) + selection.Left; int DayWidth = (int)((selection.Width - Amount1 * 4) / 7); int calRight = selection.Left + Amount1 + DayWidth * 7; if (IsCancelRequested) return; DateTime m = new DateTime(BaseYear + Amount4, Amount3 + 1, 1); string title = m.ToString("y").Replace(',', ' '); DateTime startDay = m.AddDays(-(int)m.DayOfWeek); if (Amount9) { startDay = startDay.AddDays(1); if (startDay.Day == 2) startDay = startDay.AddDays(-7); } using (Pen myPen = new Pen(Color.Black)) using (Graphics g = new RenderArgs(dst).Graphics) using (SolidBrush Brush1 = new SolidBrush(Color.Black)) using (SolidBrush Brush2 = new SolidBrush(Color.Red)) using (Font SelectedFont = new Font("Arial", Amount2)) { myPen.Width = Amount1; myPen.StartCap = LineCap.Round; myPen.EndCap = LineCap.Round; g.Clip = new Region(rect); g.SmoothingMode = SmoothingMode.AntiAlias; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; SizeF stringSize = new SizeF(g.MeasureString(title, SelectedFont)); int tableTop = (int)stringSize.Height + Amount1 * 2; int DayHeight = (int)((selection.Height - Amount1 * 4 - stringSize.Height * 2) / 6); int calBottom = (int)(stringSize.Height * 2 + Amount1 * 2 + selection.Top + DayHeight * 6); StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; format.LineAlignment = StringAlignment.Near; // Title g.DrawString(title, SelectedFont, Brush1, CenterX, selection.Top,format); // Outline - top, left, right, bottom, header g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height + Amount1 + selection.Top), calRight, (int)(stringSize.Height + Amount1 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height + Amount1 + selection.Top), Amount1 + selection.Left, calBottom); g.DrawLine(myPen, calRight, (int)(stringSize.Height + Amount1 + selection.Top), calRight, calBottom); g.DrawLine(myPen, Amount1 + selection.Left, calBottom, calRight, calBottom); myPen.StartCap = LineCap.Flat; myPen.EndCap = LineCap.Flat; g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + selection.Top)); // DOW Titles string s=""; string dateformat = "dddd"; if (Amount6) dateformat = "ddd"; for (int i=0; i<7; i++) { s = startDay.AddDays(i).ToString(dateformat); stringSize = new SizeF(g.MeasureString(s, SelectedFont)); if (Amount10 && (startDay.AddDays(i).DayOfWeek == DayOfWeek.Saturday || startDay.AddDays(i).DayOfWeek == DayOfWeek.Sunday)) { g.DrawString(s, SelectedFont, Brush2, selection.Left + Amount1 + DayWidth / 2 + DayWidth * i, tableTop + selection.Top, format); } else { g.DrawString(s, SelectedFont, Brush1, selection.Left + Amount1 + DayWidth / 2 + DayWidth * i, tableTop + selection.Top, format); } } // Vertical separators if (Amount8) { g.DrawLine(myPen, Amount1 + DayWidth * 1 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 1 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 2 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 2 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 3 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 3 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 4 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 4 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 5 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 5 + selection.Left, calBottom); g.DrawLine(myPen, Amount1 + DayWidth * 6 + selection.Left, (int)((stringSize.Height + Amount1) * 2 + selection.Top), Amount1 + DayWidth * 6 + selection.Left, calBottom); } // Horizontal separators if (Amount7) { g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 1 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 1 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 2 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 2 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 3 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 3 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 4 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 4 + selection.Top)); g.DrawLine(myPen, Amount1 + selection.Left, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 5 + selection.Top), calRight, (int)(stringSize.Height * 2 + Amount1 * 2 + DayHeight * 5 + selection.Top)); } // Day numbers tableTop *= 2; format.Alignment = StringAlignment.Near; for (int d = 0; d < 42; d++) { DateTime currentDate = startDay.AddDays(d); ColorBgra textColor = Amount5 ? ColorBgra.Black.NewAlpha(64) : ColorBgra.Transparent; if (currentDate.Month == (Amount3 + 1)) { textColor = ColorBgra.Black; } // red weekends? if (Amount10 && (currentDate.DayOfWeek == DayOfWeek.Saturday || currentDate.DayOfWeek == DayOfWeek.Sunday)) { textColor = ColorBgra.Red.NewAlpha(textColor.A); } string text = currentDate.Day.ToString(); stringSize = new SizeF(g.MeasureString(text, SelectedFont)); using (SolidBrush Brush3 = new SolidBrush(textColor)) { g.DrawString(text, SelectedFont, Brush3, selection.Left + (DayWidth * ((d % 7) + 1)) - stringSize.Width, (DayHeight * (int)(d / 7)) + tableTop + selection.Top, format); } } } } Paint.NET v3.5.11 users can download a compiled version here! Enjoy. Edited April 29 by toe_head2001 3 9 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
BoltBait Posted July 15, 2018 Author Share Posted July 15, 2018 OK, fixed all the wonkey math and localized the output. Can someone test the localization for me? Thanks! Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Eli Posted July 15, 2018 Share Posted July 15, 2018 Thanks for this tool @BoltBait. I can now organize my things to do . 2 2 Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 15, 2018 Author Share Posted July 15, 2018 28 minutes ago, Eli said: I can now organize my things to do . Nice graphical schedule. That's exactly what I had in mind when I created this plugin. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
barbieq25 Posted July 15, 2018 Share Posted July 15, 2018 Thanks BoltBait! Easy to use. It will come in very handy for me 1 Quote Knowledge is no burden to carry. April Jones, 2012 Gallery My DA Gallery Link to comment Share on other sites More sharing options...
Seerose Posted July 15, 2018 Share Posted July 15, 2018 Sir @BoltBait! Thank you so much for your effort. Beautiful calendar creator. *Sorry! I'll come back later. (rep. p) 2 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...
ReMake Posted July 15, 2018 Share Posted July 15, 2018 The calendar for the Russian version of Windows looks like this: Great work! 2 2 Quote Link to comment Share on other sites More sharing options...
lynxster4 Posted July 15, 2018 Share Posted July 15, 2018 Wow! This will come in handy. Tired of downloading calendars from the internet. Now, I can just make my own and customize it any way I want! Thank you @BoltBait 1 Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
BoltBait Posted July 15, 2018 Author Share Posted July 15, 2018 2 hours ago, ReMake said: The calendar for the Russian version of Windows looks like this: Thanks. I was hoping the Day of the Week names would come out localized too. I'll have to check on this. EDIT: @ReMake, I have made some code changes and sent you a test build. Let me know if it works. Thanks! 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
BoltBait Posted July 15, 2018 Author Share Posted July 15, 2018 Updated to v1.2 to fix the localization issue. Now the day of the week labels are localized. Thanks @ReMake for testing! 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
flaner Posted July 15, 2018 Share Posted July 15, 2018 (edited) BoltBait in Russia the week starts on MondayThere are no translations of the month Edited July 15, 2018 by flaner Quote Link to comment Share on other sites More sharing options...
ReMake Posted July 15, 2018 Share Posted July 15, 2018 2 minutes ago, flaner said: What do you mean when you say "There are no translations of the month" Quote Link to comment Share on other sites More sharing options...
flaner Posted July 15, 2018 Share Posted July 15, 2018 Главное меню плагина. Месяца на английском. Впрочем это не критично. А вот то что неделя начинается с Воскресения , это не айс (ничего что я по-русски ?) Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 15, 2018 Author Share Posted July 15, 2018 54 minutes ago, flaner said: in Russia the week starts on Monday I'll fix that. 44 minutes ago, flaner said: Главное меню плагина. Месяца на английском. I'll fix that too. My mistake. NOTE: None of the other labels will be localized. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
ReMake Posted July 15, 2018 Share Posted July 15, 2018 1 minute ago, flaner said: (nothing that I in Russian?) It is better to do it by means of PM. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 15, 2018 Author Share Posted July 15, 2018 11 minutes ago, flaner said: Главное меню плагина. Месяца на английском. This problem has been fixed. Please test. Thanks! Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
flaner Posted July 15, 2018 Share Posted July 15, 2018 1 minute ago, BoltBait said: This problem has been fixed. Please test. Thanks! months in Russianthe week still begins with the Sun ? Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 15, 2018 Author Share Posted July 15, 2018 13 minutes ago, flaner said: the week still begins with the Sun ? This has been fixed in v1.4... Enjoy. 3 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
flaner Posted July 15, 2018 Share Posted July 15, 2018 7 minutes ago, BoltBait said: This has been fixed in v1.4... Enjoy. working ? Quote Link to comment Share on other sites More sharing options...
Seerose Posted July 15, 2018 Share Posted July 15, 2018 (edited) Sir @BoltBait! I have a question: First calendar is English. Second calendar is German. My paint.net is English language. How do you do that? Edited July 15, 2018 by Seerose 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...
BoltBait Posted July 15, 2018 Author Share Posted July 15, 2018 5 minutes ago, Seerose said: How do you do that? I'm asking Windows, not Paint.NET, for the names of the Months and Days of the Week. 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Pixey Posted July 15, 2018 Share Posted July 15, 2018 Love this Plugin @BoltBait It's going to be most useful - many thanks 4 1 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...
Eli Posted July 15, 2018 Share Posted July 15, 2018 (edited) @BoltBait Would it be possible to add a choice of font types and colors? For example Lines: primary color and Text: Secondary color. Edited July 15, 2018 by Eli Quote Link to comment Share on other sites More sharing options...
lynxster4 Posted July 15, 2018 Share Posted July 15, 2018 Mmmm @Pixey .....looks like your Saturdays are 'FULL'. 1 Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
null54 Posted July 15, 2018 Share Posted July 15, 2018 Here is a 3.5.11 build. Calendar 3.5.11.zip 20 hours ago, BoltBait said: If someone wants to compile this for Paint.NET v3.5.11 (won't be easy), I wouldn't mind Changing the Visual Studio code to compile with 3.5.11 was easier that getting the icon to load. It took me several minutes of troubleshooting to realize that I misspelled 'Calendar' when setting the default project namespace. ? 2 2 Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait 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.