Support display of BMP images on MS-Windows

* src/w32image.c (w32_can_use_native_image_api): Support BMP
images.
* src/image.c (syms_of_image) <Qbmp>: New symbol.
[HAVE_NTGUI]: Add 'bmp' to list of supported image types.

* doc/lispref/display.texi (Image Formats): Document built-in
support for BMP images.

* etc/NEWS: Announce the change.
This commit is contained in:
Eli Zaretskii 2022-03-26 11:31:46 +03:00
parent de953a6fe3
commit a6abb6f5cd
4 changed files with 14 additions and 0 deletions

View file

@ -5507,6 +5507,12 @@ symbol}. The symbols for the above formats are, respectively,
@code{pbm}, @code{xbm}, @code{xpm}, @code{gif}, @code{jpeg},
@code{tiff}, @code{png}, @code{svg}, and @code{webp}.
On some platforms, the built-in image support that doesn't require
any optional libraries includes BMP images.@footnote{
On MS-Windows, this requires @code{w32-use-native-image-API} to be set
non-@code{nil}.
}
Furthermore, if you build Emacs with ImageMagick
(@code{libMagickWand}) support, Emacs can display any image format
that ImageMagick can. @xref{ImageMagick Images}. All images

View file

@ -1821,6 +1821,11 @@ follow the system's dark mode: GUI frames use the appropriate light or
dark title bar and scroll bars, based on the user's Windows-wide color
settings.
+++
*** Emacs now supports display of BMP images using native image APIs.
When 'w32-use-native-image-API' is non-nil, Emacs on MS-Windows now
has built-in support for displaying BMP images.
----------------------------------------------------------------------
This file is part of GNU Emacs.

View file

@ -11558,6 +11558,8 @@ non-numeric, there is no explicit limit on the size of images. */);
# ifdef HAVE_NTGUI
DEFSYM (Qgdiplus, "gdiplus");
DEFSYM (Qshlwapi, "shlwapi");
DEFSYM (Qbmp, "bmp");
add_image_type (Qbmp);
# endif
#endif

View file

@ -253,6 +253,7 @@ w32_can_use_native_image_api (Lisp_Object type)
|| EQ (type, Qpng)
|| EQ (type, Qgif)
|| EQ (type, Qtiff)
|| EQ (type, Qbmp)
|| EQ (type, Qnative_image)))
{
/* GDI+ can also display BMP, Exif, ICON, WMF, and EMF images.