c# - XNA How to display what is underneath the game window? -
what display texture2d on screen, screen needs transparent well. have section of code found can make window borderless.
intptr hwnd = this.window.handle; var control = system.windows.forms.control.fromhandle(hwnd); var form = control.findform(); form.formborderstyle = system.windows.forms.formborderstyle.none; when put initialize() method, makes window borderless.
however, when use graphicsdevice.clear(color.transparent); in draw results in black square in middle of screen.
is there way change opacity of background @ all? there else can try fix this?
some things heard of take screenshot of background , display on screen via backbuffer, can't find solutions implement that.
edit: here draw method, while rather simple
protected override void draw(gametime gametime) { graphicsdevice.clear(color.transparent); spritebatch.begin(); { spritebatch.draw(tex, parameters, color.white ); } spritebatch.end(); base.draw(gametime); } i found can change forms opacity via form.opacity = 0; makes texture transparent well.
Comments
Post a Comment