At certain blend opacities, WindowDrawImageAlpha (and probably also WindowMergeImageAlpha) is generating the wrong blend color for 0 alpha areas.
I made a 500x500 completely empty (add alpha channel, select all, delete) png in GIMP and saved it as MUSHclient/pure_alpha.png and then used the following.
The lower half of the miniwindow visibly blinks, but the lower half shouldn't be different than the upper half because the image is completely empty.
(You might have to squint or mess with your display brightness)
As you can see in the code below, the color displayed should be 0x1c1c0c, but the bad region is showing 0x1b1b0b.
<aliases>
<alias
match="hst"
enabled="y"
send_to="12"
sequence="100"
>
<send>
require "wait"
bga = "win_"..GetPluginID().."_test"
WindowDelete(bga)
local bgcolor = 0x1c1c0c
WindowCreate (bga, 0, 0, 0, 0, 12, 2, bgcolor)
WindowShow(bga, true)
if WindowLoadImage (bga, "pure_alpha", GetInfo(66).."pure_alpha.png") == 0 then
WindowResize(bga, WindowImageInfo(bga, "pure_alpha", 2), WindowImageInfo(bga, "pure_alpha", 3), bgcolor)
wait.make(function()
for i=1,100 do
WindowRectOp(bga, 2, 0, 0, 0, 0, bgcolor, bgcolor)
WindowDrawImageAlpha(bga, "pure_alpha", 0, 250, 0, 0, 0.0499) -- good
Repaint()
wait.time(0.5)
WindowRectOp(bga, 2, 0, 0, 0, 0, bgcolor, bgcolor)
WindowDrawImageAlpha(bga, "pure_alpha", 0, 250, 0, 0, 0.05) -- bad
Repaint()
wait.time(0.5)
WindowRectOp(bga, 2, 0, 0, 0, 0, bgcolor, bgcolor)
WindowDrawImageAlpha(bga, "pure_alpha", 0, 250, 0, 0, 0.0501) -- good
Repaint()
wait.time(0.5)
WindowRectOp(bga, 2, 0, 0, 0, 0, bgcolor, bgcolor)
WindowDrawImageAlpha(bga, "pure_alpha", 0, 250, 0, 0, 0.0157) -- bad
Repaint()
wait.time(0.5)
-- WindowRectOp(bga, 2, 0, 0, 0, 0, bgcolor, bgcolor)
-- WindowDrawImageAlpha(bga, "pure_alpha", 0, 250, 0, 0, 0.0158) -- good
-- Repaint()
-- wait.time(0.3)
end
end)
end
</send>
</alias>
</aliases>
|