首页 > 解决方案 > Xamarin Froms 和 SkiaSharp,突出显示图像上的区域

问题描述

我使用下面的代码在 from 上显示图像。

<ContentPage>
        <ContentPage.Content>
                <Grid>
                      // Row definitions here
                      // Column definitions here
                      <Image 
                            Grid.Column="0" 
                            Grid.Row="0"
                            x:Name="myStoryPage"
                            Grid.ColumnSpan="3">                
                      </Image>

                      <!-- Next, previous buttons here -->

                      <skiaforms:SKCanvasView x:Name="canvasView"
                                PaintSurface="canvasView_PaintSurface"
                                Grid.Row="3"
                                Grid.Column="0"
                                Grid.ColumnSpan="3"
                                AbsoluteLayout.LayoutBounds="10, 0, 5, 65"/>

                </Grid>
        </ContentPage.Content>
</ContentPage>

现在我需要使用 SkiaSharp 突出显示图像中的一个区域。我可以使用SKCanvasView. 但我想在图像上绘制。

我想使用 useAbsoluteLayout但由于我的页面是 a ContentPage,我无法使用AbsoluteLayout内容的外部。

如果可以使用 ,我可以在后面的代码AbsoluteLayout中动态定位它。C#

标签: xamarin.formsdrawingskiasharpskia

解决方案


推荐阅读