![]() |
|
#1
|
|||
|
|||
Save screen as .bmp imagehi all,
I created a window and i am able to do free hand draw on the window using mouse by handling mouse events. Now i want to save the image on the window as bmp image file please give me a solution how to get the pixel buffer from the window. waiting for a reply..... |
|||
|
#2
|
|||
|
|||
Re: save screen as bmp imagehi all,
i found the solution for this use fl_read_image() function to read the pixel data to a buffer. and write your own bmpfile creator code (writing the code for bmp file creation is easy) if any possible solutions are there please post them |
|
#3
|
|||
|
|||
Re: Save screen as .bmp imageHi
Could you post your code ? I need to exactly the same thing in my program. |
|
#4
|
|||
|
|||
Re: Save screen as .bmp imagehi ERetana,
i thought of posting the code before itself but the code i wrote is very limited one ,any way i am posting my code ************************************************** ****** CPP / C++ / C Code:
this is highly hardcoded one manually set width to 500, height to 150, depth to 24 bits. the image u get is a inverted image i wrote this code to check screen shot is working or not its working fine for me use this function call to store the pixel buffer to 'p' fl_read_image(p,0,0,500,150,0); where u call this function is up to your logic after this call function bmpcreate(const char *name); with regards hemadri.k Last edited by cable_guy_67 : 31-Jan-2008 at 04:51.
Reason: Please surround your C++ code with [cpp] your code [/cpp]
|
|
#5
|
|||
|
|||
Re: Save screen as .bmp imageDid you manage to get it not inverted? I am trying to do this too. I was thinking about using libgd which would allow to write files of several formats.
Frank |
|
#6
|
|||
|
|||
Re: Save screen as .bmp imageOn windows, the red and blue got inverted. Anyway, I got it to flip vertically.
|
Recent GIDBlog
Non-US citizens serving in the military by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Image onto JFrame | tedds | Java Forum | 8 | 25-Oct-2007 20:04 |
| need help with a console menu system | BullBuchanan | CPP / C++ Forum | 6 | 20-Aug-2006 14:46 |
| GIM gidedit - a fltk fluid resize project | cable_guy_67 | FLTK Forum | 2 | 01-Jun-2005 15:00 |
| Checking source codes of image, audio and video files | onauc | C Programming Language | 5 | 26-Feb-2005 21:47 |
| send pc image to tv screen?! | Hood | Computer Hardware Forum | 5 | 05-May-2004 11:51 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The