Skip to content

Image rotation using Fabulous.XamarinForms.FFImageLoading? #17

@gaelian

Description

@gaelian

Question / Discussion

I'm trying to translate this C# code for use with Fabulous.XamarinForms.FFImageLoading:

var t = ImageService.Instance.LoadStream(async c => await image.OpenReadAsync()); // image is a Xamarin.Essentials.FileResult.
t.Transform(new RotateTransformation(90));
using var imageStream = await t.AsPNGStreamAsync();

I've gotten this far in F#:

let t = FFImageLoading.ImageService.Instance.LoadStream(fun _ -> image.OpenReadAsync())
t.Transform(FFImageLoading.Transformations.RotateTransformation(90.)) |> ignore
use! imageStream = t.AsPNGStreamAsync() |> Async.AwaitTask

But in my F# code the AsPNGStreamAsync extension method cannot be found.

I also don't understand why open Fabulous.XamarinForms.FFImageLoading or open FFImageLoading both don't seem to work and I need to use use FFImageLoading.ImageService ... and FFImageLoading.Transformations ... instead. But I suspect this may have something to do with my problem.

Can anyone tell me what I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions