alphablending

Heatmap style gradients in .NET

给你一囗甜甜゛ 提交于 2019-11-26 16:59:26
问题 I am trying to create a heat map with gradients that look similar to this: This image shows three points and the gradients blend nicely together. Here is what I am currently doing in my drawing function: public void DrawGradient(int x, int y, Graphics g) { using (var ellipsePath = new GraphicsPath()) { var bounds = new Rectangle(x, y, 100, 100); ellipsePath.AddEllipse(bounds); var brush = new PathGradientBrush(ellipsePath); Color[] colors = { Color.FromArgb(64, 0, 0, 255), Color.FromArgb(140,

Creating a transparent window in C++ Win32

亡梦爱人 提交于 2019-11-26 08:48:52
问题 I\'m creating what should be a very simple Win32 C++ app who\'s sole purpose it to ONLY display a semi-transparent PNG. The window shouldn\'t have any chrome, and all the opacity should be controlled in the PNG itself. My problem is that the window doesn\'t repaint when the content under the window changes, so the transparent areas of the PNG are \"stuck\" with what was under the window when the application was initially started. Here\'s the line where I setup the new window: hWnd =

How to calculate an RGB colour by specifying an alpha blending amount?

倖福魔咒の 提交于 2019-11-26 06:58:09
问题 I\'m writing a colour picker that gets the pixel RGB values from wherever you point to on the screen. I want to also have the option of specifying that the colour I picked already has an alpha value. I\'m just wondering how I can calculate the resulting colour. For example: The resulting pixel colour is 240,247,249 but I know that the original colour had a 10% opacity and was on top of a white (255,255,255) background. What\'s the calculation to work out the original RGB values? 回答1: The