Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add svg:// and image:// to imagesource #2725

Open
wants to merge 55 commits into
base: main
Choose a base branch
from

Conversation

inforithmics
Copy link
Contributor

@inforithmics inforithmics commented Jul 24, 2024

Following schemas are added in this pull request:
svg:// svg string
image:// binary image encoded as base64 (could be an svg string encoded as base64)

charlenni and others added 25 commits July 13, 2024 18:11
… because there is a 2000 bytes limitation of the Uri string.
@inforithmics inforithmics changed the title Feature: Add more options for ImageSourceString Feature: Add svg and image to imagesource Jul 25, 2024
@inforithmics inforithmics changed the title Feature: Add svg and image to imagesource WIP Feature: Add svg:// and image:// to imagesource Jul 25, 2024
@inforithmics inforithmics changed the title WIP Feature: Add svg:// and image:// to imagesource Feature: Add svg:// and image:// to imagesource Jul 25, 2024
@inforithmics
Copy link
Contributor Author

inforithmics commented Jul 26, 2024

In c# a Raw string can be used to avoid escaping https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-11.0/raw-string-literal

for example

var svg = """
          svg://<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
                    <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
          """;

@charlenni
Copy link
Member

What is the use case? Small demos or apps, that don't want to have all the overhead to add a file to the source code. The code for a pin is a one liner as svg code. But if you have to save the code to a file and do all this things to copy the file to local file system, then it is very hard.

On the other side, it is a enlargement of the code about two additional switch entries and two functions shouldn't be the problem.

@inforithmics inforithmics mentioned this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants