Esempio n. 1
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();

            // load our background image
            var imageUrl       = viewModel.Location.PanoramaImage;
            var originalBitmap = await BitmapHelper.LoadBitmapFromUrl(imageUrl);

            // resize the image for the screen
            var     imageScale   = Panorama.CanvasSize.Height / originalBitmap.Height;
            SKSizeI newImageSize = new SKSizeI((int)(originalBitmap.Width * imageScale),
                                               (int)(originalBitmap.Height * imageScale));

            backgroundBitmap = originalBitmap.Resize(newImageSize, SKFilterQuality.High);

            foreach (var fish in viewModel.Location.Fish)
            {
                FishAnnotation annotation = await CreateAnnotations(fish);

                fishAnnotations.Add(fish, annotation);
            }


            Panorama.InvalidateSurface();
        }
Esempio n. 2
0
        private async Task <FishAnnotation> CreateAnnotations(FishModel fish)
        {
            var annotation = new FishAnnotation();
            // create an image for the fish
            await annotation.CreateAnnotations(fish);

            return(annotation);
        }