24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 428  |  回复: 0

zzahkj

管理员

优秀!!有木有!!!优秀!!有木有!!!优秀!!有木有!!!优秀!!有木有!!!

[交流] Vb.net+ArcEngine通过插值生成的栅格图像是黑白渐变颜色的?

Vb.net+ArcEngine通过插值生成的栅格图像是黑白渐变颜色的?我想要彩色的,该如何去做?附上我的代码:
  Dim pFeatureLayer As IFeatureLayer = Main.AxMapControl1.get_Layer(0)
        Dim pOutRaster As IRaster = CreateRaster(pFeatureLayer)
        CreateContour(pOutRaster)

    Private Sub CreateContour(ByVal pOutRaster As IRaster)
        Dim pSurfaceOp As ISurfaceOp = New RasterSurfaceOp()
        Dim odbase As Object = 0
        Dim pOutLineFC As IFeatureClass = pSurfaceOp.Contour(pOutRaster, 0.1, odbase)

        Dim pFLayercontour As IFeatureLayer = New FeatureLayerClass()
        pFLayercontour.FeatureClass = pOutLineFC
        pFLayercontour.Name = "等值线"
        Dim pLayercontour As ILayer = pFLayercontour
        Main.AxMapControl1.AddLayer(pLayercontour)
    End Sub
    Private Function CreateRaster(ByVal pFeatureLayer As IFeatureLayer)
        Dim pInterpolationOp As IInterpolationOp = New RasterInterpolationOpClass()
        Dim pInputDataset As IGeoDataset = pFeatureLayer.FeatureClass
        Dim pRadius As IRasterRadius = New RasterRadiusClass()
        Dim o1 As Object = Type.Missing
        pRadius.SetVariable(12, o1)
        ' 设置高程字段
        Dim pFCDescriptor As IFeatureClassDescriptor = New FeatureClassDescriptor()
        pFCDescriptor.Create(pFeatureLayer.FeatureClass, Nothing, "温度"
        Dim dCellSize As Double = 0.01364 '像元大小
        Dim oCell As Object = dCellSize
        Dim pEnv As IRasterAnalysisEnvironment = pInterpolationOp
        pEnv.SetCellSize(esriRasterEnvSettingEnum.esriRasterEnvValue, oCell)
        Dim pOutRaster As IRaster = Nothing
        Dim o2 As Object = Type.Missing
        pOutRaster = pInterpolationOp.IDW(pFCDescriptor, 2, pRadius, o2)
        Dim pOutRasterLayer As IRasterLayer = New RasterLayerClass()
        pOutRasterLayer.CreateFromRaster(pOutRaster)
        pOutRasterLayer.Name = "栅格图像"
        Main.AxMapControl1.AddLayer(pOutRasterLayer)
        Main.AxMapControl1.Refresh()
        Return pOutRaster
    End Function
回复此楼

» 猜你喜欢

不要迷恋哥,哥只是一个过客!
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

相关版块跳转 我要订阅楼主 zzahkj 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 0856材料与化工调剂,339 +9 10213207 2026-03-31 9/450 2026-04-01 00:49 by fmesaito
[考研] 一志愿北京科技大学085601材料工程英一数二初试总分335求调剂 +4 双马尾痞老板2 2026-03-31 4/200 2026-03-31 21:08 by Wang200018
[考研] 086000生物与医药298调剂求助 +3 元元青青 2026-03-31 5/250 2026-03-31 19:58 by vgtyfty
[考研] 生医工0831调剂求推荐 +4 小熊睿睿_s 2026-03-27 6/300 2026-03-31 17:12 by 记事本2026
[考研] 江苏苏北高校诚邀调剂同学 +3 zzll406 2026-03-31 3/150 2026-03-31 16:54 by 及时行乐fan
[考研] 0856 335分 | 封装or激光加工 老师看看我!! +9 cccchenso 2026-03-29 9/450 2026-03-31 16:37 by lishahe
[考研] 生物学 296 求调剂 +7 朵朵- 2026-03-26 9/450 2026-03-31 14:26 by jp9609
[考研] 求调剂 +8 11ggg 2026-03-30 8/400 2026-03-31 13:56 by nanaliuyun
[考研] 08工科,295,接受跨专业调剂 +6 lmnlzy 2026-03-30 6/300 2026-03-31 10:04 by cal0306
[考研] 083000学硕274求调剂 +12 Li李鱼 2026-03-26 12/600 2026-03-31 10:01 by cal0306
[考研] 359求调剂 +5 王了个楠 2026-03-25 5/250 2026-03-30 19:36 by 源_2020
[考研] 抱歉 +3 田洪有 2026-03-30 3/150 2026-03-30 19:11 by 迷糊CCPs
[考研] 考研调剂 +5 Sanmu-124 2026-03-26 5/250 2026-03-30 13:36 by chemdavid
[考研] 材料与化工304求B区调剂 +4 邱gl 2026-03-26 7/350 2026-03-30 08:39 by 探123
[考研] 295求调剂 +5 wei-5 2026-03-26 5/250 2026-03-30 08:34 by 探123
[考研] 材料与化工(0856)304求B区调剂 +8 邱gl 2026-03-27 8/400 2026-03-28 12:42 by 唐沐儿
[考研] 086502化学工程342求调剂 +6 阿姨复古不过 2026-03-27 6/300 2026-03-28 07:06 by wangy0907
[考研] 070300化学求调剂 +4 起个名咋这么难 2026-03-27 4/200 2026-03-27 21:39 by 83503孙老师
[考研] 中国科学院深圳先进技术研究院-光纤传感课题组招生-中国科学院大学、深圳理工大学联培 +5 YangTyu1 2026-03-26 5/250 2026-03-26 18:27 by 猫咪猫咪呀
[考研] 一志愿 南京邮电大学 288分 材料考研 求调剂 +3 jl0720 2026-03-26 3/150 2026-03-26 13:39 by zzll406
信息提示
请填处理意见