Skip to content

SKGLControl : Object reference not set to an instance of an object. #2676

Open
@maiad

Description

@maiad

Description

When I run application with SKGLControl on systen, which does not support GL, I get null reference exception from

at SkiaSharp.Views.Desktop.SKGLControl.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

I expected exception when I create SKGLControl, not later... How can I detect, if I have to create SKControl instead of SKGLControl ?

Expected Behavior

Exception when I create SKGLControl

Actual Behavior

Exception inside SKGLControl.OnPaint

Version of SkiaSharp

2.88.3 (Current)

IDE / Editor

Visual Studio (Windows)

Platform / Operating System

Windows

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready For Work

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions