Skip to content

[BUG] <title>skglControl1_SizeChanged Event new SKBitmap will cause visual studio Crash #3129

Open
@dzhydaniel

Description

Description

SkiaSharp version 3.116.1
Visual Studio 2022 Community Winform C# .net 4.7.2
When Open Form Designer Visual Studio Freeze and crash

Code

    private void skglControl1_SizeChanged(object sender, EventArgs e)
    {
        if (this.DesignMode)
        {
            return;
        }
            Disposable.SafeDispose(ref _BackBuffer);
            if (ParentForm?.WindowState != FormWindowState.Minimized)
            {
                if (ClientSize.Width > 0 && ClientSize.Height > 0)
                {
                    try
                    {
              

      _****//_BackBuffer = new SKBitmap(ClientSize.Width, ClientSize.Height);****_

                    }
                    catch (Exception ex){
                        // 记录异常信息
                        Console.WriteLine($"SKBitmap 初始化失败: {ex.Message}");
                    }
                    //CurrentState?.OnDeviceReset();
                    //skglControl1.Invalidate();
                }
            }
        

    }

Expected Behavior

No response

Actual Behavior

No response

Version of SkiaSharp

3.116.0 (Current)

Last Known Good Version of SkiaSharp

2.88.9 (Previous)

IDE / Editor

Visual Studio (Windows)

Platform / Operating System

Windows

Platform / Operating System Version

Windows 11 home

Devices

No response

Relevant Screenshots

No response

Relevant Log Output

No response

Code of Conduct

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions