question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generating multiple images from a single svg-file

See original GitHub issue

Description

If you have this in your .csproj-file:

<MauiImage Include="Resources\Images\logo.svg" TintColor="#66B3FF" />

A logo.png will be generated with the color #66B3FF. But I would like to generate multiple png-files from a single svg-file:

<MauiImage Include="Resources\Images\logo.svg" TintColor="#FF0000" Output="Logo_Red" />
<MauiImage Include="Resources\Images\logo.svg" TintColor="#0000FF" Output="Logo_Blue" />

Public API Changes

Some Output-attribute is needed in MauiImage.

Intended Use-Case

This is especially useful if you need to generate different images in dark- and light-mode.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:11
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Redthcommented, Jul 12, 2023

This needs some further documentation.

@davidbritch would you be able to assist?

I think we need to articulate how to use the basic “Link” feature of MSBuild to show how you could include the same source svg multiple times to generate different outputs (eg: different basesize, color, etc):

<MauiImage Include="icon.svg" BaseSize="40,40">
  <Link>iconsmall.svg</Link>
</MauiImage>
<MauiImage Include="icon.svg" BaseSize="80,80">
  <Link>iconlarge.svg</Link>
</MauiImage>
0reactions
Redthcommented, Jul 12, 2023

@mattleibow is there maybe some code where we deduplicate the actual item identities here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I have Multiple SVG images in a single file?
One way is SVG Stacks which works by having all the drawings on top of each other and then just displaying the one...
Read more >
How to Turn a Single Layer SVG Image file into a ... - YouTube
A single layer SVG file means that the whole design will be only one ... to create more layers so that you have...
Read more >
CHANGE A SINGLE LAYER IMAGE INTO A MULTIPLE ...
The EASIEST way to change a SINGLE LAYERED IMAGE and quickly turn it into a MULTIPLE LAYERS IMAGE to personalize your next Cricut...
Read more >
Working With Multiple Designs In One SVG File Using ...
Create a new project · Import the SVG file into Design Space (Upload > Upload Image > Browse > select your file >...
Read more >
Merge Image To SVG Online 2023
Merge image to SVG Online. Combine image to SVG online for free. Our web service is designed to merge several image images to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found