It is currently Sat Nov 28, 2020 12:34 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Done] PB 5.72 LTS Beta 2 Qt - CopyImage bug
PostPosted: Thu Mar 12, 2020 1:09 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 589
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:
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


Top
 Profile  
Reply with quote  
 Post subject: Re: [PB 5.72 LTS Beta 2 Qt] - CopyImage bug
PostPosted: Tue Nov 17, 2020 3:38 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14179
Location: France
Fixed.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye