layered-windows

Draw HBITMAP onto layered window. What's wrong?

青春壹個敷衍的年華 提交于 2021-02-18 17:44:06
问题 Hello and good day to everyone, my final target is to draw a PNG file including alpha onto the screen - that means not into an own window but just somewhere on the desktop. The part to load PNG's into a HBITMAP works now (tested that in a diffrent way) but I don't manage to draw it including alpha. As far as I've heard the best way to do this would be using alyered windows. So I wroked a lot to redo a couple of examples and tiny tutorials. The following code compiles without problems and

How to create child layered alpha-transparent window?

落爺英雄遲暮 提交于 2020-01-02 09:13:44
问题 I am trying to create transparent child window. procedure TForm1.BtnGoClick(Sender: TObject); var bmp:TBitmap; BitmapPos: TPoint; BitmapSize: TSIZE; BlendFunction: _BLENDFUNCTION; exStyle: Cardinal; begin bmp := TBitmap.Create; bmp.LoadFromFile('my32bitbitmap.bmp'); exStyle := GetWindowLongA(Form2.Handle, GWL_EXSTYLE); if (exStyle and WS_EX_LAYERED = 0) then SetWindowLong(Form2.Handle, GWL_EXSTYLE, exStyle or WS_EX_LAYERED); BitmapPos := Point(0, 0); BitmapSize.cx := bmp.Width; BitmapSize.cy

Win32: How to draw outside my window?

馋奶兔 提交于 2019-12-09 01:00:02
问题 Looking at a Windows tooltips class hint window, i see that it draws its drop-shadow outside the hint window's actual rectangle. Using SpyXX - i can get the tooltip's window rect, and class styles: Rectangle: (440, 229)-(544, 249), 104x20 Restored Rect: (440, 229)-(544, 249), 104x20 Client Rect: (0, 0)-(104, 20), 104x20 You'll notice that the drop shadow you see is physically outside the window that's being drawn. How can i draw a shadow outside around my window, while being outside my window

How to create child layered alpha-transparent window?

末鹿安然 提交于 2019-12-05 22:41:59
I am trying to create transparent child window. procedure TForm1.BtnGoClick(Sender: TObject); var bmp:TBitmap; BitmapPos: TPoint; BitmapSize: TSIZE; BlendFunction: _BLENDFUNCTION; exStyle: Cardinal; begin bmp := TBitmap.Create; bmp.LoadFromFile('my32bitbitmap.bmp'); exStyle := GetWindowLongA(Form2.Handle, GWL_EXSTYLE); if (exStyle and WS_EX_LAYERED = 0) then SetWindowLong(Form2.Handle, GWL_EXSTYLE, exStyle or WS_EX_LAYERED); BitmapPos := Point(0, 0); BitmapSize.cx := bmp.Width; BitmapSize.cy := bmp.Height; BlendFunction.BlendOp := AC_SRC_OVER; BlendFunction.BlendFlags := 0; BlendFunction

Win32: How to draw outside my window?

风流意气都作罢 提交于 2019-11-30 22:55:55
Looking at a Windows tooltips class hint window, i see that it draws its drop-shadow outside the hint window's actual rectangle. Using SpyXX - i can get the tooltip's window rect, and class styles: Rectangle: (440, 229)-(544, 249), 104x20 Restored Rect: (440, 229)-(544, 249), 104x20 Client Rect: (0, 0)-(104, 20), 104x20 You'll notice that the drop shadow you see is physically outside the window that's being drawn. How can i draw a shadow outside around my window, while being outside my window? Note : The shadow is not drawn using the standard CS_DROPSHADOW class style. i've confirmed this

Win32: How to make drop shadow honor non-rectangular Layered window?

对着背影说爱祢 提交于 2019-11-28 21:22:32
i've created a layered window by adding the the WS_EX_LAYERED extended style: wndClass.ExStyle = wndClass.ExStyle | WS_EX_LAYERED; Windows will use black as the chroma key color value. i'm going to leave a large border of black to make the problem obvious: After the window is constructed, i tell it to use black as a chroma-key color : SetLayeredWindowAttributes(hwnd, 0x00000000, 255, LWA_COLORKEY); Now the popup layered window appears partially transparent: The problem is the final step. i want to use CS_DROPSHADOW class style, available since Windows XP, to create a drop-shadow: wndClass

Win32: How to make drop shadow honor non-rectangular Layered window?

我们两清 提交于 2019-11-27 13:47:02
问题 i've created a layered window by adding the the WS_EX_LAYERED extended style: wndClass.ExStyle = wndClass.ExStyle | WS_EX_LAYERED; Windows will use black as the chroma key color value. i'm going to leave a large border of black to make the problem obvious: After the window is constructed, i tell it to use black as a chroma-key color: SetLayeredWindowAttributes(hwnd, 0x00000000, 255, LWA_COLORKEY); Now the popup layered window appears partially transparent: The problem is the final step. i