Use the C # command line to call inkscape to draw a PNG image,

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.