mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 00:46:12 +02:00
Updated Guide (markdown)
+6
-6
@@ -51,6 +51,8 @@ namespace DesktopMagicPlugin
|
||||
g.DrawStringFixedWidth("Hello", new Font(Application.Font, 100), Brushes.Black, new PointF(0, 0), 120); //Draw the "Hello" to the image.
|
||||
}
|
||||
|
||||
bmp.SetResolution(300, 300); //Set DPI to avoid scaling issues.
|
||||
|
||||
return bmp; //Return the image.
|
||||
}
|
||||
}
|
||||
@@ -62,12 +64,6 @@ namespace DesktopMagicPlugin
|
||||
In this example, the user can enter a string that will be displayed on the image.
|
||||
|
||||
```cs
|
||||
using DesktopMagicPluginAPI;
|
||||
using DesktopMagicPluginAPI.Inputs;
|
||||
using DesktopMagicPluginAPI.Drawing;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
|
||||
using DesktopMagicPluginAPI;
|
||||
using DesktopMagicPluginAPI.Inputs;
|
||||
using DesktopMagicPluginAPI.Drawing;
|
||||
@@ -103,8 +99,12 @@ namespace DesktopMagicPlugin
|
||||
g.DrawStringFixedWidth(textBox.Value, new Font(Application.Font, 100), Brushes.Black, new PointF(0, 0), 120); //Draw the value of the text box to the image.
|
||||
}
|
||||
|
||||
bmp.SetResolution(300, 300); //Set DPI to avoid scaling issues.
|
||||
|
||||
return bmp; //Return the image.
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> Tip: Use `Bitmap.SetResolution` to avoid scaling problems on different screens.
|
||||
Reference in New Issue
Block a user