summaryrefslogtreecommitdiff
path: root/pages/screenshot.ecpp
blob: feafaab085f5bc90e988f4fea8bf725e23a03157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<%pre>
#include <iostream>
#include <vdr/device.h>
using namespace std;
</%pre>
<%args>
int quality = 80;
int width = 320;
int height = 240;
</%args>
<%cpp>
	reply.setContentType("image/jpg");

	cDevice* device = cDevice::PrimaryDevice();
	if ( device == 0 )
		return DECLINED;

	int size;
	uchar* image = device->GrabImage( size, true, quality, width, height );
	if ( image == 0 )
		return DECLINED;

	reply.out().write( reinterpret_cast< char* >( image ), size );
</%cpp>