WebBMP version 1.2.2 16-Aug-2002 By Jason Summers http://pobox.com/~jason1/webbmp/ Requirements: WebBMP is a Netscape-style browser plug-in that displays Windows BMP image files. It is a Win32 program, compatible with Windows 95, 98, NT, etc. However, this plug-in does not work in very many web browsers anymore, due to the prevalence of browsers that have internal support for BMP images. WebBMP's main purpose at this point is as sample code. Features: * Embedded images are resized to the height and width specified in the tag. * Progressive display: view images as they are downloading (uncompressed images only) * Save to disk * Copy to clipboard * Set as wallpaper **************************************************************************** The software is provided "AS IS" and without warranty of any kind. This software is hereby released to the public domain. This applies to the source code contained in the following files: npwebbmp.c npwebbmp.rc npwebbmp.def resource.h and not necessarily to any other files that may be needed to compile this software. -Jason Summers **************************************************************************** INSTALLATION To install WebBMP, copy the file npwebbmp.dll to your Plugins directory. This is usually something like "C:\Program Files\Netscape\Program\Plugins". Then restart your browser. If you don't see a file called "npwebbmp.dll" in this package, run Windows Explorer and select View|Options|Show all files. There is no standard MIME type for BMP files. WebBMP, as distributed, displays documents with the MIME types "image/bmp" and "image/x-bmp". In order to view documents with other types (for example, "application/MS-Bitmap"), it will need to be modified and recompiled. WebBMP is intended primarily as a demonstration of how to write a simple plug-in, and is not intended for serious use in a production environment. BMP files are not appropriate for use on the Internet, since (for one thing) they are usually not compressed. BMP files with 8-bit or 4-bit color can be compressed, but only with a relatively poor compression scheme. WebBMP relies on the Windows GDI to display bitmaps. This means that: 1. It is not easily portable to non-Windows platforms. To port it, you would have to write your own routines for interpreting and displaying BMP files. 2. It should be able to display just about any BMP file that Windows can handle, including semi-nonstandard ones with 16 or 32-bit color. It also means that it's hard to be sure exactly how much memory Windows will attempt to read when displaying an image, and to verify that that memory is available (especially with compressed BMP images). Thus, IT IS POSSIBLE FOR CORRUPTED IMAGES TO CRASH YOUR BROWSER! It is unlikely that anything worse could happen than a crash, but I cannot guarantee that. CHANGES IN 1.2.2 * No changes from the user perspective. Just a few minor tweaks to the source code. CHANGES IN 1.2.1 * Some changes to make the context menu more likely to work in more browsers. CHANGES IN 1.2.0 (versus 1.1.x) * Windowless mode support has been removed. It makes the code too messy, and never worked quite right anyway. And it may not be supported by any future browsers. The few people who need it can get WebBMP version 1.1.x. * Support for more varieties of BMP files. * Several other minor improvements and fixes. COMPILING THE SOURCE CODE To compile WebBMP, you will a copy of Netscape's Plug-in SDK. As of this writing, Netscape's Plug-in SDK could be downloaded from: ftp://ftp.netscape.com/pub/sdk/plugin/windows/winsdk40.zip In that version of the API, the following files are needed. I suggest putting a copy of all of them in your project folder. npapi.h npupp.h jni.h jni_md.h jri.h jri_md.h jritypes.h npwin.cpp [*] * A modified copy of this npwin.cpp file included with WebBMP, and I recommend that you use that one instead. WebBMP should work with other versions of the API, but the required files may be slightly different. Create a new DLL project (in MSVC, select "Win32 Dynamic Link Library") named "npwebbmp". Add these files to your project: npwebbmp.c npwebbmp.rc npwebbmp.def npwin.cpp Compile npwebbmp.dll, and put a copy of it in your web browser's "Plugins" folder.