From 402fdc4cb6f94016cf9749bb1f09a6c5ead5d6d3 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期五, 19 七月 2024 12:43:30 +0800 Subject: [PATCH] 添加重采样功能 --- SimuTools/Tools/GdalHelper.cs | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-) diff --git a/SimuTools/Tools/GdalHelper.cs b/SimuTools/Tools/GdalHelper.cs index 0a6e6ba..c579e01 100644 --- a/SimuTools/Tools/GdalHelper.cs +++ b/SimuTools/Tools/GdalHelper.cs @@ -180,7 +180,7 @@ /// <summary> /// 鍒涘缓PNG /// </summary> - public void CreatePng(string filePath, int width, int height, int bands = 3) + public void CreatePng(byte[] buffer, string filePath, int width, int height, int bands = 3) { // 鍒涘缓鍐呭瓨椹卞姩 OSGeo.GDAL.Driver memDriver = Gdal.GetDriverByName("MEM"); @@ -192,13 +192,6 @@ { Band band = ds.GetRasterBand(i); band.SetRasterColorInterpretation((ColorInterp)i); - } - - // 濉厖鍐呭瓨鍥惧儚 - byte[] buffer = new byte[width * height * bands]; - for (int i = 0; i < buffer.Length; i++) - { - buffer[i] = (byte)(i % 256); } // 鍐欏叆鍐呭瓨鍥惧儚 -- Gitblit v1.9.3