/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/previewpane/QoiThumbnailProvider/Program.cs
42 строки
1 KB
Pedro Lamas
[FileExplorer]Add QoiThumbnailProvider and QoiPreviewHandler (#29735)
14 ноя 2023, 18:41
Не верифицирован
14 ноя 2023, 18:41
0990724
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Globalization; namespace Microsoft.PowerToys.ThumbnailHandler.Qoi { internal static class Program { private static QoiThumbnailProvider _thumbnailProvider; /// <summary> /// The main entry point for the application. /// </summary> [STAThread] public static void Main(string[] args) { ApplicationConfiguration.Initialize(); if (args != null) { if (args.Length == 2) { string filePath = args[0]; uint cx = Convert.ToUInt32(args[1], 10); _thumbnailProvider = new QoiThumbnailProvider(filePath); Bitmap thumbnail = _thumbnailProvider.GetThumbnail(cx); if (thumbnail != null) { filePath = filePath.Replace(".qoi", ".bmp"); thumbnail.Save(filePath, System.Drawing.Imaging.ImageFormat.Bmp); } } else { MessageBox.Show("Qoi thumbnail - wrong number of args: " + args.Length.ToString(CultureInfo.InvariantCulture)); } } } } }