roro69
-
Posts
29 -
Joined
-
Last visited
Posts posted by roro69
-
-
Good evening
no it is not actually
While p.MainWindowHandle = IntPtr.Zero System.Threading.Thread.Sleep(100) End While System.IO.File.Delete(s)
the file is delete before being launched
Supend time is not long enough I will try another try
thank you
-
Good evening thank you for your solution I tried and the software tells me file not found. Here is the error log
QuoteSystem.IO.FileNotFoundException: Le fichier 'C:\Users\Roro\AppData\Local\Temp\tmp7E8A.tmpmyImage.png' est introuvable. Nom de fichier : 'C:\Users\Roro\AppData\Local\Temp\tmp7E8A.tmpmyImage.png' à System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) à System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) à System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) à PaintDotNet.Controls.DocumentWorkspace.LoadDocument(Control owner, String fileName, FileType& fileTypeResult, ProgressEventHandler progressCallback) dans D:\src\pdn\src\PaintDotNet\Controls\DocumentWorkspace.cs:ligne 3220
Thank you for your help and time
-
Good evening I tried with the code below but I do not understand the software tells me type unrecognized image
Dim painte As String = "C:\Program Files\paint.net\PaintDotNet.exe" Dim s As String = System.IO.Path.GetTempFileName() Dim monimage As Bitmap = New Bitmap(200, 200) monimage.Save(s, Imaging.ImageFormat.Png) Dim p As Process = Process.Start(painte, s) 'maybe here's a better way to wait While p.MainWindowHandle = IntPtr.Zero System.Threading.Thread.Sleep(100) End While System.IO.File.Delete(s)
Merci de votre aide
-
Hello, thank you for the response I will make a small application that will create my bitmap to the desired size and then with System.process.start I will start paint net with this bitmap. Thanks for the time and help
-
Hello, thank you for the response If I understand correctly it is possible to create a blank bitmap in windows clipboard and load it in paint net ; so if that's the case, can you help me to code this solution? Thank you for your answers and help provided
-
Hello I'm sorry for the english approximatf; but I want to automate the dimensions of the canvas because I have to calculate them each time with my input Thank you for your answers and help provided
-
Hello, I would like to know if it is possible from a plugin to create a new document. That's my problem: I create new documents but I have to calculate their area as follows: The height of the surface I desire is height 10 times The width of the surface I want is width / 2 Example: My input data 624 * 22 What will give when I create new document Width 312 pixels Height 220 pixels So what I wanted was to get my entry information; then create a new document with the good dimensions Thank you for your response, and thank you for your time
-
Hello, here's a very interesting program about this issue.Good evening
-
Hello and thank you very much for all your kind message I will definitely update it, if some can help me code, or ideas on a cleaner graphic interface or other ideas I will be very happy I thank you in advance for the help provided Translation google sorry :)))
- 1
-
Good evening; Here is a plugin that I use to create logos; I share it if you want to try it. On the other hand it is in French, if really you find it interesting I will try to translate it.
For the plugin you can add as much annotation as you want to your image, then to apply an effect to your text you have to be careful that it is selecting ::
The plugin is in Effect ----> CreaText ------> CreaLogo
There it is, thanks- 5
-
Hello ; someone would have it the start of the discussion file( Kerned text plugin) ; because the link is no longer valid . thank you very much
-
HelloThank you very much for your answersIt's a shame because with fontname combo CodeLab; it is obliged to load the style one by one to see the result style font in the canvas.Too bad I will pass visual studio and event combo DrawItemThank you for help
-
Hello ,Is it possible in the Drop down list fontname of CodeLab .; can draw like the paint net dropdown list fontnameI would like in the plugin that I have tried to make the Drop down list like thisIf it is not possible ; I will do my plugin in visual studio but I find it a bit complicated create plugin with Visual studioI started my visual studio code like this:
private void MonEffetConfigDialog_Load(object sender, EventArgs e) { this.MaCombo1.DrawMode = DrawMode.OwnerDrawFixed; this.MaCombo1.ItemHeight = 18; this.MaCombo1.DrawItem += new DrawItemEventHandler(this.MaCombo2_DrawItem); InstalledFontCollection MesPolicesInstalle = new InstalledFontCollection(); FontFamily[] FontFamille = MesPolicesInstalle.Families; FontFamily[] MonTableau = FontFamille; for (int i = 0; i < MonTableau.Length; i++) { FontFamily FontFamille1 = MonTableau[i]; if (FontFamille1.IsStyleAvailable(FontStyle.Regular)) { this.Macombo1.Items.Add(FontFamille1.Name); } } } private void MaCombo2_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); ComboBox Macombo = (ComboBox)sender; string texte = (e.Index > -1) ? Macombo.Items[e.Index].ToString() : Macombo.Text; Font Police = new Font(texte, Macombo.Font.Size); Brush Pinceau = new SolidBrush(e.ForeColor); float fl = ((float)e.Bounds.Height - e.Graphics.MeasureString(texte, Police).Height) / 2f; e.Graphics.DrawString(text, font, brush, (float)e.Bounds.X, (float)e.Bounds.Y +fl); Police.Dispose(); Pinceau.Dispose(); e.DrawFocusRectangle(); }
But I preferred to make my plugin with codelab.
Thank you very much for your answers and assistance -
Hello if you want you can try this plugin
http://forums.getpaint.net/index.php?/topic/106698-calcule-book-folding-pattern/
-
HelloThank you for your answersI tried but the result is not good; I tried going through a rather strinbuilder dessinner and a letter at a time and make a difference as I wantThank you for the help provided and the time spent
-
HelloYes I create a text effect plugins; and I wanted in my plugin manage the spacing of the letters; here is the code already implemented:code for transform text and drawtext
// Write and transformation text g.ScaleTransform(Amount7, Amount8, System.Drawing.Drawing2D.MatrixOrder.Append); g.TranslateTransform(cx, cy,System.Drawing.Drawing2D.MatrixOrder.Append); StringFormat string_format = new StringFormat(); string_format.Alignment = StringAlignment.Center; string_format.LineAlignment = StringAlignment.Center; g.DrawString(Amount1, SelectedFont, Brush1, 0, 0, string_format);
Thank you for their time and assistance provided
: -
Hello thank you for your answersToo bad the topic and was moved because I would really like to know the code to achieve this.I repecte DecisionToo bad the plugin link does not work for downloaded.Thank you for the help and time spent
-
HelloThanks to this excellent forum and assistanceI could create plugin for drawing text on the canvas; and now I want that when I use certain Font; I can reduce the spacing (Kerning Font) between each letter.Thank you for the help provided and the time spent.
-
-
HelloThis plugin is used to calculate the pattern's books folded. It's like the plugin pixel count; just that the calculation is made only for 1 folding per page. The result is saved in an Excel workbook.I placed it in Effect -> Render
- 3
-
Hello eli
Yes it's for used pour calculer patron livre plié
-
Good eveningThank you for your help my code works fine; the problem was the icon file.If anyone here interested here is the code to write to a file excel to count pixel (This is not an effect plugin) .....
using System; using System.Text; using System.Windows; using System.Reflection; using System.Windows.Forms; using PaintDotNet; using PaintDotNet.Effects; using PaintDotNet.IndirectUI; using PaintDotNet.PropertySystem; using System.Collections.Generic; using System.Drawing; using System.Drawing.Text; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using IntSliderControl = System.Int32; using TextboxControl = System.String; using Microsoft.Office.Interop; namespace PatronLivre { 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://www.getpaint.net/redirect/plugins.html"); } } } [PluginSupportInfo(typeof(PluginSupportInfo), DisplayName = "CalcPat+")] [EffectCategory(EffectCategory.Effect)] public class MonEffetEffectPlugin : PropertyBasedEffect { public static string StaticName { get { return "CalculPatron"; } } public static Bitmap StaticIcon { get { return PatronLivreEffect.Properties.Resources.EffectPluginIcon; } } public static string SubmenuName { get { return SubmenuNames.Render; // Programmer's chosen default } } public MonEffetEffectPlugin() : base(StaticName, StaticIcon, SubmenuName, EffectFlags.Configurable) { instanceSeed = unchecked((int)DateTime.Now.Ticks); } public enum PropertyNames { Amount1, Amount2, Amount3 } [ThreadStatic] private static Random RandomNumber; private int randomSeed; private int instanceSeed; protected override PropertyCollection OnCreatePropertyCollection() { List<Property> props = new List<Property>(); props.Add(new Int32Property(PropertyNames.Amount1, 0, 0, 1000)); props.Add(new StringProperty(PropertyNames.Amount2, "", 255)); props.Add(new Int32Property(PropertyNames.Amount3, 0, 0, 255)); return new PropertyCollection(props); } protected override ControlInfo OnCreateConfigUI(PropertyCollection props) { ControlInfo configUI = CreateDefaultConfigUI(props); configUI.SetPropertyControlValue(PropertyNames.Amount1, ControlInfoPropertyNames.DisplayName, "Nombre Page Livre"); configUI.SetPropertyControlValue(PropertyNames.Amount2, ControlInfoPropertyNames.DisplayName, "Nom du Patron"); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.DisplayName, string.Empty); configUI.SetPropertyControlType(PropertyNames.Amount3, PropertyControlType.IncrementButton); configUI.SetPropertyControlValue(PropertyNames.Amount3, ControlInfoPropertyNames.ButtonText, "Sauve Patron"); return configUI; } protected override void OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) { Amount1 = newToken.GetProperty<Int32Property>(PropertyNames.Amount1).Value; Amount2 = newToken.GetProperty<StringProperty>(PropertyNames.Amount2).Value; Amount3 = (byte)newToken.GetProperty<Int32Property>(PropertyNames.Amount3).Value; randomSeed = Amount3; base.OnSetRenderInfo(newToken, dstArgs, srcArgs); } protected override void OnCustomizeConfigUIWindowProperties(PropertyCollection props) { // Change the effect's window title props[ControlInfoPropertyNames.WindowTitle].Value = "CalculPatron"; base.OnCustomizeConfigUIWindowProperties(props); } protected override unsafe void OnRender(Rectangle[] rois, int startIndex, int length) { if (length == 0) return; RandomNumber = GetRandomNumberGenerator(rois, startIndex); for (int i = startIndex; i < startIndex + length; ++i) { Render(DstArgs.Surface, SrcArgs.Surface, rois[i]); } } private Random GetRandomNumberGenerator(Rectangle[] rois, int startIndex) { Rectangle roi = rois[startIndex]; return new Random(instanceSeed ^ (randomSeed << 16) ^ (roi.X << 8) ^ roi.Y); } #region User Entered Code // Name: // Submenu: // Author: // Title: // Version: // Desc: // Keywords: // URL: // Help: #region UICode IntSliderControl Amount1 = 0; // [0,1000] Nombre Page Livre TextboxControl Amount2 = ""; // [0,255] Nom du Patron byte Amount3 = 0; // [255] Sauve Patron #endregion byte LastButton = 0; String cboard; public struct Folds { public double a, b, c, d; public Folds(double p1, double p2, double p3, double p4) { a = p1; b = p2; c = p3; d = p4; } } public void SaveImages() { System.Windows.Forms.SaveFileDialog SaveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); string fp = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); SaveFileDialog1.InitialDirectory = fp; SaveFileDialog1.Filter = "Text file (*.txt)|*.txt"; SaveFileDialog1.FilterIndex = 1; SaveFileDialog1.RestoreDirectory = false; if (SaveFileDialog1.ShowDialog() == DialogResult.OK) { cboard = SaveFileDialog1.FileName; } else { cboard = String.Empty; } } // Here is the main render loop function void Render(Surface dst, Surface src, Rectangle rect) { if (!IsCancelRequested) { Rectangle sel = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); dst.CopySurface(src, sel.Location, sel); //========================= SignalCancelRequest(); if (LastButton != Amount3) { LastButton = Amount3; System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(SaveImages)); t.SetApartmentState(System.Threading.ApartmentState.STA); t.Start(); t.Join(); Application.DoEvents(); if (cboard != String.Empty) { //try { Folds[] folds = new Folds[0]; System.IO.StreamWriter pc = new System.IO.StreamWriter(cboard, false); pc.WriteLine("Nom du patron:" + Amount2); pc.WriteLine("----------------------------------------------"); pc.Close(); GC.Collect(); Microsoft.Office.Interop.Excel.Application oXL; Microsoft.Office.Interop.Excel._Workbook oWB; Microsoft.Office.Interop.Excel._Worksheet oSheet; object misvalue = System.Reflection.Missing.Value; //Demarre excel oXL = new Microsoft.Office.Interop.Excel.Application(); oXL.Visible = false; //Nouveau classeur oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(Missing.Value)); oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.ActiveSheet; //Ajouter les entete de cellule oSheet.Cells[1, 1] = "Nom Patron"; oSheet.Cells[1, 2] = Amount2; oSheet.Cells[2, 1] = "Page"; oSheet.Cells[2, 2] = "Haut"; oSheet.Cells[2, 3] = "Bas"; for (int i = sel.Left; i < sel.Right; i++) { double toppix = 0; double pixlength = 0; for (int y = sel.Top; y < sel.Bottom; y++) { ColorBgra CP = src.GetBilinearSample(i, y); int total = CP.R + CP.G + CP.B; if (toppix == 0) { if (total < 765) { toppix = y; pixlength = 1; } } else { if (total < 765) { pixlength++; } else { Array.Resize(ref folds, folds.Length + 1); folds[folds.Length - 1] = new Folds(i, (toppix - 1) / 10, (pixlength + toppix) / 10, 0); toppix = 0; pixlength = 0; } } } } int x = 0; for (int i = 1; i <= folds.Length - 1; i++) { if (folds[i].a == folds[i - 1].a) { folds[x].d = folds[x].d + 1; } else { x = i; folds[x].d = folds[x].d + 1; } } int p = (Amount1 - (folds.Length * 2)) / 2; int ligne = 2; for (int i = 1; i <= folds.Length - 1; i++) { if (folds[i].d == 0) { folds[i].d = folds[i - 1].d; } if ((folds[i].a + folds[i].d + i) % folds[i].d == 0) { p = p + 2; ligne = ligne + 1; System.IO.StreamWriter pc2 = new System.IO.StreamWriter(cboard, true); pc2.WriteLine("Pages : " + p + "| " + "Haut: " + folds[i].b + " cm" + " | " + "Bas: " + folds[i].c + " cm"); pc2.WriteLine("----------------------------------------------"); pc2.Close(); oSheet.Cells[ligne, 1] = p; oSheet.Cells[ligne, 2] = folds[i].b; oSheet.Cells[ligne, 3] = folds[i].c; } } oSheet.UsedRange.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlVAlign.xlVAlignCenter; oXL.UserControl = false; oWB.SaveAs(Amount2, Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault, Type.Missing, Type.Missing, false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); oWB.Close(); oXL.Quit(); System.Runtime.InteropServices.Marshal.ReleaseComObject(oXL); System.Runtime.InteropServices.Marshal.ReleaseComObject(oWB); System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet); oSheet = null; oWB = null; oXL = null; GC.Collect(); } //}catch(Exception e){} }//cboard }//last button } #endregion } }
Thank you for your help and time spent
-
HelloSorry for the delay in replying; it was super helpful to have me answer ainsi.Je went t through visual studio to create my plugin, I debug (like here : http://forums.getpaint.net/index.php?/topic/4209-how-to-debug-your-plugin/)and built my dll; but it does not load in net paint .:Should I change the framework? (I work with the framework 4.5)Thank you for your answers and time spent.Sorry for my English ; I am French and I have a little trouble with English
-
HelloI create my first plugin to measure the pixels in an image.I wonder if it was possible to code codelab in order to transfer my results in an excel workbookThank you for your help and time spent
Create new document
in Plugin Developer's Central
Posted
Hello Thank you for your answers ;
Rick:
Yes I am sorry, I have deviated a little from the development Paint Net; my original question was about it; I wanted to know if we could program directly in paint net a script to create a new document because the dialog box of the software is not appropriate for my use.
BoltBait: in fact it's true it's useless.Thanks
In any case thank you for your help and your time.