![]() |
Wang Tiling
A Simple Wang Tiling Generator
|
Code for some helpful Windows-specific functions. More...
#include <shobjidl_core.h>#include <atlbase.h>#include "WindowsHelpers.h"#include "Includes.h"#include "resource.h"Go to the source code of this file.
Functions | |
| void | InitWindow (HINSTANCE hInst, INT nShow, WNDPROC WndProc) |
| Initialize window. More... | |
| ULONG_PTR | InitGDIPlus () |
| Initialize GDI+. More... | |
| HRESULT | GetEncoderClsid (const WCHAR *format, CLSID *pClsid) |
| HRESULT | SaveBitmap (HWND hwnd, Gdiplus::Bitmap *pBitmap) |
| Save bitmap to file. More... | |
| void | CreateFileMenu (HMENU hParent) |
Create File menu. More... | |
| HMENU | CreateTilesetMenu (HMENU hParent) |
Create Tileset menu. More... | |
| void | CreateHelpMenu (HMENU hParent) |
Create Help menu. More... | |
These platform-dependent functions are hidden away so that the faint-of-heart don't have to see them if they're offended by them.
Definition in file WindowsHelpers.cpp.
| void CreateFileMenu | ( | HMENU | hParent | ) |
Create the File menu.
| hParent | Handle to the parent menu. |
Definition at line 187 of file WindowsHelpers.cpp.
| void CreateHelpMenu | ( | HMENU | hParent | ) |
Create the Help menu.
| hParent | Handle to the parent menu. |
Definition at line 216 of file WindowsHelpers.cpp.
| HMENU CreateTilesetMenu | ( | HMENU | hParent | ) |
Create the Tileset menu.
| hParent | Handle to the parent menu. |
Tileset menu. Definition at line 201 of file WindowsHelpers.cpp.
| HRESULT GetEncoderClsid | ( | const WCHAR * | format, |
| CLSID * | pClsid | ||
| ) |
Get an encoder clsid for an image file format.
| format | File format using wide characters. |
| pClsid | [OUT] Pointer to clsid. |
Definition at line 107 of file WindowsHelpers.cpp.
| ULONG_PTR InitGDIPlus | ( | ) |
Initialize GDI+ and get a GDI+ token.
Definition at line 88 of file WindowsHelpers.cpp.
| void InitWindow | ( | HINSTANCE | hInst, |
| INT | nShow, | ||
| WNDPROC | WndProc | ||
| ) |
Create and initialize a window.
| hInst | Instance handle. |
| nShow | 1 to show window, 0 to hide. |
| WndProc | Window procedure. |
Definition at line 46 of file WindowsHelpers.cpp.
| HRESULT SaveBitmap | ( | HWND | hwnd, |
| Gdiplus::Bitmap * | pBitmap | ||
| ) |
Display a Save dialog box for png files and save a bitmap to the file name that the user selects. Only files with a .png extension are allowed. The default file name is "ImageN.png", where N is the number of images saved so far in the current instance of this program. This prevents any collisions with files already saved by this instance. If there is a collision with a file from a previous instance, then the user is prompted to overwrite or rename it in the normal fashion.
| hwnd | Window handle. |
| pBitmap | Pointer to a bitmap. |
Definition at line 141 of file WindowsHelpers.cpp.