convert.h
上传用户:looem2003
上传日期:2014-07-20
资源大小:13733k
文件大小:1k
- #pragma once
- #include <Windows.h>
- #include <tchar.h>
- #include <commctrl.h>
- #include <string>
- #include "lang.h"
- #include "config.h"
- #include "resource.h"
- #include "ximage.h"
- #include <gdiplus.h>
- using namespace Gdiplus;
- #ifndef O_BINARY
- #define O_BINARY 0
- #endif
- struct BMPINFO
- {
- unsigned char *bits;
- int width;
- int height;
- int colours;
- unsigned char *palette;
- };
- extern INT_PTR CALLBACK dlg_convert(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_parce_marked(HWND, UINT, WPARAM, LPARAM);
- extern DWORD WINAPI thread_convert( LPVOID param );
- extern DWORD WINAPI thread_parce_marked( LPVOID param );
- extern BOOL convert_pjl_bmp( LPAPPCONFIG ac );
- extern int start_convert( LPCTSTR NamePcl, LPCTSTR NameBmp );
- extern int pcl2bmp( LPCTSTR NamePcl, LPCTSTR NameBmp, LPADDITIONALCONFIG aac );
- extern int bmp_save( LPCTSTR filename, BMPINFO *pbmpinfo );
- extern BOOL save_bitmap( LPCTSTR name, HBITMAP bitmap);
- extern BOOL convert_bitmap_to_monochrome( LPCTSTR inBmp, LPCTSTR outBmp, BOOL invert = TRUE);
- extern DWORD get_count_from_file( LPCTSTR fileName );
- class IfStream
- {
- public:
- IfStream( LPCTSTR fileName );
- int get();
- ULARGE_INTEGER get_file_size();
- BOOL read( char* buff, int len );
- void close();
- ~IfStream();
- private:
- HANDLE hFile;
- };
- class OfStream
- {
- public:
- OfStream( LPCTSTR fileName );
- void put( char ch );
- BOOL write( const char* buff, int len );
- void close();
- ~OfStream();
- private:
- HANDLE hFile;
- };