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

How I can get image size after loading?

$
0
0

I need to wait for loading image and then return width and height to the main thread. I tried FFImageLoading but can't understand how return size to main thread because finally I need to return View. Because of void delegate for event imageGlassLiquid.Success I can't return Task. I thought about something like this:

CachedImage imageGlassLiquid = new CachedImage
{
      Source = cocktailRecipe.ConstructCocktailGlassLiquidPath,                
};
Await imageGlassLiquid.Success += (sender, e) =>
{
       var h = e.ImageInformation.OriginalHeight;
       var w = e.ImageInformation.OriginalWidth;
 };
make something with h and w in main code

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>