开发者

Is it possible to use RMagick to draw overlays on to other application windows?

开发者 https://www.devze.com 2023-03-04 20:24 出处:网络
I am building a desktop app that will put a simple graphical HUD on to other application windows. So basically I need for my app to be able to access another app as the parent, and then build out the

I am building a desktop app that will put a simple graphical HUD on to other application windows. So basically I need for my app to be able to access another app as the parent, and then build out the HUD on top of it. Is this possible with RMagick? If not, is there something else in ruby that would do what I needed?

I basically need help exploring options, since there seems to be very lit开发者_如何学Gotle information related to doing something like this. So if that involves the fact that I have to access a specific C library or something, that is fine. I'm just a little lost on where to start.

EDIT: can someone comment on why this is getting no responses whatsoever? Is it just that unique of a requirement?


Are you trying to create an overlay on top of an existing application window, similar to what Xfire, Raptr, Steam, or Fraps do? If you are doing this on Windows, and want to overlay full screen DirectX apps such as video or games, you would need to hook DirectDraw. This is a rather old library that appears unsupported but it could serve as a starting point: http://directdrawoverlaylib.codeplex.com/

If you just want to overlay a standard (not DirectX) app, you might just make your app use a borderless, transparent window on which you can paint your content. Then, track the movement of the "parent" window so you can move your child window accordingly. Here's an example of using the "Layered Window" feature in Windows to make transparent windows. http://msdn.microsoft.com/en-us/library/ms997507.aspx But you could do the same on OSX with the appropriate Cocoa APIs.

I don't think RMagick will help you here, and what you need to do will be OS specific so you're going to have to dabble with native code.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号