Hello guys,
I'm newbie with scripts and need a help.
Is it possible to run a program (emulator) and put a screen over it (Overlay / Bezel) at the same time?
The image is png transparency
The emulaodr open in fullscreen and the screen on top of it.
Below are the examples of what I say:
Emulator (Fullscreen)
https://i.imgur.com/IbzEiJ1.jpg
Emulator + Overlay
https://i.imgur.com/57rsBYK.jpg
I need any software for it?
Thanks
Claudio
Overlay Image over Emulator
-
- Posts: 42
- Joined: 25 Apr 2018, 03:03
Re: Overlay Image on Emulator
I know there are bezel overlays in MAME but there's an emulator called MESS that runs just about everything and it's made by the MAME devs and it works just the same. You'll have to make your own overlays, or find some online. A search for MESS Nintendo bezel overlays turns up some good results.
Re: Overlay Image over Emulator
I don't think AHK is the resource for this however
https://autohotkey.com/board/topic/7751 ... tresource/
https://autohotkey.com/board/topic/7751 ... tresource/
Re: Overlay Image over Emulator
Hi, I'm using this codeCauptain wrote:Hello guys,
I'm newbie with scripts and need a help.
Is it possible to run a program (emulator) and put a screen over it (Overlay / Bezel) at the same time?
The image is png transparency
The emulaodr open in fullscreen and the screen on top of it.
Below are the examples of what I say:
Emulator (Fullscreen)
https://i.imgur.com/IbzEiJ1.jpg
Emulator + Overlay
https://i.imgur.com/57rsBYK.jpg
I need any software for it?
Thanks
Claudio
Code: Select all
; Display bezel program. Taken from gdi+ ahk tutorial 3 written by tic (Tariq Porter)
; Requires Gdip.ahk either in your Lib folder as standard library or using #Include
; ahkscript.org/boards/viewtopic.php?t=6517
#SingleInstance, Force
#NoEnv
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetBatchLines, -1
pname = higan v106
SetTimer, tick, 200
SplitPath, A_ScriptDir, outdir
StringLower, loutdir, outdir
fname := "GB.png" ; Change vectrex.png to whatever your file is named
#Include Gdip.ahk
If !pToken := Gdip_Startup()
{
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
OnExit, Exit
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
Gui, 1: Show, NA
Gui, 1: Hide
hwnd1 := WinExist()
pBitmap := Gdip_CreateBitmapFromFile(fname)
If !pBitmap
{
MsgBox, 48, File loading error!, Could not load '%fname%'
ExitApp
}
Width := Gdip_GetImageWidth(pBitmap), Height := Gdip_GetImageHeight(pBitmap)
hbm := CreateDIBSection(A_ScreenWidth, A_ScreenHeight)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetInterpolationMode(G, 7)
Gdip_DrawImage(G, pBitmap, 0, 0, A_ScreenWidth, A_ScreenHeight, 0, 0, Width, Height)
UpdateLayeredWindow(hwnd1, hdc, 0, 0, A_ScreenWidth, A_ScreenHeight)
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
Gdip_DisposeImage(pBitmap)
Return
tick:
{
IfWinActive, %pname%
{
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
Gui, 1: Show, NA
}
}
return
Exit:
Gdip_Shutdown(pToken)
SetTimer, tick, Off
ExitApp
Return
Greetings.
Everything is possible!
Re: Overlay Image over Emulator
try this code
Code: Select all
Picture_File = 1.png
Gui_Index := 1
;~ Gui, Main: -MinimizeBox +AlwaysOnTop
Gui, Main: Add, button, w80 vAdd_Gui gAdd_Gui, Add Overlay
Gui, Main: Add, button, w80 vHide gHide, Remove
Gui, Main: Add, button, w80 vHideAll gHideAll, Hide All
Gui, Main: Add, button, w80 vResize gResize, Resize/Move Off
Gui, Main: Show, w100, Overlay
return
Add_Gui:
if Gui_Index >= 1
{
Gui, Overlay%Gui_Index%:+LastFound
Gui, Overlay%Gui_Index%: Margin, 0, 0
Gui, Overlay%Gui_Index%: Add, Picture, x0 y0 w80 h-1 vPic gMoveGui, % Picture_File
Gui, Overlay%Gui_Index%: Color, #00FF00
Gui, Overlay%Gui_Index%:+LastFound
winset, transcolor, #00FF00
GuiControlGet, txt, Main:, Resize
Gui, % "Overlay" Gui_Index ": +AlwaysOnTop -Caption -Border -Sysmenu +ToolWindow " ((txt = "Resize/Move Off") ? "" : "+Resize")
Gui, Overlay%Gui_Index%: Show,, Overlay%Gui_Index%
WinSet, ExStyle, % ((txt = "Resize/Move Off") ? "+0x20" : "-0x20"), Overlay%Gui_Index%
Gui_Index += 1
}
return
HideAll:
GuiControlGet, txt, Main:, HideAll
if Gui_Index >= 2
Loop, % Gui_Index - 1
{
IfInString, txt, Hide
{
Loop, % Gui_Index - 1
Gui, Overlay%A_Index%: Hide
GuiControl,Main:, HideAll, Show All
}
else
{
Loop, % Gui_Index - 1
Gui, Overlay%A_Index%: Show
GuiControl,Main:, HideAll, Hide All
}
}
return
Hide:
if Gui_Index > 0
{
if Gui_Index > 1
Gui_Index -= 1
Gui, Overlay%Gui_Index%: Destroy
}
return
Resize:
GuiControlGet, txt, Main:, Resize
if Gui_Index >= 2
Loop, % Gui_Index - 1
{
IfInString, txt, Off
{
Gui, Overlay%a_Index%: +Resize
WinSet, ExStyle, -0x20, Overlay%A_Index%
GuiControl,Main:, Resize, Resize/Move ON
SetTimer, GuiReSize, 500
}
else
{
Gui, Overlay%a_Index%: -Resize
WinSet, ExStyle, +0x20, Overlay%A_Index%
GuiControl,, Resize, Resize/Move Off
SetTimer, GuiReSize, Off
}
}
return
GuiReSize:
WinGetTitle, WinTitle, A
WinGetPos,,, W, H, % WinTitle
IfInString, WinTitle, Overlay
GuiControl, %WinTitle%: MoveDraw, Pic, % "x0 y0 w" W " h" H
return
MoveGui:
PostMessage, 0xA1, 2,,, A
Return
MainGuiClose:
ExitApp
return
Who is online
Users browsing this forum: No registered users and 40 guests