首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FFImageLoading CircleTransformation不处理透明图像

FFImageLoading CircleTransformation不处理透明图像
EN

Stack Overflow用户
提问于 2019-11-25 12:29:45
回答 1查看 1.1K关注 0票数 0
代码语言:javascript
复制
<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

输出:注意到图像从角落被切断。

正常图像:

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-12-05 09:05:34

我找到了一个办法。

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

代码语言:javascript
复制
<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> 
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59031875

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档