GIDForums  

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Apr-2009, 17:05
m2asselin m2asselin is offline
New Member
 
Join Date: Apr 2009
Posts: 2
m2asselin is on a distinguished road

Capture image of screen/window to make transparent


Hello,

I am trying to use fl_read_image() to capture a screen shot of the widgets that I have added to a window, such that I can add an alpha channel and redisplay it, but with some opacity added.

It is not working for me as it only captures the screen beneath my fltk window.

this is the code i have used:

CPP / C++ / C Code:
int main()
{
   Fl_Double_Window win( 100,100,500,500,0 );
   
   Fl_Box box1( FL_RFLAT_BOX, 0,0,200,200,0 );
   Fl_Box box2( FL_ROUNDED_BOX, 250,250,200,200,0 );
   Fl_Button but1( 25,25,100,50,0 );
   win.end();

   win.show();

   uchar *img = fl_read_image( NUL, 100,100,box1.w(),box1.h(),128 );
   Fl_RGB_Image rgbImg( img, box1.w(),box1.h(),4 ); 
   box2.image( rgbImg );

   return Fl::run();
}
Last edited by LuciWiz : 12-Apr-2009 at 14:02. Reason: Please insert your C++ code between [cpp] & [/cpp] tags
 
 

Recent GIDBlogReview: Gel laptop cooling pad by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
run script command on ns2.26 newbie06 Computer Software Forum - Linux 65 19-Aug-2009 08:50
I want to make an image transparent nish Python Forum 1 09-Nov-2007 12:38
Image onto JFrame tedds Java Forum 8 25-Oct-2007 21:04
Photoshop Tutorial: Make An Inspirational/Mystical Picture ToddSAFM Graphics Forum 9 09-Aug-2005 21:32

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:03.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.