zaafar / clickabletransparentoverlay Goto Github PK
View Code? Open in Web Editor NEWA library for creating transparent overlay using windows API & ImGui.NET
License: Apache License 2.0
A library for creating transparent overlay using windows API & ImGui.NET
License: Apache License 2.0
Unable to find package Veldrid.StartupUtilities with version (>= 4.9.0-beta1-g416d633c88)
Unable to find package Veldrid.Sdl2 with version (>= 4.9.0-beta1-g416d633c88)
Unable to find package Veldrid.ImageSharp with version (>= 4.9.0-beta1-g416d633c88)
Unable to find package Veldrid with version (>= 4.9.0-beta1-g416d633c88)
Nearest version: 4.9.0-beta1
Is this able to be rectified by uploading a new NuGet/NuSpec with these dependency versions updated?
Thank you for the extremely useful architecture. I have been making great use of this as I build up my app.
I have gotten to the point in my project where I need to optimize the rate at which I am sampling data and want to match with the rate at which the target game is being refreshed. I was hoping to ask you if you know how to do this?
My tenuous information so far is that I need to change a setting in Vortice.DXGI
called SynchronizeWithVerticalRetrace
to true
But I am not sure how I would gain the handle to the device to set that. I was hoping you might be able to point me in the right direction.
Current the lib is in beta mode and new.
Let's check it again after 1 year (Dec 2023).
https://github.com/microsoft/CsWin32
currently the lib isn't C# friendly e.g.
following change:
User32.SetCursor(User32.LoadCursor(IntPtr.Zero, new IntPtr((int)cursor)));
into:
PInvoke.SetCursor(PInvoke.LoadCursor(HINSTANCE.Null, (char*)(int)cursor));
A memory leak will occur if you try to update the same image.
Steps to reproduce:
Step to fix:
Not sure if I am not using it correctly, but I can't seem to find
ImGui::DockBuilderSplitNode
ImGui::DockBuilderGetNode
ImGui::DockBuilderDockWindow
And related APIs
Won't happen, unless there is a .net 5 language feature which this library needs/wants.
Also, libs using .net core 2 can easily be used by the projects using .net 5.
right now the static bool TerminalWindow
in Overlay.cs is responsible for toggling the console window away. But the ClickableTransparentOverlay assembly is not the one responsible for spawning it.
Changing the OutputType of DriverProgram.csproj to WinExe
would be cleaner
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
Yes this question sounds dumb like who would be using .Net Framework still but I have reasons and I could really use if this supported that. Thanks
This issue is twofold
protected override Task PostInitialized()
{
var handleField = typeof(Overlay).GetField("window", BindingFlags.NonPublic | BindingFlags.Instance);
if (handleField == null)
throw new Exception("Failed to get window field");
object? window = handleField.GetValue(this);
if (window == null)
throw new Exception("Failed to get window value");
object? handle = window.GetType().GetField("Handle")?.GetValue(window);
if (handle == null)
throw new Exception("Failed to get handle value");
windowHandle = (IntPtr)handle;
return Task.CompletedTask;
}
IntPtr hwndInsertAfter = Win32.GetWindow(windowHandle, Win32.WindowCommand.Previous);
if (hwndInsertAfter == this.windowHandle)
return;
Win32.SetWindowPos(this.windowHandle, hwndInsertAfter, 0, 0, 0, 0, Win32.SwpFlags.NoSize | Win32.SwpFlags.NoMove | Win32.SwpFlags.NoActivate | Win32.SwpFlags.AsyncWindowPos) ? 1 : 0;
// Hide the window
var style = Win32.GetWindowLong(windowHandle, Win32.GWL_EXSTYLE);
Win32.SetWindowLong(windowHandle, Win32.GWL_EXSTYLE, (style & -Win32.WS_EX_APPWINDOW) | Win32.WS_EX_TOOLWINDOW);
Currently the library uses the date-time class, would be more performance efficient to use the stopwatch class.
ref: https://www.codeproject.com/Articles/800756/TimeSpan-Calculation-based-on-DateTime-is-a-Perfor
ref: https://stackoverflow.com/questions/28637/is-datetime-now-the-best-way-to-measure-a-functions-performance
Seems like the last few updates has broken the resolution and only does about half the screen. Also I wanted to ask if there an option to disable the transparent background on the imgui menus? Changing the alpha seems to do nothing but I just want it a solid colour.
I'm wondering is it possible to make it work in fullscreen applications ??
I have a D2DOverlay library that works on fullscreen applications tho, take look at it: https://github.com/coltonon/D2DOverlay
Hi, there is such a problem that when you click on the imgui menu, the application behind it loses focus. That is, the click does not reach it. In my case, the application pauses after clicking on imgui, any ideas how to fix this? I also wanted to say thank you for this package, this is a very convenient solution. It would be convenient if you would like to leave any wallet for voluntary donations.
The current demo shows single threaded application with Coroutine. Would be nice to see if this library can be used by multi-threaded application and how.
I can't find any option to change title How can I do this shit ?
In version 9.2.0 and above, menus cannot be dragged or used across the whole window size.
Works properly in 9.1
It does not seem possible to disable the ini that is created to store state. An option for this would be nice so things can be handled with the Save and Load functions.
I came across a code snippet on the internet that loads custom glyphs using ImGui.NET but I'm having trouble getting them to display properly. Even though the glyphs are loaded, they still appear as question marks when I try to use them with Push/Pop font. Do you have any suggestions for how I can troubleshoot this issue and get the glyphs to display correctly?
static unsafe ImFontPtr LoadIconFont(string name, int size, (ushort, ushort) range)
{
ImFontConfigPtr configuration = ImGuiNative.ImFontConfig_ImFontConfig();
configuration.MergeMode = true;
configuration.PixelSnapH = true;
// string path = Path.Combine(".", "Resources", "Fonts", name + ".ttf");
string path = MaterialDesign.FontIconFileNameMD;
GCHandle rangeHandle = GCHandle.Alloc(new ushort[]
{
range.Item1,
range.Item2,
0
}, GCHandleType.Pinned);
try
{
return ImGui.GetIO().Fonts.AddFontFromFileTTF(path, size, configuration, rangeHandle.AddrOfPinnedObject());
}
finally
{
configuration.Destroy();
if (rangeHandle.IsAllocated)
{
rangeHandle.Free();
}
}
}
We've noticed that your package on NuGet.org is missing a README file.
A README is essential for users to understand your package's purpose and functionality quickly. It's the first thing users see on NuGet.org and helps them decide if your package meets their needs.
If you're new to NuGet READMEs, follow guidance on how to add one to your package.
Follow a blog post with README best practices and a template file to help you get started.
We value your feedback. If you encounter any issues or have suggestions, please reply to this issue.
Thank you for your contribution to the NuGet community.
In version 9.1, the ui sometimes turns white randomly before returning to normal. However, when using version 9.2 or later, the white screen issue is resolved, but there's a new problem: the ui cannot be fully displayed in fullscreen mode. Part of the screen seems to disappear, indicating a possible screen scaling issue, any idea to fix this?
How can i hide the overlay form icon generated on windows taskbar?
Any example on how To add it to processor ? All it does is open the imgui
When trying to use ReplaceFont in my program, it raises a System.MissingMethodException exception every time the function is ran. I tried the SingleThreadedOverlayWithCoroutines example as well, and it still raises this exception:
Unhandled exception. System.MissingMethodException: Method not found: 'ImGuiNET.ImFontPtr ImGuiNET.ImFontAtlasPtr.AddFontFromFileTTF(System.String, Single, ImGuiNET.ImFontConfigPtr, IntPtr)'.
at ClickableTransparentOverlay.ImGuiRenderer.UpdateFontTexture(String fontPathName, Single fontSize, UInt16[] fontCustomGlyphRange, FontGlyphRangeType fontLanguage)
at ClickableTransparentOverlay.Overlay.ReplaceFontIfRequired()
at ClickableTransparentOverlay.Overlay.RunInfiniteLoop(CancellationToken token)
at ClickableTransparentOverlay.Overlay.<Start>b__26_0()
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
I made sure ImGui.NET and the other dependencies are installed, and I don't know any workarounds for the time being.
it will allow users to create ImGuiWindows outside the SDL2 Window (in case overlay window is too small OR they have multiple monitors).
User of this library have to implement special logic so that only the render thread calls the close operation.
Hi im little bit confuse, how i can add a color picker in first windows menu imgui?
When i load image 512x512
128x128
, ... or some size when width and height is same size, it works nice, but if i load image with width and height different, i get the error, a exmple: 512x128
The error is in ClickableTransparentOverlay.ImGuiRenderer.CreateImageTexture
when the method calls the device.CreateTexture2D(...)
The error message is System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
The problem is in
Looking to the Texture2DDescription
, the parameters is format
, width
, height
, .....
, in the current code, using image.Width
in height
param
Currently having a hard time trying to not use mipmaps, as it seems to blur out the texture a bit, which is not desired for my use. I'm trying to do an image editor, where there should be no filtering at all.
Would it be possible for you to add an overload or something to AddOrGetImagePointer, where I can specify that I don't want any mipmaps/filtering? :)
This demo looks great, but I can't seem to get it to work for a specific game (Perpetuum).
It runs on DX9. This sample is able to render the window over the game, but I can't actually click on anything unless I bring focus back to the sample console app.
Any advice on this would be highly appreciated.
Everyone, who is familiar with the overlay technology, knows that Overlay doesn't really work with applications running in FullScreen mode (unless you do some really hacky/brittle stuff e.g. by-passing the OS input system) so that's not really a problem.
However, in this issue, overlay stops working on "Borderless Window" mode as well. This happens only when application, who is being overlayed by the ClickableTransparentOverlay, is using Vulkan APIs.
Acceptance Criteria
Notes
Work Around
In the current NuGet Package, the overlay window only displays on the "primary" screen.
In the current source code it seams that something is implemented so the overlay window can be moved:
I build the source repo and added it to my project.
I am trying to set those properties to the new Position and Size depending on the selected screen Bounds:
the overlay window disappears from the main screen but not appear on the selected screen (I set the ImGui window to the same coordinates relative to the old screen)
after moving to the other screen (without any debugging):
to clarify:
I have 3 Monitors, the selected monitor is on the right so X is 1920 and Y is 0 whichis the upper left corner of the right monitor
when i set these property , the exception is " Object reference not set to an instance of an object."
Unfortunately the released version of Veldrid lib have some bugs. Waiting for next released version of Veldrid.
Workaround: https://github.com/zaafar/ClickableTransparentOverlay/blob/master/NuGet.config#L7
on the latest version of CTO it messes up the screen size. I fixed it by downgrading the version.
Sometime when clicking and moving mouse like a monkey the overlay gets stuck in a non-clickable mode forever. Developers using this lib should implement the following workaround in their application to get rid of this issue.
workaround: cc3c1d7 (basically you need to figure out a way to send ImGui.GetIO().WantCaptureMouse = true;
to the ImGui.).
Currently, Overlay skips the keyboard/mouse events if it's doing a lot of processing on the UI thread.
I am using this with Unity.
I would like to present a Texture loaded by Unity main thread to an ImGui.Image.
How would I be able to do this?
I kept getting the
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Default ImGUI font looks too small on 4k resolution. Would be nice to add more fonts.
Use-Case-1: User can select a specific font for a specific part of the UI
Use-Case-2: User can select a specific font as a default font.
I get this error message when i click on install button :
Severity Code Description Project File Line Suppression State Details
Error Could not install package 'ClickableTransparentOverlay 10.1.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
At the moment, it is possible to replace the font for the entire Imgui. (ReplaceFont)
If I create a overlay in for example a Console application, everything works fine.
If I however create the same overlay in a class library, then import that class library into a Console application, everything seems to work except the GetWindowDrawList, nothing is being drawn.
This is currently blocking me from using the library.
Thanks
Hello I am trying to have the overlay cover my entierty of my screen not just a small area I tried doing ImGui#SetNextWindowSize but that only resized the ImGui window not the actual overlay
please let me know how to fix that thanks,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.