Page 1 of 1

[Solved]Help save Pixbuf on the disk

Posted: Fri May 25, 2012 4:13 am
by lakomet
The Pixbuf it ImageID(Nb_Image)?
How to know the number of the Image - "Nb_Image", to save on the disk?

Code: Select all

ExamineDesktops()
x = 0
y = 0
w = DesktopWidth(0)
h = DesktopHeight(0)
If OpenWindow(0, x, y, w, h, "2D Drawing Test", #PB_Window_Invisible)
     *src.GdkDrawable = gdk_window_lookup_(gdk_x11_get_default_root_xwindow_())  
     *pixbuf = gdk_pixbuf_get_from_drawable_(#Null, *src, #Null, #Null, #Null, x, y, w, h)
     ImageGadget(0, x, y, w, h, *pixbuf)
     HideWindow(0, 0)
     
     Repeat
          EventID = WaitWindowEvent() 
     Until EventID = #PB_Event_CloseWindow
     
EndIf
sorry for bad english(google-translate)

Re: Help save Pixbuf on the disk

Posted: Fri May 25, 2012 4:35 am
by ts-soft

Code: Select all

ExamineDesktops()
x = 0
y = 0
w = DesktopWidth(0)
h = DesktopHeight(0)
If OpenWindow(0, x, y, w, h, "2D Drawing Test", #PB_Window_Invisible)
  *src.GdkDrawable = gdk_window_lookup_(gdk_x11_get_default_root_xwindow_()) 
  *pixbuf = gdk_pixbuf_get_from_drawable_(#Null, *src, #Null, #Null, #Null, x, y, w, h)
  ImageGadget(0, x, y, w, h, *pixbuf)
  HideWindow(0, 0)
  If CreateImage(0, w, h)
    StartDrawing(ImageOutput(0))
      DrawImage(*pixbuf, 0, 0)
    StopDrawing()
    SaveImage(0, "/home/thomas/test.bmp")
  EndIf
  Repeat
    EventID = WaitWindowEvent()
  Until EventID = #PB_Event_CloseWindow
  
EndIf 

Re: Help save Pixbuf on the disk

Posted: Fri May 25, 2012 5:09 am
by lakomet
ts-soft
Thank you!