mantis 8442 more changes to alpha blending

This commit is contained in:
UbitUmarov
2019-01-16 20:24:16 +00:00
parent d8e5b7385e
commit b2810c4ca7
2 changed files with 63 additions and 23 deletions

View File

@@ -354,6 +354,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
// under lock.
lock (this)
{
if (alpha == 256 && bgColor.A != 255)
alpha = bgColor.A;
if (alpha == 256)
{
bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb);
@@ -367,13 +371,15 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
{
bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb);
graph = Graphics.FromImage(bitmap);
Color newbg = Color.FromArgb(alpha,bgColor);
using (SolidBrush bgFillBrush = new SolidBrush(newbg))
{
graph.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy;
graph.FillRectangle(bgFillBrush, 0, 0, width, height);
}
}
graph.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
GDIDraw(data, graph, altDataDelim, out reuseable);
}