0
<StackLayout Grid.Row="1" Grid.Column="0" BackgroundColor="#57bcec" Padding="5" Orientation="Horizontal">
    <ContentView Padding="5,0,0,0">
        <ffimageloading:CachedImage DownsampleToViewSize="True" HorizontalOptions="Center" VerticalOptions="Center"
                                    ErrorPlaceholder="{Binding PlaceholderImage}" LoadingPlaceholder="{Binding PlaceholderImage}" 
                                    Source="{Binding UserImage, Converter={Helper:ImageSourceConverter}}"
                                    Aspect="AspectFit">
            <ffimageloading:CachedImage.WidthRequest>
                <OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40" WinPhone="40" />
            </ffimageloading:CachedImage.WidthRequest>
            <ffimageloading:CachedImage.HeightRequest>
                <OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40" WinPhone="40" />
            </ffimageloading:CachedImage.HeightRequest>
            <ffimageloading:CachedImage.Transformations>
                <fftransformations:CircleTransformation BorderSize="3" BorderHexColor="#34C04E"/>
            </ffimageloading:CachedImage.Transformations>
        </ffimageloading:CachedImage>
    </ContentView>
    <ContentView Padding="10,0,0,0" VerticalOptions="FillAndExpand">
        <Label Text="Alan Parker" FontSize="14" FontFamily="{StaticResource Lato_Regular}" TextColor="White" VerticalOptions="Center" />
    </ContentView>
</StackLayout>

图片网址:https ://images.app.goo.gl/ZLSN5x9VNeebTD6z8

输出:注意图像从角落被截断

在此处输入图像描述

正常图像:

在此处输入图像描述

4

1 回答 1

0

我找到了一种方法来做到这一点。

我用过:https ://github.com/daniel-luberda/DLToolkit.Forms.Controls/tree/master/ImageCropView

<imgcrop:ImageCropView HeightRequest="50" WidthRequest="50" x:Name="cropView"
        Source="https://anothercommonman.files.wordpress.com/2011/10/gandhiji.jpg">
        <imgcrop:ImageCropView.PreviewTransformations>
                <ffTransformations:CircleTransformation />
        </imgcrop:ImageCropView.PreviewTransformations>
</imgcrop:ImageCropView> 
于 2019-12-05T09:05:34.180 回答