LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-02-2007, 12:16 AM   #1
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Working on pseudo-transparency in GDK


As the title says, I'm working on it, but it's not going so hot. So, here's what I've got so far:

Code:
#include <gdk/gdk.h>

int main(int argc, char** argv)
{
  gdk_init(&argc, &argv);
  int width, height;
  GdkWindow* root = gdk_get_default_root_window();
  gdk_drawable_get_size(root, &width,&height);
  GdkPixbuf* theImage = gdk_pixbuf_get_from_drawable(NULL,
				   root, gdk_colormap_get_system(),
						     0,0,0,0,width,height);
  GdkWindowAttr newAttr;
  newAttr.title = "Screenshot";
  newAttr.wclass = GDK_INPUT_OUTPUT;
  newAttr.window_type = GDK_WINDOW_TOPLEVEL;
  GdkWindow* newWin = gdk_window_new(NULL, &newAttr, GDK_WA_TITLE);
  gdk_window_show(newWin);
  gdk_window_fullscreen(newWin);

  gdk_draw_pixbuf(newWin, NULL, theImage, 0,0, 0,0, -1, -1, 
		  GDK_RGB_DITHER_NONE,0,0);

  system("sleep 5");
  return 0;
}
The end result is always the newWin is created, it is fullscreened, but it is entirely black. Somehow, gdk_pixbuf_get_from_drawable isn't grabbing the screenshot. Can anyone spot my mistake? Although I write most of my GUI's in gtk, this is my first real venture into gdk.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pseudo-Xinerama someone Linux - Software 0 08-25-2005 10:42 PM
Regarding Pseudo tty, Pseudo terminals ? mqureshi Programming 0 07-30-2005 10:51 AM
Partial Transparency not working when using xsetbg ! Libu Linux - Software 2 02-05-2005 04:50 AM
Pseudo Terminal Problems ailiez Programming 2 02-09-2004 01:58 AM
Real vs Pseudo Transparency candyman123 Linux - Software 2 07-07-2003 05:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration