Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Change SKSurface height dynamically

$
0
0

Hello,

Thank you for this awesome library. It works really well.
I have one question. We are drawing on SKSurface at runtime based on the _ImageInfos collection.
Though Height property is required at the time of 'SKSurface.Create', we have no idea how height it will be.

So when we call surface.Snapshot(), we will not get the full image, but up to initial height.

can we set the surface height based on the Y ?

using (var surface = SKSurface.Create(width: 300, height: 700, colorType: SKImageInfo.PlatformColorType, alphaType: SKAlphaType.Premul))
{
using (var canvas = surface.Canvas)
{
foreach(var imageinfo in _ImageInfos)
{
canvas.DrawImage(imageinfo.Image, X, Y);
//Get Image Height and Set new Y Location
canvas.DrawText(imageinfo.Message, X, Y);
//Get Text Height and Set new Y Location
}
}
}

Thank you.
Nand..


Viewing all articles
Browse latest Browse all 204402

Trending Articles