ThinkGeo.com    |     Documentation    |     Premium Support

Performance: see-through layers encode a PNG per tile

In ThinkGeo.Core 15.0.0-beta154, Layer.DrawWithColorTransformation (used for every layer with Opacity < 1 ) renders the layer offscreen, applies the opacity into a new bitmap, and then calls GetImageBytes() followed by new GeoImage(bytes) . That is a full PNG encode and decode for every tile of every see-through layer, only to get a new image object.

Skia can draw the offscreen bitmap onto the tile with an alpha in one call ( SKPaint with an alpha colour), with no copy at all. Please replace the round trip with that.

Related: GeoImage.Opacity copies all pixels to managed memory and back. An opacity parameter on GeoCanvas.DrawWorldImageWithoutScaling / DrawScreenImageWithoutScaling would avoid that too.

Versions: ThinkGeo.Core / ThinkGeo.UI.Wpf 15.0.0-beta154, .NET 10, WPF.

Hi Julian,

You were right, and it’s now fixed in 15.0.0-beta159, have a try.

Note: An opacity parameter on DrawWorldImageWithoutScaling / DrawScreenImageWithoutScaling: that would be a key API change and would affect user’s classes, (as we need to also change the corresponding virtual Core method), so we didn’t do it. It’s on the list though.

Thanks,
Ben