ArcGIS connected to SDE and exported Image Registration

Source: Internet
Author: User
Connecttosde = new connecttosde ("59.64.154.185", "5152", "SDE", "SDE", "", "SDE. Default ");
Try
{
Connecttosde. Connect ();

Ifeatureworkspace featurewsp = (ifeatureworkspace) connecttosde. workspace;
Ifeatureclass featureclass = featurewsp. openfeatureclass ("c400100 ");

// Ifeaturedataset featuredataset = featurewsp. openfeaturedataset ("clip4001 ");
// Ifeatureworkspace featurewsp2 = (ifeatureworkspace) featuredataset. workspace;
// Ifeatureclass featureclass = featurewsp2.openfeatureclass ("c400100 ");

Ifeaturelayer featurelayer = new featurelayerclass ();
Featurelayer. featureclass = featureclass;
Idataset dataset = (idataset) featureclass;
Featurelayer. Name = dataset. Name;
IMAP map = new mapclass ();
Map. addlayer (ilayer) featurelayer );

Iactiveview activeview = (iactiveview) map;
Iexportjpeg exportjpg = new exportjpegclass ();
Exportjpg. progressivemode = false;
Exportjpg. High-quality = 100;
Iexportimage exportimg = (iexportimage) exportjpg;
Exportimg. imagetype = esriexportimagetype. esriexportimagetypetruecolor;
Exportimg. width = 400;
Exportimg. Height = 300;
Irgbcolor icolor = new rgbcolorclass ();
Icolor. red= 255;
Icolor. Blue = 255;
Icolor. green= 255;
Exportimg. backgroundcolor = icolor; // The background is white.
Iworldfilesettings iwfs = (iworldfilesettings) exportimg;
Iwfs. outputworldfile = false;
Iexport export = (iexport) iwfs;
Export. Resolution = 96; // activeview. screendisplay. displaytransformation. Resolution;
Tagrect userrect;
Userrect. Top = 0;
Userrect. Left = 0;
Userrect. Right = convertrwtopixels (activeview. fullextent. Width, activeview); // convert geographic coordinates to map container coordinates
Userrect. Bottom = convertrwtopixels (activeview. fullextent. Height, activeview); // convert geographic coordinates to map container coordinates
Export. exportfilename = "E: \ VS 2005 \ webservicetest \ output \ clip4001.jpg ";
Int HDC;
HDC = export. startexporting (); // output to the image file by the map container
Activeview. Output (HDC, 96, ref userrect, activeview. fullextent, null );
Export. finishexporting ();
}
From: http://bbs.esrichina-bj.cn/esri/viewthread.php? Action = printable & tid = 17014

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.