首页
社区
课程
招聘
[求助]小虾求教win32_SDK截屏问题...
发表于: 2007-5-9 18:11 5998

[求助]小虾求教win32_SDK截屏问题...

2007-5-9 18:11
5998

大牛们...SDK截取全屏幕怎么样可以直接压缩成png或者jpg阿?

typedef struct tagBITMAPINFOHEADER{
  DWORD  biSize;
  LONG   biWidth;
  LONG   biHeight;
  WORD   biPlanes;
  WORD   biBitCount;
  DWORD  biCompression;
  DWORD  biSizeImage;
  LONG   biXPelsPerMeter;
  LONG   biYPelsPerMeter;
  DWORD  biClrUsed;
  DWORD  biClrImportant;
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;

biCompression
Specifies the type of compression for a compressed bottom-up bitmap (top-down DIBs cannot be compressed). This member can be one of the following values. Value Description
BI_RGB An uncompressed format.
BI_RLE8 A run-length encoded (RLE) format for bitmaps with 8 bpp. The compression format is a 2-byte format consisting of a count byte followed by a byte containing a color index. For more information, see Bitmap Compression.  
BI_RLE4 An RLE format for bitmaps with 4 bpp. The compression format is a 2-byte format consisting of a count byte followed by two word-length color indexes. For more information, see Bitmap Compression.
BI_BITFIELDS Specifies that the bitmap is not compressed and that the color table consists of three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. This is valid when used with 16- and 32-bpp bitmaps.
BI_JPEG Windows 98/Me, Windows 2000/XP: Indicates that the image is a JPEG image.
BI_PNG Windows 98/Me, Windows 2000/XP: Indicates that the image is a PNG image.


要怎么使用呢?

CImage类也好用但是怎么存储文件到内存里面?
我只会存到文件...

我想截取全屏幕而且可以自由选取位图是32bit 16bit还是256色的话怎么做呢?
我现在只会截取全屏幕的bmp(我想截取压缩后的格式还可以只有选取颜色位数的)...
而且是24bit的...

求大虾发个代码片段..

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 796
活跃值: (370)
能力值: ( LV9,RANK:380 )
在线值:
发帖
回帖
粉丝
2
"怎么存储文件到内存里面"

这个不是简单吗?打开文件,然后分配一块内存,锁定就可以了貌似
2007-5-9 18:20
0
雪    币: 214
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
不是这个意思..我是截取屏幕要传送出去..
不想先存到硬盘又读取文件再传送...
我现在是自己用zlib压缩了传出去....
不知道怎么改变截取图片的颜色深度?
例如截取256色的咋做?~
2007-5-9 19:07
0
雪    币: 203
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
建议你看看cximage里面有source   code   ,把bmp转成jpg
2007-5-9 22:57
0
雪    币: 203
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
或者采用 [Bmp2Jpg_OCX.zip] - BMP to JPG OCX 控件。可有应用程序直接调用。
2007-5-9 22:59
0
雪    币: 214
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
[QUOTE=ambiel;307204]或者采用 [Bmp2Jpg_OCX.zip] - BMP to JPG OCX 控件。可有应用程序直接调用。[/QUOTE]

谢谢回复阿...我就是想知道不用控件的..自己写的话..
用控件太大了...
2007-5-10 00:05
0
游客
登录 | 注册 方可回帖
返回
//