|
|
| version 1.4, 2004/03/27 10:52:56 | version 1.5, 2004/06/21 15:19:15 |
|---|---|
| Line 8 | Line 8 |
| #include "dialogs.h" | #include "dialogs.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "scrnbmp.h" | #include "scrnsave.h" |
| #include "font.h" | #include "font.h" |
| Line 52 void dialog_font(HWND hWnd) { | Line 52 void dialog_font(HWND hWnd) { |
| void dialog_writebmp(HWND hWnd) { | void dialog_writebmp(HWND hWnd) { |
| SCRNBMP bmp; | SCRNSAVE ss; |
| FILESEL bmpui; | FILESEL bmpui; |
| char path[MAX_PATH]; | char path[MAX_PATH]; |
| FILEH fh; | const char *ext; |
| bmp = scrnbmp(); | ss = scrnsave_get(); |
| if (bmp) { | if (ss == NULL) { |
| bmpui.title = bmpui_title; | return; |
| bmpui.ext = str_bmp; | } |
| bmpui.filter = bmpui_filter[bmp->type]; | bmpui.title = bmpui_title; |
| bmpui.defindex = 1; | bmpui.ext = str_bmp; |
| file_cpyname(path, bmpfilefolder, sizeof(path)); | bmpui.filter = bmpui_filter[ss->type]; |
| file_cutname(path); | bmpui.defindex = 1; |
| file_catname(path, bmpui_file, sizeof(path)); | file_cpyname(path, bmpfilefolder, sizeof(path)); |
| if (dlgs_selectwritenum(hWnd, &bmpui, path, sizeof(path))) { | file_cutname(path); |
| file_cpyname(bmpfilefolder, path, sizeof(bmpfilefolder)); | file_catname(path, bmpui_file, sizeof(path)); |
| sysmng_update(SYS_UPDATEOSCFG); | if (dlgs_selectwritenum(hWnd, &bmpui, path, sizeof(path))) { |
| fh = file_create(path); | file_cpyname(bmpfilefolder, path, sizeof(bmpfilefolder)); |
| if (fh != FILEH_INVALID) { | sysmng_update(SYS_UPDATEOSCFG); |
| file_write(fh, bmp->ptr, bmp->size); | ext = file_getext(path); |
| file_close(fh); | if ((ss->type <= SCRNSAVE_8BIT) && |
| } | (!file_cmpname(ext, "gif"))) { |
| scrnsave_writegif(ss, path, SCRNSAVE_AUTO); | |
| } | |
| else if (!file_cmpname(ext, str_bmp)) { | |
| scrnsave_writebmp(ss, path, SCRNSAVE_AUTO); | |
| } | } |
| _MFREE(bmp); | |
| } | } |
| scrnsave_trash(ss); | |
| } | } |