[Solved]Help save Pixbuf on the disk

Linux specific forum
lakomet
User
User
Posts: 53
Joined: Mon Apr 04, 2011 3:56 am
Location: Russia,Angarsk

[Solved]Help save Pixbuf on the disk

Post 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)
Last edited by lakomet on Fri May 25, 2012 5:14 am, edited 1 time in total.
Linux Mint Maya(Mate), x86, PureBasic 5.00(5.10b1)
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Help save Pixbuf on the disk

Post 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 
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
lakomet
User
User
Posts: 53
Joined: Mon Apr 04, 2011 3:56 am
Location: Russia,Angarsk

Re: Help save Pixbuf on the disk

Post by lakomet »

ts-soft
Thank you!
Linux Mint Maya(Mate), x86, PureBasic 5.00(5.10b1)
Post Reply