我需要一个Android.Views.SurfaceView
组件来绘制。
我放置了一个Microsoft.Maui.Controls.BoxView
组件,然后尝试使用var platformHandler = compname.Handler.PlatformView;
,但我收到了Android.Views.View
,它没有/关联我需要的Android.Views.Surface
对象。
是否有任何包含SurfaceView
或Surface
“相关”对象的组件可以使用?
也许有一种方法可以从Android.Views.View
中提取Surface
对象?
1条答案
按热度按时间iszxjhcz1#
Since
.NET MAUI
is a cross-platform framework for creating native mobile and desktop apps with C# and XAML, you can try to useMicrosoft.Maui.Graphics
to achieve this..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 anICanvas
object.The .NET MAUI
GraphicsView
control provides access to anICanvas
object, on which properties can be set and methods invoked to draw graphical objects. For more information about theGraphicsView
, see 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. ThePaint
class is an abstract class that paints an object with its output. Classes that derive from Paint describe different ways of painting an object.For more information, please check: Paint graphical objects .