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

ImageService LoadEmbeddedResource Svg ReplaceStringMap Has No Effect #1171

Closed
jmichas opened this issue Dec 17, 2018 · 0 comments
Closed

ImageService LoadEmbeddedResource Svg ReplaceStringMap Has No Effect #1171

jmichas opened this issue Dec 17, 2018 · 0 comments

Comments

@jmichas
Copy link

jmichas commented Dec 17, 2018

Description

When using the ImageService to load embedded svg files, the custom data resolver replacestring map doesn't do anything.

Steps to Reproduce

var img = ImageService.Instance
	.LoadEmbeddedResource(iconPath, assembly)
	.WithCustomDataResolver(new SvgDataResolver(0, (int)height, true, new Dictionary<string, string> { { "E5E5E5", "16B2B6" } }));
					
var uiImage = await img.AsUIImageAsync();

The contents of my SVG are:

<?xml version="1.0" encoding="UTF-8"?>
<svg width="25px" height="24px" viewBox="0 0 25 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
    <title>Home Icon</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.5">
        <g id="Marketplace-dashboard" transform="translate(-23.000000, -732.000000)" fill="#E5E5E5">
            <g id="Navigation-Bar" transform="translate(0.000000, 717.000000)">
                <g id="btn_dashboard" transform="translate(12.000000, 15.000000)">
                    <g id="Icon-1" transform="translate(11.000000, 0.000000)">
                        <path d="M19.2113624,5.61609116 L19.2113624,5.44528154 C19.2113624,4.64312515 19.8519274,3.99284891 20.6545158,3.99284891 C21.4515474,3.99284891 22.0976692,4.63495401 22.0976692,5.44528154 L22.0976692,8.18751973 L24.4485655,10.2819478 C25.2730873,11.0165194 25.0451901,11.6120073 23.9387096,11.6120073 L22.0976692,11.6120073 L22.0976692,22.9853649 C22.0976692,23.541783 21.6596186,23.9928489 21.0902254,23.9928489 L3.86306772,23.9928489 C3.30667188,23.9928489 2.85562394,23.5439287 2.85562394,22.9853649 L2.85562394,11.6120073 L1.00541568,11.6120073 C-0.100691767,11.6120073 -0.329417809,11.0169255 0.495559807,10.2819478 L11.7287014,0.274272448 C12.1392485,-0.091486479 12.8050167,-0.0913618144 13.2154239,0.274272448 L19.2113624,5.61609116 Z M15.3629533,13.9928489 L15.3629533,20.9928489 L19.2113624,20.9928489 L19.2113624,13.9928489 L15.3629533,13.9928489 Z" id="Home-Icon"></path>
                    </g>
                </g>
            </g>
        </g>
    </g>
</svg>

Expected Behavior

Expected the #e5e5e5 color to be replaced with #16B2B6.

Actual Behavior

Color is not replaced.
This may be related to the other bugs regarding replace string map and the order that attributes in xaml are placed in. The problem is I can find no way to manage the order of operations using the image service.

Basic Information

  • Platform: Xamarin iOS
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

No branches or pull requests

2 participants