Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

An alternative to scaling is using multiple images, each authored for a different DPI. This technique yields the best results.

The .ico format is already capable of storing multiple image sizes in a single file. When you load the icon or cursor, the application asks for the size that the GetSystemMetricsfunction suggests; the system then picks the closest image.

The following code example shows how to select from multiple images that are not in .ico format. To be completely DPI aware, an application should still scale the loaded bitmap based on the actual DPI of the device, because it should make no assumption about what DPI resolutions are available.

Copy Code
if (GetDeviceCaps(hdc, LOGPIXELSX) < 130)
   bitmap = LoadBitmap(hInstance, (char*) IDB_BITMAP1);
else
   bitmap = LoadBitmap(hInstance, (char*) IDB_BITMAP2);

When the loaded bitmap is already authored for the correct DPI, scaling it will have no adverse effect on performance or image quality.

See Also

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.