alphablending

How to set blend function on opengl for two overlapping objects

佐手、 提交于 2019-12-12 01:08:39
问题 Hi I needed to draw a round corner rectangle. I followed the procedure of the above image. I first drew the green rectangle. Then I drew the two black rectangles.And then I drew circles on the edges to make the corner round. Now what I get after doing this is in the image below. As it can be seen that the corner circles have less transparency on the portions where they overlap with the rectangles. But more transparency when not overlapped with the rectangles. The rectangles have alpha set to

AlphaBlend generating incorrect colors

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 19:01:39
问题 I've managed to avoid Windows GDI for decades, and now I'm paying the price. The following C++ code does not result in the correct colors. It's just supposed to white-fill a window and then alpha blend a single bitmap. All of the alpha is per-pixel alpha in the bitmap. // Create a memory DC HDC hdcMem = CreateCompatibleDC(hdc); HBITMAP hbmMem = CreateCompatibleBitmap(hdc, cxWnd, cyWnd); SelectObject(hdcMem, hbmMem); // White-fill the BG FillRect(hdcMem, &rectWnd, static_cast<HBRUSH>

textures with transparent background by using alpha blending opengl

百般思念 提交于 2019-12-11 16:48:05
问题 I have scar textures and I want to get rid of the background skin colour by using alpha blending. However, I have problems with changing the opacity of individual pixels of specific textures. What is the easiest way to have textures with transparent background? I am using C++ and openGL. I am using a BMP picture format and I am trying to map that scar texture onto the face but background colour of scar texture seems ugly on the face, so I want to remove that part and have only scar texture

Delphi 6 support for toolbar and menu icons with alpha channel transparency

纵饮孤独 提交于 2019-12-11 11:49:19
问题 We have a legacy application developed in Delphi 6 (yes, I know this is an ancient IDE now), which we are trying to update to look more modern. We have added in a Manifest and now have it using version 6 Windows controls and taking on the Windows Visual Theme (all good). However, when trying to replace the old 4 bit toolbar and menu icons with True Colour with Alpha Channel (32 bit) transparency we have hit a problem. It appears that Delphi 6 only supports transparency based on the bottom

Gdiplus mask image from another image

会有一股神秘感。 提交于 2019-12-11 10:36:47
问题 Is there a way to manipulate alpha of an image using alpha from another image? Suppose I have a Image and I want to alter its alpha starting opaque at left and totally transparent at right, currently I draw another image with LinearGradientBrush and set alpha of orginal image from second image by looping pixel by pixel, is there another way in Gdiplus, some image mask, or blending alpha of two images? Conclusion: it seems there is no way in GDI+ to blend two images, only way seems to be the

Alpha blending is slow on linux

匆匆过客 提交于 2019-12-11 03:28:05
问题 we are developing an SWT/RCP(Eclipse 3.5) application on both Windows and Linux (on identical hardware). The application is a GIS app which shows several layered maps(PNG images) rendered with alpha blending. org.eclipse.draw2d.Graphics.setAlpha(...); org.eclipse.draw2d.Graphics.drawImage(...); On Windows the performance is pretty good, but on Linux it is very poor. is that a Linux(GTK/KDE) problem? or is there any workaround to improve the performance on Linux? 来源: https://stackoverflow.com

Why doesn't this D2006 code to fade a PNG Image work?

删除回忆录丶 提交于 2019-12-10 19:34:56
问题 This question springs from an earlier one. Most of the code is from suggested answers that probably worked in later versions of Delphi. In D2006 I don't get the full range of opacity, and the transparent part of the image shows as white. Image is from http://upload.wikimedia.org/wikipedia/commons/6/61/Icon_attention_s.png. It is loaded from the PNGImageCollection into the TImage at run-time because I have found you have to do this as the image doesn't remain intact after the DFM is saved. For

Flood fill algorithm that takes alpha into account without leaving fringes around anti-aliased lines?

二次信任 提交于 2019-12-10 10:46:41
问题 I've implemented a typical flood fill algorithm and it works as expected when solid colors are used where I use the Euclidean distance between the ARGB components to compare colors. My problem is that if you draw something like an anti-aliased red line on a transparent background my flood fill algorithm will not fill over most semi-transparent pixels, leaving fringes around objects. Specifically for this example, the center of the line is solid red (i.e. (255, 255, 0, 0) in ARGB format) and

iPhone opengl es alpha-blending. I have black color in edge

只谈情不闲聊 提交于 2019-12-09 17:18:16
问题 I am developing iPhone game. I have the below Source image to draw it to the background. The Source image has alpha 0x00 and gradation around edge and the background's alpha is 0xff. When I draw the source image to the background, I have black color like you could see the Result image. I am using OpenGL ES glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) method. I have changed every possible arguments, but every time it is not moved. Why do I have the black color in the edge of the source

Fastest way (performance wise) to darken UIView or CALayer

感情迁移 提交于 2019-12-08 05:04:32
问题 I have a UIView / CALayer which I would like to darken. How can I as fast as possible darken it? Is there any way to avoid blending? Following alternatives is known to me create a non-opaque CALayer and set background color and opacity and add it as a sublayer above main layer same as above using UIView (can be a tad slower...?) render view/layer to UIImage and doing drawing with CoreGraphics (is way too slow and content is dynamic/changing) 回答1: Someone gave me a tip to have a dark