From: "Abhilash" <abhilash@avenir.net>
To: inux-fbdev-devel@lists.sourceforge.net,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Frame buffer Reading fails!!
Date: Fri, 3 Jan 2003 21:18:51 +0530 [thread overview]
Message-ID: <00df01c2b33f$a1354690$bd00000a@abhilash> (raw)
[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]
Hello,
As u suggested I tried following code in RedHat7.1.
But it shows
"The framebuffer device was opened successfully."
"Error reading fixed information."
What could be the problem?
I am new to this.
Thank you,
Abhilash.
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
int main()
{
int fbfd = 0;
struct fb_var_screeninfo vinfo;
struct fb_fix_screeninfo finfo;
long int screensize = 0;
char *fbp = 0;
int x = 0, y = 0;
long int location = 0;
// Open the file for reading and writing
fbfd = open("/dev/fb0", O_RDWR);
if (!fbfd) {
printf("Error: cannot open framebuffer device.\n");
exit(1);
}
printf("The framebuffer device was opened successfully.\n");
// Get fixed screen information
if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo)) {
printf("Error reading fixed information.\n");
exit(2);
}
}
----- Original Message -----
From: "Geert Uytterhoeven" <geert@linux-m68k.org>
To: "Abhilash" <abhilash@avenir.net>
Cc: "Linux Frame Buffer Device Development"
<linux-fbdev-devel@lists.sourceforge.net>
Sent: Friday, December 27, 2002 5:03 PM
Subject: Re: [Linux-fbdev-devel] Screen Capturing
> On Fri, 27 Dec 2002, Abhilash wrote:
> > I need to capture the screen .For that I use mirror driver in
Windows
for
> > capturing screen.
> > ie, its basically overloading the driver functions.
> >
> > So in case of Linux, is there any method like this or which is the
best
> > method?
> > In Xlib there are some functions to capture screen and also heard
abt
VESA
> > which is better?
>
> If you are using a frame buffer device, you can capture the contents
of
> /dev/fb*. Either read from /dev/fb*, or mmap() it. The data you
receive
are in
> the native format of the graphics chip. For CLUT modes, you have to
use an
> ioctl() to get the colormap.
>
> Gr{oetje,eeting}s,
>
> Geert
[-- Attachment #2: Type: text/html, Size: 3272 bytes --]
next reply other threads:[~2003-01-04 10:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-03 15:48 Abhilash [this message]
2003-01-04 11:06 ` Frame buffer Reading fails!! Antonino Daplas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='00df01c2b33f$a1354690$bd00000a@abhilash' \
--to=abhilash@avenir.net \
--cc=geert@linux-m68k.org \
--cc=inux-fbdev-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).