pub fn svg_to_ico(
    svg_path: &Path,
    svg_dpi: f32,
    ico_path: &Path,
    ico_entry_sizes: &[u16]
) -> Result<(), Error>
Expand description

Create a new ICO file from given SVG file.

SVG dimensions are interpreted as pixels and the image rasterized using the given DPI. The ICO entry sizes are the heights in pixels of the images to store inside the ICO file: the SVG image will be scaled to produce images of the specified sizes. If the ICO file’s parent directory does not exist, it will be created.

Examples

Interpret an SVG file as having a DPI of 96 and create an ICO file containing images with heights of 32 px and 64 px:

use std::path::Path;
use svg_to_ico::svg_to_ico;

let input = Path::new("examples/example.svg");
let output = Path::new("examples/example.ico");

svg_to_ico(input, 96.0, output, &[32, 64])?;