[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Several suggestions for image support
From: |
Kim F. Storm |
Subject: |
Re: Several suggestions for image support |
Date: |
16 Apr 2004 18:59:26 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
Jason Rumney <address@hidden> writes:
> Kim F. Storm wrote:
>
> > You are right. Shifting 8 bits here as well on X fixes transparent bg.
> > I will commit a fix for X shortly.
> > However, on W32, it seems that it explicitly scales things to 16
> > bits
> > in both cases. I cannot test this on W32, so I cannot say what's
> > the right thing to do.
>
> The W32 port scales to 16 bits in places because the native Windows
> COLORREF is 8 bits, while Emacs XColor is 16 bits. So in this case, 8
> bits is right, but alpha is currently coming out wrong. I suspect the
> use of COLOREF instead of XColor that you considered a bug when
> merging the image code (see comment around that location) was in fact
> not a bug.
But w32_defined_color has an XColor * as third arg, not COLORREF.
And w32_defined_color seems to return "properly scaled" values,
so it seems like it should be shifted >> 8 like the other ports.
>
> > Here is an easy way to test it -- after downloading the image you
> > mentioned:
> > (insert-image (create-image "alphatest.png"))
> > this should result in a light blue image with nice rounded
> > edges; a darker blue with rough edges indicates a problem.
>
> On Windows the image comes out with a black background and the image
> has rainbow colored stripes. Non-alpha PNGs look OK.
>
That is more or less as I expected.
Can you try to change in image.c around line 5454:
frame_background.red = 256 * GetRValue (color);
frame_background.green = 256 * GetGValue (color);
frame_background.blue = 256 * GetBValue (color);
to
frame_background.red = GetRValue (color);
frame_background.green = GetGValue (color);
frame_background.blue = GetBValue (color);
--
Kim F. Storm <address@hidden> http://www.cua.dk
- Re: Several suggestions for image support, (continued)
- Re: Several suggestions for image support, Jason Rumney, 2004/04/16
- Re: Several suggestions for image support, David Kastrup, 2004/04/16
- Re: Several suggestions for image support, Jason Rumney, 2004/04/16
- Re: Several suggestions for image support, David Kastrup, 2004/04/16
- Re: Several suggestions for image support, Kim F. Storm, 2004/04/16
- Re: Several suggestions for image support, Stefan Monnier, 2004/04/16
- Re: Several suggestions for image support, David Kastrup, 2004/04/16
- Re: Several suggestions for image support, YAMAMOTO Mitsuharu, 2004/04/16
- Re: Several suggestions for image support, Richard Stallman, 2004/04/17
- Re: Several suggestions for image support, David Kastrup, 2004/04/17
- Re: Several suggestions for image support, Kim F. Storm, 2004/04/18
- Re: Several suggestions for image support, Stefan Monnier, 2004/04/18
- Re: Several suggestions for image support, David Kastrup, 2004/04/19
- Re: Several suggestions for image support, Kim F. Storm, 2004/04/19
- Re: Several suggestions for image support, Stefan Monnier, 2004/04/19
- Re: Several suggestions for image support, David Kastrup, 2004/04/19
- Re: Several suggestions for image support, Stefan Monnier, 2004/04/19