91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 17.24MB
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發布日期: 2023-07-07
  • 語言: C#
  • 標簽: GDAL??C#??VS2015??

資源簡介

在VS2015的開發環境中,基于GDAL包和C#語言,實現柵格影響的讀取和顯示,包括灰度影像和彩色影像的讀取和顯示。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?OSGeo.GDAL;

namespace?ReadRaster_Gray
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}

????????private?void?btn_open_Click(object?sender?EventArgs?e)
????????{
????????????initial();
????????????//文件路徑
????????????string?fileName?=?““;
????????????OpenFileDialog?openFile?=?new?OpenFileDialog();
????????????openFile.Filter?=?“所有文件|*.*|Tiff文件|*.tif|Erdas?img文件|*.img|Bmp文件|*.bmp|jpeg文件|*.jpg“;
????????????if?(openFile.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????fileName?=?openFile.FileName;
????????????}
????????????else
????????????{
????????????????MessageBox.Show(“影像路徑不能為空““注意“
????????????????????MessageBoxButtons.OKCancelMessageBoxIcon.Information);
????????????????return;
????????????}
????????????textBox1.Text?=?fileName;
????????????//創建Dataset
????????????Gdal.AllRegister();
????????????Dataset?ds?=?null;
????????????try
????????????{
????????????????ds?=?Gdal.Open(fileName?Access.GA_ReadOnly);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????MessageBox.Show(“打開影像失敗“+ex.Message);
????????????}
????????????if?(ds?==?null)
????????????{
????????????????MessageBox.Show(“影像無效“);
????????????????return;
????????????}
???????????
????????????//創建包絡矩形
????????????Rectangle?rec?=?new?Rectangle();
????????????rec.Width?=?this.pictureBox1.Width;
????????????rec.Height?=?this.pictureBox1.Height;
????????????//調用ReadImage方法獲取圖像并顯示
????????????Bitmap?map?=?ReadImage(ds?rec);
????????????pictureBox1.Image?=?map;
????????}
????????//讀取圖像數據
????????public?Bitmap?ReadImage(Dataset?ds?Rectangle?rec)
????????{

????????????#region?獲取圖像信息
????????????int?imageWidth?=?ds.RasterXSize;
????????????int?imageHeight?=?ds.RasterYSize;
????????????float?imgRatio?=?imageWidth?/?(float)imageHeight;

????????????//圖像顏色模式
????????????int?model;
????????????model?=?ds.RasterCount;
????????????double[]?dd?=?new?double[4];
????????????ds.GetGeoTransform(dd);
????????????string?prj?=?ds.GetProjection();
????????????string?str?=?string.Format(“波段數目:{0}\n行數:{1};列數:{2}\n坐標參考:{3}{4}{5}{6}\n“?ds.RasterCount?ds.RasterXSize?ds.RasterYSize?dd[0]?dd[1]?dd[2]?dd[3]);
????????????str?+=?prj?+?“\n“;
????????????for?(int?i?=?1;?i?<=?ds.RasterCount;?++i)
????????????{
????????????????OSGeo.GDAL.Band?band?=?ds.GetRasterBand(i);
????????????????str?+=?“波段“?+?i?+?“:“?+?band.DataType.ToString();

????????????}
????????????infoText.Text?=?str;
????????????#endregion
????????????#region?對圖像進行縮放
????????????//依據矩形尺寸設置buffer的尺寸
????????????int?boxWidth?=?rec.Width;
????????????int?boxHeight?=?rec.Height;
????????????float?boxRatio?=?boxWidth?/?(float)bo

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

????..A..H.?????59904??2019-07-01?09:11??ReadRaster_Gray\.vs\ReadRaster_Gray\v14\.suo

?????文件????????189??2019-04-19?09:11??ReadRaster_Gray\ReadRaster_Gray\App.config

?????文件????2285056??2018-06-10?05:15??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\cairo.dll

?????文件????1005568??2017-09-03?22:13??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\cfitsio.dll

?????文件?????111104??2017-09-03?22:21??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\expat.dll

?????文件??????55808??2017-09-03?22:44??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\freexl.dll

?????文件?????117248??2017-09-03?22:25??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\fribidi.dll

?????文件???16811008??2019-01-24?06:23??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\gdal204.dll

?????文件??????20480??2019-01-24?06:27??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\gdalconst_csharp.dll

?????文件??????17408??2019-01-24?06:27??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\gdalconst_wrap.dll

?????文件??????98304??2019-01-24?06:27??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\gdal_csharp.dll

?????文件??????81920??2019-01-24?06:27??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\gdal_wrap.dll

?????文件????1033728??2017-09-03?16:31??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\geos.dll

?????文件?????228864??2017-09-03?16:31??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\geos_c.dll

?????文件????2120704??2017-09-03?23:18??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\hdf5.dll

?????文件?????248832??2017-09-03?23:19??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\hdf5_cpp.dll

?????文件??????97280??2017-09-03?23:18??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\hdf5_hl.dll

?????文件??????10752??2017-09-03?23:18??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\hdf5_hl_cpp.dll

?????文件?????544256??2017-09-03?23:24??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\hdfdll.dll

?????文件?????900096??2017-09-03?17:48??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\iconv.dll

?????文件?????288256??2017-09-03?18:25??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\libcurl.dll

?????文件????1154560??2017-09-03?18:14??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\libeay32.dll

?????文件????1185792??2017-09-04?01:47??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\libecwj2.dll

?????文件??????41472??2017-09-03?22:16??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\libfcgi.dll

?????文件?????366592??2017-09-03?23:22??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\libkea.dll

?????文件????3909632??2017-09-04?02:59??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\libmysql.dll

?????文件?????124928??2018-06-10?05:10??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\libpq.dll

?????文件?????749056??2017-09-03?22:33??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\libtiff.dll

?????文件????1021440??2018-06-10?05:14??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\libxml2.dll

?????文件????3872256??2017-12-22?08:03??ReadRaster_Gray\ReadRaster_Gray\bin\Debug\lti_dsdk_9.5.dll

............此處省略68個文件信息

評論

共有 條評論