Page 1 of 1

IMDisplay: common image files in file open dialog

Posted: 2010-09-18T06:05:51-07:00
by tilman
Hello,

The file open dialogbox is unpractical because it doesn't show all image types immediately. I suggest an improvement, so that people get shown all common images:

In the rc file, add this below IDR_IMGIFTYPE:

Code: Select all

 IDR_IMIMAGETYPE         "\nImage\n\nCommon image files\n.jpg;.png;.tif;.tiff;.bmp;.wmf;.mif;.miff;.svg;.eps;.gif\n\n"
define IDR_IMIMAGETYPE in resource.h or in the gui:

Code: Select all

#define IDR_IMIMAGETYPE                 139
correct _APS_NEXT_RESOURCE_VALUE:

Code: Select all

#define _APS_NEXT_RESOURCE_VALUE        140
below this

Code: Select all

CMultiDocTemplate* pDocTemplate;
add this:

Code: Select all

            //TH all image types, default
        pDocTemplate = new CMultiDocTemplate(
	        IDR_IMIMAGETYPE,
	        RUNTIME_CLASS(CIMDisplayDoc),
	        RUNTIME_CLASS(CChildFrame), // custom MDI child frame
	        RUNTIME_CLASS(CIMDisplayView));
	AddDocTemplate(pDocTemplate);
and remove the block with "JPEG (default)".

result:
Image

Tilman Hausherr