2

比如说我想在屏幕中间画一个红色方块(或多个红色方块),并且仍然能够看到没有被方块覆盖的所有东西,有点像闪屏。

我想在 Windows 中实现这一点,但我不知道在屏幕顶部绘制的最佳方式。到目前为止,这些是我的想法:

  • 我最初尝试通过为其获取设备上下文来直接在桌面上绘图。
  • 制作矩形/sa 单独的窗口,因为它们很容易移动,而且我不必担心透明度。
  • 创建一个覆盖整个屏幕并保持在顶部的透明窗口。在屏幕的客户区绘制矩形

我认为这三个想法中最好的是最后一个,但对我的想法或新想法的任何意见将不胜感激:)

4

1 回答 1

3

Creating transparent window, then drawing in it, in my experience it is messy.
Why don't you just take a screenshot from the back ground set it as the back ground for you snake game. When ever they click somewhere/die you just close your game.
You could catch the last click and resubmit it after closing the game.

That is how I would do, but of course that just an opinion.

于 2012-11-21T15:25:33.420 回答