Setting Clipboard.Picture crashes in win32 with 32-bit new style (GDI+) picture objects

Apparently under win32 builds, the new-style 32-bit pictures objects aren’t handled properly in the Clipboard, leading to a hard app crash.

Workaround is to convert the new-style picture back to an old-style picture:

  dim pNew as New Picture(width,height) // new style 32-bit picture (requires GDI+)
  ...
  dim c as new Clipboard

  // convert to old-style picture
  dim pOld as new picture(pNew.width,pNew.height,32)
  pOld.Graphics.DrawPicture pNew,0,0

  c.Picture = pOld

[quote=152194:@Michael Diehr]Apparently under win32 builds, the new-style 32-bit pictures objects aren’t handled properly in the Clipboard, leading to a hard app crash.

Workaround is to convert the new-style picture back to an old-style picture:

[code]
dim pNew as New Picture(width,height) // new style 32-bit picture (requires GDI+)

dim c as new Clipboard

// convert to old-style picture
dim pOld as new picture(pNew.width,pNew.height,32)
pOld.Graphics.DrawPicture pNew,0,0

c.Picture = pOld

[/code][/quote]

Please file a bug report with an example project attached.

<https://xojo.com/issue/37324>

Apologies, I didn’t mean to upload the raw 100MB DMP file - I should have zipped it first.

Thanks for the report. It’s nice to have cases with reproducible steps, example projects, and crash dumps.