| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Message
| I got a better result using this:
-- main result window
win5 = GetPluginID () .. ".5"
WindowCreate (win5, 0, 0, 40, 40, miniwin.pos_center_right, miniwin.create_transparent, ColourNameToRGB("darkgray")) -- create window
-- gradient window
win6 = GetPluginID () .. ".6"
WindowCreate (win6, 0, 0, 40, 40, miniwin.pos_center_right, miniwin.create_transparent, 0) -- create window
WindowGradient (win6, 0, 0, 0, 0,
ColourNameToRGB ("yellow"),
ColourNameToRGB ("red"),
miniwin.gradient_vertical) -- top to bottom
-- mask window
win7 = GetPluginID () .. ".7"
WindowCreate (win7, 0, 0, 40, 40, miniwin.pos_center_right, miniwin.create_transparent, 0) -- create window
-- ellipse
WindowCircleOp (win7, miniwin.circle_ellipse, 5, 5, 25, 25,
ColourNameToRGB("black"), miniwin.pen_null, 0, -- no pen
ColourNameToRGB("white"), miniwin.brush_solid) -- brush
-- blur ellipse
WindowFilter (win7, 0, 0, 0, 0, miniwin.filter_blur, 0) -- blur both directions
-- convert to images
WindowImageFromWindow (win5, "gradient", win6)
WindowImageFromWindow (win5, "mask", win7)
-- do the merge
WindowMergeImageAlpha (win5, "gradient", "mask", miniwin.merge_straight, 1, 40, 40, 0, 1)
WindowFilter (win5, 0, 0, 0, 0, miniwin.filter_blur, 0) -- blur both directions
WindowShow (win5, true) -- show it
The important part was making the background not black, but matching the output window (in my case, darkgray). You seem to be using an image, but if you get something that is close to the underlying colour it should look better.
Also I would use the symbolic constants (as I have above) rather than sprinking lots of "magic numbers" in the code, which you will always have to look up to see what they mean. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|