Open .png image in Paint.Net from PHP script on Windows 10
This tutorial will show you how to run paint.net image editing software from a php script. Paint.NET is image and photo editing software for PCs that run Windows. It features an intuitive and innovative user interface with support for layers, unlimited undo, special effects, and a wide variety of useful and powerful tools.
1. Install XAMPP with PHP for Windows
XAMPP is an easy to install free Apache distribution containing MariaDB, PHP and Perl.
Goto official website, download and install it :
https://www.apachefriends.org/index.html
2. Add PHP folder to Path Windows Environment Variable
In search bar type "env", click on "Edit the system environment variable" and "Open".
3. Test PHP correct setup in Windows Command Prompt ( CMD)
Open Windows command prompt ( cmd )
Type following command and press Enter button on keyboard :
php -version
4. Install Paint.Net for Windows
5. Write PHP script to open image using Paint.Net protocol
Create file on Desktop. Name it automation.php.
Paste following code into php file :
Change path to your image !!!. I used Yumeko.png image on Desktop.
6. Run PHP script from Command Prompt ( CMD)
Open new window command prompt.
Type following command and press Enter ( change to your script path ! ):
CD C:\Users\Dev\Desktop
Type following command to run PHP script :
php automation.php
As result PHP should open Paint.Net with image you provided.
No comments:
Post a Comment