本文整理汇总了C#中tagRECT类的典型用法代码示例。如果您正苦于以下问题:C# tagRECT类的具体用法?C# tagRECT怎么用?C# tagRECT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
tagRECT类属于命名空间,在下文中一共展示了tagRECT类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GeneratePreview
private void GeneratePreview()
{
if ((picStylePreview == null) || (g_pGxView == null))
return;
tagRECT r = new tagRECT();
r.bottom = picStylePreview.ClientSize.Height;
r.top = 0;
r.right = picStylePreview.ClientSize.Width;
r.left = 0;
bmpPreview = new Bitmap(r.right, r.bottom);
System.Drawing.Graphics GrpObj = Graphics.FromImage(bmpPreview);
try
{
g_pGxView.PreviewItem((Int64)GrpObj.GetHdc(), r);
GrpObj.ReleaseHdc();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
finally
{
GrpObj.Dispose();
}
picStylePreview.Image = bmpPreview;
}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:28,代码来源:FrmGxStyleView.cs
示例2: SaveAsImage_Shown
private void SaveAsImage_Shown(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
axPXV_Control1.CreateNewBlankDoc(500, 500, 1);
var page = axPXV_Control1.Doc.CoreDoc.Pages[0];
var CC = axPXV_Control1.Doc.CoreDoc.CreateContentCreator();
//page.Document.AddImageFromFile(openFileDialog1.FileName);
//axPXV_Control1.Doc.CoreDoc.WriteToFile(openFileDialog1.FileName);
IXC_ImageFileFormatIDs img = IXC_ImageFileFormatIDs.FMT_PBM_ID;
page.Document.WriteToFile(openFileDialog1.FileName);
IXC_PageFormat nFormat = IXC_PageFormat.PageFormat_8Indexed;
//ConvertFormatToIndx(page, nFormat);
IXC_Channel sd = IXC_Channel.Channel_R;
IIXC_Page d;
axPXV_Control1.CreateNewBlankDoc(600, 600, 1);
PXC_BoxType bx = new PXC_BoxType();
PXC_Matrix mtr = page.GetMatrix(bx);
page.GetMatrix(bx);
tagRECT tgRct = new tagRECT();
IIXC_Inst inst = (IIXC_Inst)axPXV_Control1.Inst.GetExtension("IXC");
}
开发者ID:bohdankruchak,项目名称:smartcoloring,代码行数:25,代码来源:SaveAsImage.cs
示例3: PreviewItem
public void PreviewItem(IStyleGalleryItem pItem, int hDC, tagRECT r)
{
//Draw a representation of the item to the given DC.
try
{
m_pClass.Preview(pItem.Item, hDC, ref r);
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.ToString());
}
}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:12,代码来源:clsGxStyleGalleryClass.cs
示例4: PreviewSymbol
public Bitmap PreviewSymbol(IStyleGalleryClass pStyleGalleryClass, object galleryItem, int imgWidth, int imgHeight)
{
Bitmap bitmap = new Bitmap(imgWidth, imgHeight);
Graphics graphics = Graphics.FromImage(bitmap);
tagRECT rect = new tagRECT();
rect.right = bitmap.Width;
rect.bottom = bitmap.Height;
System.IntPtr hdc = graphics.GetHdc();
pStyleGalleryClass.Preview(galleryItem, hdc.ToInt32(), ref rect);
graphics.ReleaseHdc(hdc);
graphics.Dispose();
return bitmap;
}
开发者ID:lovelll,项目名称:VisualMenuBar,代码行数:13,代码来源:ColorStyle.cs
示例5: StyleGalleryItemToBmp
public static Bitmap StyleGalleryItemToBmp(int pWidth, int pHeight, IStyleGalleryClass pStyleGalleryClass, IStyleGalleryItem pStyleGalleryItem)
{
/// 通过符号库中的IStyleGalleryItem 和 IStyleGalleryClass类别生成图片预览
Bitmap bitmap = new Bitmap(pWidth, pHeight);
System.Drawing.Graphics pGraphics = System.Drawing.Graphics.FromImage(bitmap);
tagRECT rect = new tagRECT();
rect.right = bitmap.Width;
rect.bottom = bitmap.Height;
//生成预览
IntPtr hdc = new IntPtr();
hdc = pGraphics.GetHdc();
pStyleGalleryClass.Preview(pStyleGalleryItem.Item, hdc.ToInt32(), ref rect);
pGraphics.ReleaseHdc(hdc);
pGraphics.Dispose();
return bitmap;
}
开发者ID:chinasio,项目名称:minegis,代码行数:17,代码来源:Form1.cs
示例6: OnClick
protected override void OnClick(EventArgs e)
{
base.OnClick(e);
tagRECT rect = new tagRECT();
GetWindowRect(this.Handle, ref rect);
IColorPalette pColorPalette = new ColorPaletteClass();
IColor pInColor = new RgbColorClass();
pInColor.Transparency = 255;
if (m_IsNoColor == true)
pInColor.NullColor = true;
else
{
if (m_ESRIColor == null)
pInColor.RGB = ConvertSystemColorToESRIColor(m_SystemColor.ToArgb());
else
{
pInColor.RGB = m_ESRIColor.RGB;
}
}
bool bSelectColor = false;
bSelectColor = pColorPalette.TrackPopupMenu(ref rect, pInColor, false, this.Handle.ToInt32());
if (bSelectColor == true)
{
m_ESRIColor = pColorPalette.Color;
if (m_ESRIColor.NullColor != true)
{
m_IsNoColor = false;
m_SystemColor = Color.FromArgb(ConvertSystemColorToESRIColor(m_ESRIColor.RGB));
}
else
{
m_IsNoColor = true;
m_SystemColor = this.BackColor;
}
Invalidate();
}
}
开发者ID:lovelll,项目名称:DQHP,代码行数:43,代码来源:ColorSelectorButton.cs
示例7: setFrame
public void setFrame(WebView sender, ref tagRECT frame)
{
}
开发者ID:therealmitchconnors,项目名称:webkitdotnet,代码行数:3,代码来源:WebUIDelegate.cs
示例8: paintCustomScrollCorner
public void paintCustomScrollCorner(WebView WebView, int hDC, tagRECT rect)
{
}
开发者ID:therealmitchconnors,项目名称:webkitdotnet,代码行数:3,代码来源:WebUIDelegate.cs
示例9: drawHeaderInRect
public void drawHeaderInRect(WebView WebView, ref tagRECT rect, int drawingContext)
{
}
开发者ID:therealmitchconnors,项目名称:webkitdotnet,代码行数:3,代码来源:WebUIDelegate.cs
示例10: InitializeWebKit
private void InitializeWebKit()
{
activationContext.Activate();
resourceIntercepter = new ResourcesIntercepter(this);
Marshal.AddRef(Marshal.GetIUnknownForObject(resourceIntercepter));
frameLoadDelegate = new WebFrameLoadDelegate();
Marshal.AddRef(Marshal.GetIUnknownForObject(frameLoadDelegate));
downloadDelegate = new WebDownloadDelegate(this);
Marshal.AddRef(Marshal.GetIUnknownForObject(downloadDelegate));
uiDelegate = new WebUIDelegate(this);
Marshal.AddRef(Marshal.GetIUnknownForObject(uiDelegate));
resourcesLoadDelegate = new WebResourceLoadDelegate(this);
Marshal.AddRef(Marshal.GetIUnknownForObject(resourcesLoadDelegate));
//editingDelegate = new WebEditingDelegate(this);
//Marshal.AddRef(Marshal.GetIUnknownForObject(editingDelegate));
// not used (yet)
policyDelegate = new WebPolicyDelegate(AllowNavigation, AllowDownloads, AllowNewWindows, this);
Marshal.AddRef(Marshal.GetIUnknownForObject(policyDelegate));
formDelegate = new WebFormDelegate(this);
Marshal.AddRef(Marshal.GetIUnknownForObject(formDelegate));
center = new WebNotificationCenter();
Marshal.AddRef(Marshal.GetIUnknownForObject(center));
cssmanager = new WebKitDOMCSSManager(this);
Marshal.AddRef(Marshal.GetIUnknownForObject(cssmanager));
undoManager = new CustomUndoSystem(this);
appearance = new AppearanceSettings(this);
observer = new WebNotificationObserver();
webView.setHostWindow(this.Handle.ToInt32());
((WebViewClass)webView).setPolicyDelegate(policyDelegate);
webView.setFrameLoadDelegate(frameLoadDelegate);
webView.setResourceLoadDelegate(resourcesLoadDelegate);
webView.setDownloadDelegate(downloadDelegate);
webView.setUIDelegate(uiDelegate);
tagRECT rect = new tagRECT();
rect.top = rect.left = 0;
rect.bottom = this.Height - 1;
rect.right = this.Width - 1;
webView.initWithFrame(rect, null, null);
IWebViewPrivate webViewPrivate = (IWebViewPrivate)webView;
webViewHWND = (IntPtr)webViewPrivate.viewWindow();
webViewPrivate.setFormDelegate(formDelegate);
// Subscribe to FrameLoadDelegate events
((WebFrameLoadDelegate)frameLoadDelegate).DidRecieveTitle += new DidRecieveTitleEvent(frameLoadDelegate_DidRecieveTitle);
((WebFrameLoadDelegate)frameLoadDelegate).DidFinishLoadForFrame += new DidFinishLoadForFrameEvent(frameLoadDelegate_DidFinishLoadForFrame);
((WebFrameLoadDelegate)frameLoadDelegate).DidStartProvisionalLoadForFrame += new DidStartProvisionalLoadForFrameEvent(frameLoadDelegate_DidStartProvisionalLoadForFrame);
((WebFrameLoadDelegate)frameLoadDelegate).DidCommitLoadForFrame += new DidCommitLoadForFrameEvent(frameLoadDelegate_DidCommitLoadForFrame);
((WebFrameLoadDelegate)frameLoadDelegate).DidFailLoadWithError += new DidFailLoadWithErrorEvent(frameLoadDelegate_DidFailLoadWithError);
((WebFrameLoadDelegate)frameLoadDelegate).DidFailProvisionalLoadWithError += new DidFailProvisionalLoadWithErrorEvent(frameLoadDelegate_DidFailProvisionalLoadWithError);
#if DEBUG || RELEASE
((WebFrameLoadDelegate)frameLoadDelegate).WindowScriptObjectAvailable += new WindowScriptObjectAvailableEvent(WebKitBrowser_WindowScriptObjectAvailable);
((WebFrameLoadDelegate)frameLoadDelegate).DidClearWindowObject += new DidClearWindowObjectEvent(WebKitBrowser_DidClearWindowObject);
#endif
// DownloadDelegate events
downloadDelegate.DecideDestinationWithSuggestedFilename += new DecideDestinationWithSuggestedFilenameEvent(downloadDelegate_DecideDestinationWithSuggestedFilename);
downloadDelegate.DidBegin += new DidBeginEvent(downloadDelegate_DidBegin);
// UIDelegate events
uiDelegate.CreateWebViewWithRequest += new CreateWebViewWithRequestEvent(uiDelegate_CreateWebViewWithRequest);
uiDelegate.CloseWindowRequest += new CloseWindowRequest(uiDelegate_CloseWindowRequest);
uiDelegate.StatusTextChanged += new StatusTextChangedEvent(uiDelegate_StatusTextChanged);
uiDelegate.RunJavaScriptAlertPanelWithMessage += new RunJavaScriptAlertPanelWithMessageEvent(uiDelegate_RunJavaScriptAlertPanelWithMessage);
uiDelegate.RunJavaScriptConfirmPanelWithMessage += new RunJavaScriptConfirmPanelWithMessageEvent(uiDelegate_RunJavaScriptConfirmPanelWithMessage);
uiDelegate.RunJavaScriptTextInputPanelWithPrompt += new RunJavaScriptTextInputPanelWithPromptEvent(uiDelegate_RunJavaScriptTextInputPanelWithPrompt);
uiDelegate.RunJavaScriptPromptBeforeUnload += new RunJavaScriptPromptBeforeUnload(uiDelegate_RunJavaScriptPromptBeforeUnload);
uiDelegate.MouseDidMoveOverElement += new MouseDidMoveOverElement(uiDelegate_UpdateCurrentElement);
uiDelegate.GeolocationReq += new AllowGeolocationRequest(uiDelegate_GeolocationReq);
// FormDelegate Events
formDelegate.SubmitForm += new SubmitForm(formDelegate_SubmitForm);
formDelegate.TextChangedInArea += new TextChangedInArea(formDelegate_TextChangedInArea);
formDelegate.TextChangedInField += new TextChangedInField(formDelegate_TextChangedInField);
formDelegate.TextFieldBeginEditing += new TextFieldBeginEditing(formDelegate_TextFieldBeginEditing);
formDelegate.TextFieldEndEditing += new TextFieldEndEditing(formDelegate_TextFieldEndEditing);
// ResourcesLoadDelegate
resourcesLoadDelegate.PluginFailed += new PluginFailedWithError(resourcesLoadDelegate_PluginFailed);
resourcesLoadDelegate.ResourceLoaded += new ResourceFinishedLoading(resourcesLoadDelegate_ResourceLoaded);
resourcesLoadDelegate.ResourceLoading += new ResourceStartedLoading(resourcesLoadDelegate_ResourceLoading);
resourcesLoadDelegate.ResourceSizeAvailable += new ResourceSizeAvailableEventHandler(resourcesLoadDelegate_ResourceProgress);
resourcesLoadDelegate.ResourceRequestSent += new ResourceRequest(resourcesLoadDelegate_ResourceRequestSent);
resourcesLoadDelegate.ResourceFailedLoading += new ResourceFailed(resourcesLoadDelegate_ResourceFailedLoading);
//.........这里部分代码省略.........
开发者ID:vebin,项目名称:webkit2.net,代码行数:101,代码来源:WebKitBrowser.cs
示例11: cbOutlineColor_MouseUp
//填充外边框颜色变化响应事件
private void cbOutlineColor_MouseUp(object sender, MouseEventArgs e)
{
IRgbColor pColor = new RgbColor();
pColor.RGB = 255;
tagRECT ptagRECT = new tagRECT();
ptagRECT.left = cbOutlineColor.PointToScreen(System.Drawing.Point.Empty).X;
ptagRECT.bottom = cbOutlineColor.PointToScreen(System.Drawing.Point.Empty).Y + cbOutlineColor.Height;
IColorPalette pColorPalette = new ColorPalette();
pColorPalette.TrackPopupMenu(ref ptagRECT, pColor, false, 0);
pColor = pColorPalette.Color as IRgbColor;
Color color = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);
//btOutlineColor.BackColor = color;
cbOutlineColor.BackColor = color;
ILineSymbol pLineSymbol = ((IFillSymbol)pStyleGalleryItem.Item).Outline;
pLineSymbol.Color = pColor;
((IFillSymbol)pStyleGalleryItem.Item).Outline = pLineSymbol;
PreviewPicture();
}
开发者ID:Kingvey,项目名称:ConstructionLandEvaluationSystem,代码行数:19,代码来源:FormSymbology.cs
示例12: OnMouseDown
public override void OnMouseDown(int Button, int Shift, int X, int Y)
{
IMap map;
IPoint clickedPoint = m_hookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
//If ActiveView is a PageLayout
if (m_hookHelper.ActiveView is IPageLayout)
{
//See whether the mouse has been clicked over a Map in the PageLayout
map = m_hookHelper.ActiveView.HitTestMap(clickedPoint);
//If mouse click isn't over a Map exit
if (map == null)
return;
//Ensure the Map is the FocusMap
if ((!object.ReferenceEquals(map, m_hookHelper.FocusMap)))
{
m_hookHelper.ActiveView.FocusMap = map;
m_hookHelper.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}
//Still need to convert the clickedPoint into map units using the map's IActiveView
clickedPoint = ((IActiveView)map).ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
}
else //Or ActiveView is a Map
{
map = m_hookHelper.FocusMap;
}
IActiveView activeView = (IActiveView)map;
IRubberBand rubberEnv = new RubberEnvelopeClass();
IGeometry geom = rubberEnv.TrackNew(activeView.ScreenDisplay, null);
IArea area = (IArea)geom;
//Extra logic to cater for the situation where the user simply clicks a point on the map
//or where envelope is so small area is zero
if ((geom.IsEmpty == true) || (area.Area == 0))
{
//create a new envelope
IEnvelope tempEnv = new EnvelopeClass();
//create a small rectangle
ESRI.ArcGIS.esriSystem.tagRECT RECT = new tagRECT();
RECT.bottom = 0;
RECT.left = 0;
RECT.right = 5;
RECT.top = 5;
//transform rectangle into map units and apply to the tempEnv envelope
IDisplayTransformation dispTrans = activeView.ScreenDisplay.DisplayTransformation;
dispTrans.TransformRect(tempEnv,ref RECT, 4); //4 = esriDisplayTransformationEnum.esriTransformToMap)
tempEnv.CenterAt(clickedPoint);
geom = (IGeometry)tempEnv;
}
//Set the spatial reference of the search geometry to that of the Map
ISpatialReference spatialReference = map.SpatialReference;
geom.SpatialReference = spatialReference;
map.SelectByShape(geom, null, false);
activeView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, activeView.Extent);
}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:66,代码来源:SelectFeatures.cs
示例13: SendMessage
public static extern void SendMessage(HandleRef hWnd, uint msg,
IntPtr wParam, ref tagRECT lParam);
开发者ID:blacklensama,项目名称:earthquake-project-ui,代码行数:2,代码来源:GeneralClasses.cs
示例14: GetClientRect
public static extern bool GetClientRect(IntPtr hWnd, out tagRECT lpRect);
开发者ID:blacklensama,项目名称:earthquake-project-ui,代码行数:1,代码来源:GeneralClasses.cs
示例15: webViewPrintingMarginRect
public tagRECT webViewPrintingMarginRect(WebView WebView)
{
PageSettings settings = owner.PageSettings;
// WebKit specifies margins in 1000ths of an inch. (???)
// PrinterResolution.Y returns 0 for some reason,
// on Adobe distiller anyway, so we'll use X for the moment.
int dpi = settings.PrinterResolution.X;
int marginLeft = settings.Margins.Left;
int marginRight = settings.Margins.Right;
int marginTop = settings.Margins.Top;
int marginBottom = settings.Margins.Bottom;
int pageWidth = settings.PaperSize.Width;
int pageHeight = settings.PaperSize.Height;
// TODO: find out what these are actually supposed to be
// the x10 and x20 are completely arbitrary, based on
// what I found fits an A4 portrait page with 1 inch
// margins...
tagRECT rect = new tagRECT();
rect.left = marginLeft;
rect.top = marginTop;
rect.right = marginRight * 10;
rect.bottom = marginBottom * 20;
return rect;
/*rect.left = 20;
rect.top = 20;
rect.right = 400;
rect.bottom = 400;
return rect;*/
}
开发者ID:duponamk,项目名称:webkitdotnet,代码行数:33,代码来源:WebUIDelegate.cs
示例16: cbColor_MouseUp
//点、线、面填充颜色变化响应事件
private void cbColor_MouseUp(object sender, MouseEventArgs e)
{
IRgbColor pColor = new RgbColor(); //颜色实例
pColor.RGB = 255;
tagRECT pTag = new tagRECT(); //用于下面显示 ColorPalette 的位置
pTag.left = cbColor.PointToScreen(System.Drawing.Point.Empty).X; //按钮控件的左边全局横坐标
pTag.bottom = cbColor.PointToScreen(System.Drawing.Point.Empty).Y + cbColor.Height; //按钮控件的下边全局纵坐标
IColorPalette pColorPalette = new ColorPalette();
pColorPalette.TrackPopupMenu(ref pTag, pColor, false, 0); //显示 ColorPalette
pColor = pColorPalette.Color as IRgbColor; //获取选中的颜色
Color color = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue); //将颜色转为 C# 颜色
btColor.BackColor = color;
cbColor.BackColor = color;
switch (((IFeatureLayer)pLayer).FeatureClass.ShapeType) //判断几何体样式
{
case esriGeometryType.esriGeometryPoint: //点
((IMarkerSymbol)pStyleGalleryItem.Item).Color = pColor; //转为 IMarkerSymbol,注意改好后要在图片上显示
PreviewPicture();
break;
case esriGeometryType.esriGeometryPolyline: //线
((ILineSymbol)pStyleGalleryItem.Item).Color = pColor; //转为 ILineSymbol
PreviewPicture();
break;
case esriGeometryType.esriGeometryPolygon: //面
((IFillSymbol)pStyleGalleryItem.Item).Color = pColor; //转为 IFillSymbol
PreviewPicture();
break;
default:
break;
}
}
开发者ID:Kingvey,项目名称:ConstructionLandEvaluationSystem,代码行数:33,代码来源:FormSymbology.cs
示例17: drawBackground
public void drawBackground(WebView sender, int hDC, ref tagRECT dirtyRect)
{
}
开发者ID:runt18,项目名称:open-webkit-sharp,代码行数:4,代码来源:WebUIDelegate.cs
示例18: CreateBitmap
/// <summary>
/// Create Bitmap From ESRI Dataset
/// </summary>
/// <param name="dataset">Dataset to generate an image from</param>
/// <param name="imageFormat">Output image format</param>
/// <param name="size">Size of output image</param>
/// <param name="resolution">Resolution of output image (dpi)</param>
/// <param name="background">Background color</param>
/// <param name="filename">Ouput filename</param>
public static void CreateBitmap(IDataset dataset, esriImageFormat imageFormat, Size size, ushort resolution, Color background, string filename) {
ILayer layer = null;
switch (dataset.Type) {
case esriDatasetType.esriDTFeatureClass:
IFeatureClass featureClass = (IFeatureClass)dataset;
switch (featureClass.FeatureType) {
case esriFeatureType.esriFTDimension:
layer = new DimensionLayerClass();
break;
case esriFeatureType.esriFTAnnotation:
layer = new FeatureLayerClass();
IGeoFeatureLayer geoFeaureLayer = (IGeoFeatureLayer)layer;
geoFeaureLayer.DisplayAnnotation = true;
break;
case esriFeatureType.esriFTComplexEdge:
case esriFeatureType.esriFTComplexJunction:
case esriFeatureType.esriFTSimple:
case esriFeatureType.esriFTSimpleEdge:
case esriFeatureType.esriFTSimpleJunction:
layer = new FeatureLayerClass();
break;
}
if (layer == null) { return; }
IFeatureLayer featureLayer = (IFeatureLayer)layer;
featureLayer.FeatureClass = featureClass;
break;
case esriDatasetType.esriDTRasterDataset:
layer = new RasterLayerClass();
IRasterLayer rasterLayer = (IRasterLayer)layer;
rasterLayer.CreateFromDataset((IRasterDataset)dataset);
break;
default:
string message = string.Format("[{0}] is not supported", dataset.Type.ToString());
throw new Exception(message);
}
if (layer == null) { return; }
// Create In-memory Map
IMap map = new MapClass();
map.AddLayer(layer);
IActiveView activeView = (IActiveView)map;
IExport export = null;
tagRECT rect = new tagRECT();
// Set Format Specific Properties
switch (imageFormat) {
case esriImageFormat.esriImageJPG:
export = new ExportJPEGClass();
IExportJPEG exportJpeg = (IExportJPEG)export;
exportJpeg.ProgressiveMode = false;
exportJpeg.Quality = 100;
break;
default:
throw new Exception("[" + imageFormat.ToString() + "] is not supported");
}
if (export == null) {
throw new Exception("Failed to Created Exporter");
}
// Set Background
if ((export is IExportBMP) ||
(export is IExportGIF) ||
(export is IExportJPEG) ||
(export is IExportPNG) ||
(export is IExportTIFF)) {
IExportImage exportImage = (IExportImage)export;
exportImage.ImageType = esriExportImageType.esriExportImageTypeTrueColor;
exportImage.BackgroundColor = GeodatabaseUtility.ToESRIColor(background);
}
// Set Export Frame
rect = activeView.ExportFrame;
rect.left = 0;
rect.top = 0;
rect.right = size.Width;
rect.bottom = size.Height;
// Set Output Extent
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords(rect.left, rect.top, rect.right, rect.bottom);
export.PixelBounds = envelope;
export.Resolution = resolution;
export.ExportFileName = filename;
// Export map to image
int intHdc = export.StartExporting();
activeView.Output(intHdc, resolution, ref rect, null, null);
//.........这里部分代码省略.........
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:101,代码来源:GeodatabaseUtility.cs
示例19: InitializeWebKit
private void InitializeWebKit()
{
activationContext.Activate();
frameLoadDelegate = new WebFrameLoadDelegate();
Marshal.AddRef(Marshal.GetIUnknownForObject(frameLoadDelegate));
downloadDelegate = new WebDownloadDelegate();
Marshal.AddRef(Marshal.GetIUnknownForObject(downloadDelegate));
policyDelegate = new WebPolicyDelegate(AllowNavigation, AllowDownloads, AllowNewWindows);
Marshal.AddRef(Marshal.GetIUnknownForObject(policyDelegate));
uiDelegate = new WebUIDelegate(this);
Marshal.AddRef(Marshal.GetIUnknownForObject(uiDelegate));
webNotificationCenter = new WebNotificationCenter();
Marshal.AddRef(Marshal.GetIUnknownForObject(webNotificationCenter)); // TODO: find out if this is really needed
webNotificationObserver = new WebNotificationObserver();
webNotificationCenter.defaultCenter().addObserver(webNotificationObserver, "WebProgressEstimateChangedNotification", webView);
webNotificationCenter.defaultCenter().addObserver(webNotificationObserver, "WebProgressStartedNotification", webView);
webNotificationCenter.defaultCenter().addObserver(webNotificationObserver, "WebProgressFinishedNotification", webView);
webView.setPolicyDelegate(policyDelegate);
webView.setFrameLoadDelegate(frameLoadDelegate);
webView.setDownloadDelegate(downloadDelegate);
webView.setUIDelegate(uiDelegate);
webView.setHostWindow(this.host.Handle.ToInt32());
tagRECT rect = new tagRECT();
rect.top = rect.left = 0;
rect.bottom = this.host.Height - 1;
rect.right = this.host.Width - 1;
webView.initWithFrame(rect, null, null);
IWebViewPrivate webViewPrivate = (IWebViewPrivate)webView;
webViewHWND = (IntPtr)webViewPrivate.viewWindow();
// Subscribe to FrameLoadDelegate events
frameLoadDelegate.DidRecieveTitle += new DidRecieveTitleEvent(frameLoadDelegate_DidRecieveTitle);
frameLoadDelegate.DidFinishLoadForFrame += new DidFinishLoadForFrameEvent(frameLoadDelegate_DidFinishLoadForFrame);
frameLoadDelegate.DidStartProvisionalLoadForFrame += new DidStartProvisionalLoadForFrameEvent(frameLoadDelegate_DidStartProvisionalLoadForFrame);
frameLoadDelegate.DidCommitLoadForFrame += new DidCommitLoadForFrameEvent(frameLoadDelegate_DidCommitLoadForFrame);
frameLoadDelegate.DidFailLoadWithError += new DidFailLoadWithErrorEvent(frameLoadDelegate_DidFailLoadWithError);
frameLoadDelegate.DidFailProvisionalLoadWithError += new DidFailProvisionalLoadWithErrorEvent(frameLoadDelegate_DidFailProvisionalLoadWithError);
frameLoadDelegate.DidClearWindowObject += new DidClearWindowObjectEvent(frameLoadDelegate_DidClearWindowObject);
// DownloadDelegate events
downloadDelegate.DidReceiveResponse += new DidReceiveResponseEvent(downloadDelegate_DidReceiveResponse);
downloadDelegate.DidReceiveDataOfLength += new DidReceiveDataOfLengthEvent(downloadDelegate_DidReceiveDataOfLength);
downloadDelegate.DecideDestinationWithSuggestedFilename += new DecideDestinationWithSuggestedFilenameEvent(downloadDelegate_DecideDestinationWithSuggestedFilename);
downloadDelegate.DidBegin += new DidBeginEvent(downloadDelegate_DidBegin);
downloadDelegate.DidFinish += new DidFinishEvent(downloadDelegate_DidFinish);
downloadDelegate.DidFailWithError += new DidFailWithErrorEvent(downloadDelegate_DidFailWithError);
// UIDelegate events
uiDelegate.CreateWebViewWithRequest += new CreateWebViewWithRequestEvent(uiDelegate_CreateWebViewWithRequest);
uiDelegate.RunJavaScriptAlertPanelWithMessage += new RunJavaScriptAlertPanelWithMessageEvent(uiDelegate_RunJavaScriptAlertPanelWithMessage);
uiDelegate.RunJavaScriptConfirmPanelWithMessage += new RunJavaScriptConfirmPanelWithMessageEvent(uiDelegate_RunJavaScriptConfirmPanelWithMessage);
uiDelegate.RunJavaScriptTextInputPanelWithPrompt += new RunJavaScriptTextInputPanelWithPromptEvent(uiDelegate_RunJavaScriptTextInputPanelWithPrompt);
// Notification events
webNotificationObserver.OnNotify += new OnNotifyEvent(webNotificationObserver_OnNotify);
activationContext.Deactivate();
}
开发者ID:tsupo,项目名称:webkitdotnet,代码行数:67,代码来源:WebKitBrowserCore.cs
示例20: OnMouseDown
protected override void OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)
{
int X = arg.X;
int Y = arg.Y;
IMxApplication pMxApp = null;
IMxDocument pMxDoc = null;
pMxApp = (IMxApplication)ArcMap.Application;
pMxDoc = (IMxDocument)ArcMap.Application.Document;
// calculate tolerance rectangle to identify features inside it
int Tolerance = 0;
Tolerance = pMxDoc.SearchTolerancePixels;
IDisplayTransformation pDispTrans = null;
pDispTrans = pMxApp.Display.DisplayTransformation;
tagRECT pToleranceRect = new tagRECT();
pToleranceRect.left = X - Tolerance;
pToleranceRect.right = X + Tolerance;
pToleranceRect.top = Y - Tolerance;
pToleranceRect.bottom = Y + Tolerance;
IEnvelope pSearchEnvelope = null;
pSearchEnvelope = new EnvelopeClass();
pDispTrans.TransformRect(pSearchEnvelope, ref pToleranceRect, (int)(esriDisplayTransformationEnum.esriTransformPosition | esriDisplayTransformationEnum.esriTransformToMap));
// identify feature points of measurement
IBasicDocument pBasicDoc = null;
pBasicDoc = (IBasicDocument)ArcMap.Application.Document;
pSearchEnvelope.SpatialReference = pMxDoc.ActiveView.FocusMap.SpatialReference;
IIdentify pIdentify = null;
pIdentify = (IIdentify)pMxDoc.FocusMap.get_Layer(0);
if (pIdentify == null)
{
MessageBox.Show("No layer");
return;
}
IArray pIDArray = null;
pIDArray = pIdentify.Identify(pSearchEnvelope);
// get object from feature point
IIdentifyObj pIDObj = null;
if (pIDArray != null)
pIDObj = (IIdentifyObj)pIDArray.get_Element(0);
if (pIDObj == null)
{
MessageBox.Show("No feature was identified");
return;
}
// get the name of the layer containing feature points
ILayer pLayer = null;
pLayer = pMxDoc.FocusMap.get_Layer(0);
string layerName = null;
layerName = pLayer.Name;
// get primary display field for measurement values and set names of a date/time field and gage ID field
IFeatureLayer pFeatLayer = null;
pFeatLayer = (IFeatureLayer)pLayer;
string dataFldName = null;
string timefldName = null;
string gageIDFldName = null;
dataFldName = "TSValue";
timefldName = "TSDateTime"; // substitute data/time field name for different dataset
gageIDFldName = "Name"; // substitute gage ID field name for different dataset
// get display table from layer
ITable pTable = null;
IDisplayTable pDisplayTable = null;
pDisplayTable = (IDisplayTable)pLayer;
if (pDisplayTable != null)
{
pTable = pDisplayTable.DisplayTable;
if (pTable == null)
goto THEEND;
}
// get fields from display table
IFields pFields = null;
pFields = pTable.Fields;
long fldCount = 0;
fldCount = pFields.FieldCount;
// create WHERE clause from identified objects of measurement points
int gageIDFldIdx = 0;
gageIDFldIdx = pFields.FindField(gageIDFldName);
IRowIdentifyObject pRowIDObj = null;
pRowIDObj = (IRowIdentifyObject)pIDObj;
string gageID = null;
gageID = (string)pRowIDObj.Row.get_Value(gageIDFldIdx);
IFeatureLayerDefinition pFeatureLayerDef = null;
pFeatureLayerDef = (IFeatureLayerDefinition)pLayer;
string definitionExpression = null;
definitionExpression = pFeatureLayerDef.DefinitionExpression;
//.........这里部分代码省略.........
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:101,代码来源:TimeSeriesGraphAddIn.cs
注:本文中的tagRECT类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论