Arcengine the vector data is really handy, the same for raster images can be styled! No contact before, today just need to make a raster image rendering! The following ideas are implemented:
1. Define a series of interfaces for rendering 2. Determine if the image has a histogram created, if not. 3. Define a color sequence that provides a rendering scheme for rendering. 4. Call the Render method for rendering. Here is the code: there are two methods, one is to load the raster data, one is to render, and then in the event to invoke the method to achieve image rendering! ///GRID classification thematic map /// ///Raster layer public static void Funcolorforraster_classify (Irasterlayer prasterlayer) { Irasterclassifycolorramprenderer prclassrend = new Rasterclassifycolorramprenderer () as irasterclassifycolorramprenderer; Irasterrenderer prrend = prclassrend as irasterrenderer; Iraster praster = prasterlayer.raster; irasterbandcollection prbandcol = praster as Irasterbandcollection; Irasterband prband = PRBandCol.Item (0); if (Prband.histogram = = null) { prband.computestatsandhist (); } Prrend.raster = pRaster; Prclassrend.classcount = 10; prrend.update (); Irgbcolor pfromcolor = new RgbColor () as irgbcolor; pfromcolor.red = 255; PfRomcolor.green = 0; PFromColor.Blue = 0; Irgbcolor ptocolor = new RgbColor () as irgbcolor; & nbsp; ptocolor.red = 0; Ptocolor.green = 0; Ptocolor.blue = 255; Ialgorithmiccolorramp Colorramp = new Algorithmiccolorramp () as ialgorithmiccolorramp; colorramp.size = 10; Colorramp.fromcolor = pfromcolor; Colorramp.tocolor = ptocolor; BOOL createcolorramp; Colorramp.createramp (out Createcolorramp); Ifillsymbol fillsymbol = new Simplefillsymbol () as ifillsymbol; for (int i = 0; i < Prclassrend.classcount; i++) & nbsp; { Fillsymbol.color = Colorramp.get_color (i); Prclassrend.set_symbol (i, fillsymbol as Isymbol); Prclassrend.set_label (i, Prclassrend.get_break (i). ToString ("0.00")); } Prasterlayer.renderer = prrend; } /// ///Open Remote Sensing images // ///Image address //Irasterlayer Private Irasterlayer Openimage (string imagePath) { String ws = Path.getdirectoryname (ImagePath); string FBS = Path.getfilename (ImagePath); Iworkspacefactory pwork = new Rasterworkspacefactory (); IrasterworKspace Prasterws = Pwork.openfromfile (ws,0) as irasterworkspace; Irasterdataset Prasterdataset = Prasterws.openrasterdataset (FBS); Irasterlayer Prasterlayer = new Rasterlayer () as irasterlayer; Prasterlayer.createfromdataset (Prasterdataset); return prasterlayer; the logic of the event: AxMapControl1.Map.AddLayer (Openimage (FilePath)); AxMapControl1.ActiveView.Refresh (); Funcolorforraster_classify (Axmapcontrol1.get_layer (0) as Irasterlayer);//only One RasterLayeraxMapControl1.Activeview.Refresh ();
AE Raster Hierarchical rendering