Overlay Image over Emulator

Ask gaming related questions
Cauptain
Posts: 1
Joined: 10 May 2018, 03:36

Overlay Image over Emulator

10 May 2018, 05:06

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
Louis Tully
Posts: 31
Joined: 25 Apr 2018, 03:03

Re: Overlay Image on Emulator

10 May 2018, 09:58

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.
Rangerbot
Posts: 34
Joined: 02 Mar 2018, 10:33

Re: Overlay Image over Emulator

13 May 2018, 05:03

I don't think AHK is the resource for this however

https://autohotkey.com/board/topic/7751 ... tresource/
User avatar
empardopo
Posts: 336
Joined: 06 Oct 2013, 12:50
Location: Spain
Contact:

Re: Overlay Image over Emulator

24 Jul 2018, 13:03

Cauptain 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
Hi, I'm using this code

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
but it only works fine when you run the emulator in window mode. For example, using the higan emulator works fine but using the ssf emulator (sega saturn) is impossible to me.

Greetings.
Everything is possible!
User avatar
YoucefHam
Posts: 333
Joined: 24 Aug 2015, 12:56
Facebook: https://fb.me/YoucefHamDz
Google: [email protected]
GitHub: YoucefHam
Location: Algeria
Contact:

Re: Overlay Image over Emulator

29 Jul 2018, 10:38

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

:wave: There is always more than one way to solve a problem. ;)

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 30 guests