Jump to content
Sign in to follow this  
frankzappa

Saving monochromatic BMPs with ScreenCapture

Recommended Posts

frankzappa

Hey all,

i need to save a monochromatic BMP file. I've been using ScreenCapture for these kind of tasks, so i was trying to stick with it. The problem is that ScreenCapture doesn't save monochromatic files normally.

I checked the code and GDIPLus (called by ScreenCapture) does have the possibility to save these kind of files:

CODE
; Pixel Format constants

Global Const $GDIP_PXF01INDEXED = 0x00030101 ; 1 bpp, indexed

So i changed the code for ScreenCapture.au3 (had to save it somewhere else and change its name) to allow me save monochromatic BMPs. The problem is that the file is not created, so i think this may be a bug from GDIPlus.

The code edited in ScreenCapture:

CODE
Func _ScreenCapture_SetBMPFormat($iFormat)

Switch $iFormat

Case 0

$giBMPFormat = $GDIP_PXF16RGB555

Case 1

$giBMPFormat = $GDIP_PXF16RGB565

Case 2

$giBMPFormat = $GDIP_PXF24RGB

Case 3

$giBMPFormat = $GDIP_PXF32RGB

Case 4

$giBMPFormat = $GDIP_PXF32ARGB

Case 5

$giBMPFormat = $GDIP_PXF01INDEXED ;edited

Case Else

$giBMPFormat = $GDIP_PXF24RGB

EndSwitch

EndFunc ;==>_ScreenCapture_SetBMPFormat

I've checked if saving BMP in the normal formats was working, everythings fine as long as i stick to case 2 ($GDIP_PXF24RGB).

So, does anyone had this problem oneday?

cheers.

Share this post


Link to post
Share on other sites
frankzappa

hoho, i think this one must be a bug....

Anyway, i found a way to work the thing around.

cheers.

Share this post


Link to post
Share on other sites
ChrisL

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×