I placed a small tool on our web site called ImDIB which may be helpful in batch programming. We are using it to create test files and to automate simple image editing. I touched it some days ago to demonstrate that there is a small problem with Irfanview pasting topdown DIBs from the clipboard (topdown DIBs are not common). Maybe it is useful for some of you. Tell us if you like to get enhancements.
Code:
>imdib /?
Usage: imdib [command] {option} {operation} [file]
Handles device independent bitmaps (DIBs and BMPs).
Commands:
/help Show this help text.
/copy Copy new bitmap or bitmap from file to clipboard.
/paste Paste bitmap from clipboard to file or show info.
/new Create new bitmap and save it to file or show info.
/edit Edit bitmap on clipboard or in file.
/version Show the version information of the executable.
Options:
/width=... Sets the width of the bitmap in pixel (default: 640px)
/height=... Sets the height of the bitmap in pixel (default: 480px)
/bitcount=... Sets the size of a pixel (default: 24bits)
/bitfields Sets BI_BITFIELDS for bitcount 16 or 32 (default: BI_RGB)
/gray Sets the color table to gray colors
/backcolor=... Sets background color (default: white 0xFFFFFF)
/forecolor=... Sets foreground color (default: black 0x000000)
/info Show bitmap infos (default: don't show)
/verbose Be verbose during execution (default: silent)
/pause Pause after execution (default: don't pause)
Operations:
/topdown Sets the bitmap type to topdown (default: bottomup)
/bottomup Sets the bitmap type to bottomup
/dpm=... Sets the resolution in dots per meter (default: 96dpi)
.hor=... Sets horizontal resolution in dots per meter
.ver=... Sets vertical resolution in dots per meter
/dpi=... Sets the resolution in dots per inch (default: 96dpi)
.hor=... Sets horizontal resolution in dots per inch
.ver=... Sets vertical resolution in dots per inch
/select Selects the whole bitmap
.shrink=... Shrinks the selection by value (expand if < 0)
.move=... Shrinks the selection by value
.left=... Sets the left border of the selection
.right=... Sets the right border of the selection
.top=... Sets the top border of the selection
.bottom=... Sets the bottom border of the selection
.width=... Sets the width of the selection
.height=... Sets the height of the selection
/fill Fills the selection
.color=... Sets the color used for fill (-1: use forecolor; default: -1)
/frame=... Frames the selection using given width (outside if <0)
.color=... Sets the color of frame (-1: use forecolor; default: -1)
/text=... Draw text aligned to the selection (default: no text)
.font=... Sets the fontname used to draw text (default: Arial)
.size=... Sets the fontsize used to draw text (default: 10pts)
.align=... Sets the alignment in degrees (0: center; default: 0)
.color=... Sets the color of text (-1: use forecolor; default: -1)
Remarks:
The default command is /paste. Only one command is allowed.
Operations are handled between get and put of the bitmap.
Multiple Operations are allowed. The order will be respected.
Sub-operations like /text.color don't show their prefix in this help.
Examples:
imdib Paste bitmap from clipboard and show info.
imdib /copy Copy a bitmap created from defaults to clipboard.
imdib /edit /bottomup Make sure that the bitmap on clipboard is bottomup.
imdib /new test.bmp Store a bitmap created from defaults in "test.bmp".
>