Closed TonyLugg closed 4 years ago
Sure, you could create an msbuild task that runs before resizetizer which downloads the image at build time.
Something like this:
<Target BeforeTargets="ResizetizeCollectImages">
<DownloadFile SourceUrl="https://mysite.com/image.svg" DestinationFileName="Images/image.svg" SkipUnchangedFiles="true" />
<SharedImage Include="Images/image.svg" BaseSize="40,40" />
</Target>
The key will be to run BeforeTargets="ResizetizeCollectImages"
to ensure your SharedImage
item is added to the group before Resizetizer looks for them.
Of course you could get much fancier than that, but that should do the trick for the basic idea.
No, it can't be done at build time. Customers can set custom logo/colors to brand the app for their company. The logo is downloaded when the app starts so it varies based on user. It would be nice to be able to download an image at runtime and have a library that would resize it for all resolutions/densities.
Ahh, sorry that's definitely out of the scope of this project.
But it would be an awesome enhancement, hint, hint. 😉
Is there a way to resize an image downloaded from a web server at runtime?