简体   繁体   English

MAUI (Android) SurfaceView

[英]MAUI (Android) SurfaceView

I need a Android.Views.SurfaceView component to draw on.我需要一个Android.Views.SurfaceView组件来绘制。
I placed a Microsoft.Maui.Controls.BoxView component then tried to reach it's platform object using我放置了一个Microsoft.Maui.Controls.BoxView组件,然后尝试使用 object 到达它的平台
var platformHandler = compname.Handler.PlatformView; but I receive Android.Views.View which doesn't have/relate a Android.Views.Surface object like I need.但我收到Android.Views.View没有/相关的Android.Views.Surface object 就像我需要的那样。

Is there any component with a SurfaceView or Surface 'related' object I can use?我可以使用带有SurfaceViewSurface '相关' object 的任何组件吗?
Maybe a way to extract a Surface object from the Android.Views.View ?也许一种从Android.Views.View中提取Surface object 的方法?

Since .NET MAUI is a cross-platform framework for creating native mobile and desktop apps with C# and XAML, you can try to use Microsoft.Maui.Graphics to achieve this.由于.NET MAUI是一个跨平台框架,用于使用 C# 和 XAML 创建原生移动和桌面应用程序,您可以尝试使用Microsoft.Maui.Graphics来实现这一点。

.NET Multi-platform App UI (.NET MAUI) graphics, in the Microsoft.Maui.Graphics namespace, enables you to draw graphical objects on a canvas that's defined as an ICanvas object. .NET Microsoft.Maui.Graphics命名空间中的多平台应用程序 UI (.NET MAUI) 图形使您能够在定义为ICanvas ZA8CFDE6331BD59EB2AC96F8911C4B666 的 canvas 上绘制图形对象

The .NET MAUI GraphicsView control provides access to an ICanvas object, on which properties can be set and methods invoked to draw graphical objects. .NET MAUI GraphicsView控件提供对ICanvas object 的访问,可以在其上设置属性和调用方法以绘制图形对象。 For more information about the GraphicsView , see GraphicsView .有关GraphicsView的更多信息,请参阅GraphicsView

For more information, please check: Draw graphical objects .更多信息请查看: 绘制图形对象

Besides, .NET MAUI graphics includes the ability to paint graphical objects with solid colors, gradients, repeating images, and patterns.此外, .NET MAUI图形还包括使用固体 colors、渐变、重复图像和图案绘制图形对象的能力。 The Paint class is an abstract class that paints an object with its output. Paint class 是一个抽象的 class,它用 Z78E6221F6393D13566681DB398F1CE 绘制 object。 Classes that derive from Paint describe different ways of painting an object.派生自 Paint 的类描述了绘制 object 的不同方法。

For more information, please check: Paint graphical objects .有关更多信息,请查看: 绘制图形对象

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM