mail-archives/mono-osx/2009-April/002205.html

100 строки
4.1 KiB
HTML
Исходник Обычный вид История

2019-06-06 22:05:17 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-osx] [Mono-winforms-list] DrawImage alpha blend broken in libgdiplus
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20%5BMono-winforms-list%5D%20DrawImage%20alpha%20blend%20broken%20in%0A%09libgdiplus&In-Reply-To=49DCC9FB.8070007%40yessoftware.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="002204.html">
<LINK REL="Next" HREF="002206.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-osx] [Mono-winforms-list] DrawImage alpha blend broken in libgdiplus</H1>
<B>Sebastien Pouliot</B>
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20%5BMono-winforms-list%5D%20DrawImage%20alpha%20blend%20broken%20in%0A%09libgdiplus&In-Reply-To=49DCC9FB.8070007%40yessoftware.com"
TITLE="[Mono-osx] [Mono-winforms-list] DrawImage alpha blend broken in libgdiplus">sebastien.pouliot at gmail.com
</A><BR>
<I>Wed Apr 8 13:33:43 EDT 2009</I>
<P><UL>
<LI>Previous message: <A HREF="002204.html">[Mono-osx] DrawImage alpha blend broken in libgdiplus
</A></li>
<LI>Next message: <A HREF="002206.html">[Mono-osx] [Mono-winforms-list] DrawImage alpha blend broken in libgdiplus
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#2205">[ date ]</a>
<a href="thread.html#2205">[ thread ]</a>
<a href="subject.html#2205">[ subject ]</a>
<a href="author.html#2205">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hello Alex,
The patch looks good. However this kind of fix has been known to cause
regression in the past.
Could you supply unit tests that ensure that the image can be saved and
reloaded correctly ? (modifying your previous sample code should be
easy).
With this (and if all existing tests pass successfully) I'll be able to
commit your patch.
Thanks!
Sebastien
On Wed, 2009-04-08 at 18:59 +0300, Alex Shulgin wrote:
&gt;<i> Alex Shulgin wrote:
</I>&gt;<i> &gt; Hi,
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; I believe that alpha blending is broken in libgdiplus.
</I>&gt;<i>
</I>&gt;<i> I've located the problem. It is due to the inconsistent handling of
</I>&gt;<i> PixelFormat32bppPArgb (premultiplied alpha) in libgdiplus.
</I>&gt;<i>
</I>&gt;<i> In the attached patch I've added the check on PArgb to DrawImageRect in
</I>&gt;<i> analogy with texturebrush.c and fixed pngcodec.c to set pixel format to
</I>&gt;<i> PArgb if premultiplication was done.
</I>&gt;<i>
</I>&gt;<i> This fixes my demo program and there's no visible regressions in a
</I>&gt;<i> fairly complex application which originally revealed the problem.
</I>&gt;<i>
</I>&gt;<i> If the feeling is such that this is appropriate patch, I'd add the same
</I>&gt;<i> handling for places like this (there's few).
</I>&gt;<i>
</I>&gt;<i> --
</I>&gt;<i> Regards,
</I>&gt;<i> Alex
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> Mono-winforms-list maillist - <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">Mono-winforms-list at lists.ximian.com</A>
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-winforms-list">http://lists.ximian.com/mailman/listinfo/mono-winforms-list</A>
</I>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="002204.html">[Mono-osx] DrawImage alpha blend broken in libgdiplus
</A></li>
<LI>Next message: <A HREF="002206.html">[Mono-osx] [Mono-winforms-list] DrawImage alpha blend broken in libgdiplus
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#2205">[ date ]</a>
<a href="thread.html#2205">[ thread ]</a>
<a href="subject.html#2205">[ subject ]</a>
<a href="author.html#2205">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx">More information about the Mono-osx
mailing list</a><br>
</body></html>