Exemple #1
0
        private static IntPtr CreateCursorFromResource(string name, int x, int y)
        {
            var suffix       = GLTheme.MainWindowScaling > 1 ? "@2x" : "";
            var hotSpotScale = GLTheme.MainWindowScaling > 1 ? 2 : 1;

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream($"FamiStudio.Resources.{name}{suffix}.png"))
            {
                var buffer = new byte[stream.Length];
                stream.Read(buffer, 0, buffer.Length);

                return(MacUtils.CreateCursorFromImage(buffer, x * hotSpotScale, y * hotSpotScale));
            }
        }