Use the C # command line to call inkscape to draw a PNG image,
I have been paying attention to the blog garden, but I never write anything. I slowly found that my own reading capability has not improved, and my hands-on skills are getting better and better.
It's time to start.
I wrote a blog post for the first time and began to record what I used in my work. I hope I can help myself and those who saw it again.
Started!
Copy and paste the frequently used command lines of Inkscape.
-?, -- Help
-V, -- version
-f, --file=FILENAME
-e, --export-png=FILENAME -a, --export-area=x0:y0:x1:y1 -C, --export-area-page -D, --export-area-drawing --export-area-snap -i, --export-id=ID -j, --export-id-only -t, --export-use-hints -b, --export-background=COLOR -y, --export-background-opacity=VALUE -d, --export-dpi=DPI -w, --export-width=WIDTH -h, --export-height=HEIGHT
-P, --export-ps=FILENAME -E, --export-eps=FILENAME -A, --export-pdf=FILENAME --export-pdf-version=VERSION-STRING --export-latex
--export-ps-level {2,3}
-T, --export-text-to-path --export-ignore-filters
-l, --export-plain-svg=FILENAME
-p, --print=PRINTER
-I, --query-id=ID -X, --query-x -Y, --query-y -W, --query-width -H, --query-height -S, --query-all
-x, --extension-directory
-G, -- with-gui-z, -- without-gui
How to call it in C ..
// The address of the sng image to be saved by path2
String path2 = svgFile + ". png ";
// The following statement calls the command line of inkscape.
//-F Data Source (here is a file ending with svg)-e file path to be exported plus format-d resolution
// If other parameters are used, you can refer to the preceding command line to export height, length, and background color.
String inkscapeArgs = "-f" + svgFile + ". svg" + "-e" + path2 + "-d 128 ";
// Call the exe Application
System. Diagnostics. Process inkscape = System. Diagnostics. Process. Start (new System. Diagnostics. ProcessStartInfo ("D: \ inkscape \ inkscape.exe", inkscapeArgs ));
Inkscape. WaitForExit ();
If you have any questions, please point out that you can make progress together.