It is currently Wed Jun 19, 2013 1:14 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [Solved]Help save Pixbuf on the disk
PostPosted: Fri May 25, 2012 4:13 am 
Offline
User
User
User avatar

Joined: Mon Apr 04, 2011 3:56 am
Posts: 49
Location: Russia,Angarsk
The Pixbuf it ImageID(Nb_Image)?
How to know the number of the Image - "Nb_Image", to save on the disk?
Code:
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)

_________________
Linux Mint Maya(Mate), x86, PureBasic 5.00(5.10b1)


Last edited by lakomet on Fri May 25, 2012 5:14 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Help save Pixbuf on the disk
PostPosted: Fri May 25, 2012 4:35 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
Code:
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.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: Help save Pixbuf on the disk
PostPosted: Fri May 25, 2012 5:09 am 
Offline
User
User
User avatar

Joined: Mon Apr 04, 2011 3:56 am
Posts: 49
Location: Russia,Angarsk
ts-soft
Thank you!

_________________
Linux Mint Maya(Mate), x86, PureBasic 5.00(5.10b1)


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 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