impr: Move script library to its own library

This commit is contained in:
WerWolv
2023-07-16 20:13:50 +02:00
parent 0a6815da8f
commit d7238a5f80
11 changed files with 46 additions and 13 deletions

View File

@@ -0,0 +1,22 @@
#pragma warning disable SYSLIB1054
using System.Drawing;
using System.Runtime.InteropServices;
namespace ImHex
{
public class Bookmarks
{
[DllImport(Library.Name)]
private static extern void createBookmarkV1(UInt64 address, UInt64 size, UInt32 color, [MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string description);
public static void CreateBookmark(long address, long size, Color color, string name = "", string description = "")
{
unsafe
{
createBookmarkV1((UInt64)address, (UInt64)size, (UInt32)(0xA0 << 24 | color.B << 16 | color.G << 8 | color.R), name, description);
}
}
}
}