mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
Preserve transparency when copying a DIB to/from the clipboard.
In order to get the alpha channel when encoding BMP images from a surface, we need to supply bmp=32 in the encoder options.
This commit is contained in:
parent
80610e5548
commit
5f10407c8c
1 changed files with 2 additions and 2 deletions
|
|
@ -921,7 +921,7 @@ nsDataObj::GetDib(const nsACString& inFlavor,
|
|||
if ( image ) {
|
||||
nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
|
||||
|
||||
nsAutoString options;
|
||||
nsAutoString options(NS_LITERAL_STRING("bpp=32;"));
|
||||
if (aFormat.cfFormat == CF_DIBV5) {
|
||||
options.AppendLiteral("version=5");
|
||||
} else {
|
||||
|
|
@ -1581,7 +1581,7 @@ HRESULT nsDataObj::DropImage(FORMATETC& aFE, STGMEDIUM& aSTG)
|
|||
nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
|
||||
nsCOMPtr<nsIInputStream> inputStream;
|
||||
rv = imgTools->EncodeImage(image, NS_LITERAL_CSTRING(IMAGE_BMP),
|
||||
NS_LITERAL_STRING("version=3"),
|
||||
NS_LITERAL_STRING("bpp=32;version=3"),
|
||||
getter_AddRefs(inputStream));
|
||||
if (NS_FAILED(rv) || !inputStream) {
|
||||
return E_FAIL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue