Well it seems I got the concept way back from v9 and have an inherited class from AdornmentLayer that overrides the DrawCore method.
Any idea why this code would not work anymore?
protected override void DrawCore(GeoCanvas canvas, Collection<SimpleCandidate> labelsInAllLayers)
{
var logo = new GeoImage(logoImage);
if (IsVisible)
{
ScreenPointF screenPointF = GetDrawingLocation(canvas, logoImage.Width, logoImage.Height);
// If the canvas happens to be using GDI+ then we can do an optimization and skip
// the GeoImage. Otherwise we go the longer route in the else statement
if (canvas is PlatformGeoCanvas)
{
PlatformGeoCanvas PlatformGeoCanvas = canvas as PlatformGeoCanvas;
PlatformGeoCanvas.DrawScreenImageWithoutScaling(logo, screenPointF.X + logoImage.Width * 0.5f, screenPointF.Y + logoImage.Height * 0.5f, DrawingLevel.LevelOne, -10f, -10f, 0f);
//screenPointF.X + logoImage.Width * 0.5f, screenPointF.Y + logoImage.Height * 0.5f, DrawingLevel.LevelOne, -10, -10, 0);
}
else
{
// Here we have to convert the stream to a TIFF to be used in the GeoImage
Stream stream = new MemoryStream();
logoImage.Save(stream, ImageFormat.Tiff);
GeoImage geoImage = new GeoImage(stream);
canvas.DrawScreenImageWithoutScaling(geoImage, screenPointF.X + logoImage.Width * 0.5f, screenPointF.Y + logoImage.Height * 0.5f, DrawingLevel.LevelOne, -10, -10, 0);
}
}
}