public virtual bool Render_Draw(ImageObj img = null) { double pixResoultion = 0.0005; //提取数据信息 if (_GdalRead == null) { return(false); } IMetadataR pMetadata = (IMetadataR)_GdalRead.GetMetadata(); if (pMetadata == null) { return(false); } pMetadata.Cols = (int)Math.Floor((_Metadata.MaxX - _Metadata.MinX) / pixResoultion); pMetadata.Rows = (int)Math.Floor((_Metadata.MaxY - _Metadata.MinY) / pixResoultion); //绘图 if (img == null) { if (_Image == null) { _Image = new ImageObj(pMetadata.Cols, pMetadata.Rows); } else { _Image = img; } } _Metadata = pMetadata; return(true); }
public override bool Render_Draw(ImageObj img = null) { //提取元数据、初始绘图对象 if (base.Render_Draw(img) == false) { return(false); } IMetadataR pMetadata = (IMetadataR)_Metadata; if (pMetadata == null) { return(false); } //循环绘制 ImageColor pColor = null; float[] datas = null; bool bResult = _GdalReadR.GetDatas(1, ref datas); for (int i = 0; i < pMetadata.Rows; i++) { for (int j = 0; j < pMetadata.Cols; j++) { pColor = GetColor(datas[i * pMetadata.Cols + j]); //Task.Run(() => _Image.Draw(i, j, pColor.Color)); _Image.Draw(j, i, pColor.Color); } ; //Task.Run(() => Draws(pMetadata, i, datas)); } return(bResult); }
protected bool Draws(IMetadataR pMetadata, int i, float[] datas) { ImageColor pColor = null; for (int j = 0; j < pMetadata.Cols; j++) { pColor = GetColor(datas[i * pMetadata.Cols + j]); _Image.Draw(j, i, pColor.Color); } ; return(true); }
public override bool Render_Draw(ImageObj img = null) { //提取数据信息 if (_GdalReadR == null) { return(false); } IMetadataR pMetadata = _GdalReadR.GetMetadataR(1); //绘图 if (img == null) { if (_Image == null) { _Image = new ImageObj(pMetadata.Cols, pMetadata.Rows); } else { _Image = img; } } _Metadata = pMetadata; return(true); }