It's something which I am unable to explain to myself atm.
If I compile Your demo Paul - it's working fine, and the markers is shown just fine, but if I took one of the markers and just resave it with photoshop - the alpha channel is drawn in white color from now on.
Note - to reproduce the issue : SymbolScale must be higher than 1
for instance the follow code works fine, and the markers is shown with transparent places:
var bitmapId = GetBitmapIdForEmbeddedResource(embeddedResourcePath);
return new SymbolStyle
{
BitmapId = bitmapId,
SymbolScale = 1
};
this code anyway show them as not transparent - plain white on the transparent places:
var bitmapId = GetBitmapIdForEmbeddedResource(embeddedResourcePath);
return new SymbolStyle
{
BitmapId = bitmapId,
SymbolScale = 2
};
What could be the possible issue ?!
So there are two factors in play
1) you need to resave it in photoshop
2) you need a symbol scale higher than 1 (scaling is possible with the orginal)
Is this correct?
yes.
Additional note ( it might help ) is that the very same pictures which i am rendering as a markers with transparent areas were working fine in 0.9, now - they are not transparent anymore ( without any changes ), but I have always were using them with scaling by factor 2, if i decrease the scaling factor to 1 - they again renders correctly.

Here an example of the images i am using ( if this helps )
Is the entire rectangle of the image colored or just the edges? This could be caused by Skia default drawing with premultiplied aphas.
Currently I am seeing it in both occurrences - sometime the whole area which is transparent - drawn as white, sometime it have some rectangular shape around the object which is painted white, while the transparent is kept inside the inner part of the object.
I am not sure under what circumstance is happening the both of these things.

An suggestion: You can add multiple styles on a layer and multiple styles on a individual feature. When drawing all are combined. Make sure there are no other styles for the layer.
todo: add to wiki
I am currently placing in one layer a few hundreds different markers, each of them created as a separate feature with own styles.
and there is a few tens of layers with such properties..
A new layer is created with a style on the layer. You have to set it explicitly to null.
var layer = new Layer("Layer")
{
// .... other initialization
Style = null
};
Also worth a check. What does this look like in WPF?
Will report in 14 hours when back at work ( I just forgot to took the test
project with me :| ).
On Thu, Jan 26, 2017 at 6:51 PM, Paul den Dulk notifications@github.com
wrote:
Also worth a check. What does this look like in WPF?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/pauldendulk/Mapsui/issues/122#issuecomment-275442039,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGO0N90yTlrTuyh9A8EYhKbH8aH1F-yHks5rWM8VgaJpZM4LuYt3
.
--
Yordan Yanakiev
design & software architectures

WPF's seems fine.. :|
Tested with 1.5 and 2 SymbolSyze
private static ILayer CreateLayerWithStyleOnFeature(BoundingBox envelope, int count = 25)
{
var style = CreateBitmapStyle("Mapsui.Samples.Common.Images.loc.png");
return new Layer("Style on feature")
{
DataSource = new MemoryProvider(GenerateRandomFeatures(envelope, count, style)),
Style = null
};
}
( Mapsui.Samples.Common.Images.loc.png - it's the red marker in this case )
Seems like "Style = null" does not affect much the transparency ( at least in this case ).
Okay, interesting. I will look at it this afternoon.

It's the source of the project ( my test archive of mapsui ), just rename it to .zip from .png ( since there is some kind of bug which prevents me to upload zip's.. )
I can run your sample and reproduce the problem. Still quite mystified. The black symbol also has a white outline, but is not modified. If the red symbol is not loaded the black symbol does not have the white outline. So the red symbol messes up the rendering of other images. :(
:O ...
It's part of my project which were working fine till 1.0 update..
Anyway - I can redo my images to any format which they will be fine, but I am not sure what is the cause and how to fix it :|
Probably something related with SKIA's new render. Maybe it took something as a public static somewhere..
Solved. ( maybe ( or at least at some level ) ).
Seems like Photoshop put some weird data inside the PNG's with it's embed PNG converter.
I've found a plugin which solve this issue trough so called "Clear Transparency".
Installed it, and resaved all of my PNG files.
Everything is looking even better now ! The pictures is much more clear somehow from whitish fragments on the borders.
http://www.fnordware.com/superpng/

This settings I have used on my markers, and it achieved really good results.
This is the underlying bug https://github.com/mono/SkiaSharp/issues/282
It has a nice minimal sample demonstrating the problem.
See also this: https://forums.xamarin.com/discussion/88793/scaling-transparent-png-images.
Most helpful comment
Okay, interesting. I will look at it this afternoon.