It is currently Thu Nov 26, 2020 7:45 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Done] GrabDrawingImage crash PB - overwrite memory PB560
PostPosted: Tue Sep 05, 2017 7:41 am 
Offline
Addict
Addict

Joined: Sat Mar 02, 2013 9:17 am
Posts: 930
GrabDrawingImage crash PB - overwrite memory PB560
561b1 not tested to time

Linux OK, Win vertical mirrored output

Code:
InitSprite()

  Procedure CopyContent_Sprite_Canvas_BF(source_ID, destination_ID)
    If Not StartDrawing(SpriteOutput(source_ID)) : ProcedureReturn -9 : EndIf
    Protected temp_image_ID=GrabDrawingImage(#PB_Any, 0 ,0, SpriteWidth(source_ID), SpriteHeight(source_ID))
    If Not temp_image_ID : StopDrawing() : ProcedureReturn -6 : EndIf
    StopDrawing()
    If Not StartDrawing(CanvasOutput(destination_ID)) : ProcedureReturn -5 : EndIf
    DrawImage(ImageID(temp_image_ID), 0, 0)
    StopDrawing()
    FreeImage(temp_image_ID)
  EndProcedure

OpenWindow(0, 0, 0, 800, 400,"", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 400, 400)
canvas=CanvasGadget(#PB_Any, 500, 100, 200, 200)

sprite=CreateSprite(#PB_Any, 200, 200)

StartDrawing(SpriteOutput(sprite))
DrawText(0, 0, "Hello World")
StopDrawing()

CopyContent_Sprite_Canvas_BF(sprite, canvas)

Repeat
  If WaitWindowEvent(1)=#PB_Event_CloseWindow : Break : EndIf
ForEver

_________________
http://www.nachtoptik.de


Top
 Profile  
Reply with quote  
 Post subject: Re: GrabDrawingImage crash PB - overwrite memory PB560
PostPosted: Sun Feb 23, 2020 11:13 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 4 guests


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