[Done] PB 5.72 LTS Beta 2 Qt - CopyImage bug

Post bugreports for the Linux version here
wombats
Enthusiast
Enthusiast
Posts: 601
Joined: Thu Dec 29, 2011 5:03 pm

[Done] PB 5.72 LTS Beta 2 Qt - CopyImage bug

Post by wombats »

There appears to be a problem with CopyImage if the image you are trying to copy has been used as a gadget item image.

It crashes with "Invalid memory access" at the end of the program. Works fine on GTK.

Code: Select all

EnableExplicit

Enumeration
  #Window
  #Tree
  #Canvas
EndEnumeration

Define img, icon

img = CreateImage(#PB_Any, 16, 16, 24)
If StartDrawing(ImageOutput(img))
  Box(0, 0, OutputWidth(), OutputHeight(), RGB(0, 0, 255))
  StopDrawing()
EndIf

OpenWindow(#Window, 0, 0, 320, 240, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

TreeGadget(#Tree, 10, 10, 100, 200)
AddGadgetItem(#Tree, -1, "Item 1", ImageID(img))

icon = CopyImage(img, #PB_Any)
CanvasGadget(#Canvas, 120, 10, 50, 50)
If StartDrawing(CanvasOutput(#Canvas))
  DrawImage(ImageID(icon), 10, 10)
  StopDrawing()
EndIf
FreeImage(icon)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Fred
Administrator
Administrator
Posts: 14296
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [PB 5.72 LTS Beta 2 Qt] - CopyImage bug

Post by Fred »

Fixed.
Post Reply