本文整理汇总了C#中tagRECT类的典型用法代码示例。如果您正苦于以下问题:C# tagRECT类的具体用法?C# tagRECT怎么用?C# tagRECT使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
tagRECT类属于命名空间,在下文中一共展示了tagRECT类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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");
}
示例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());
}
}
示例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;
}
示例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;
}
示例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();
}
}
示例7: setFrame
public void setFrame(WebView sender, ref tagRECT frame)
{
}
示例8: paintCustomScrollCorner
public void paintCustomScrollCorner(WebView WebView, int hDC, tagRECT rect)
{
}
示例9: drawHeaderInRect
public void drawHeaderInRect(WebView WebView, ref tagRECT rect, int drawingContext)
{
}
示例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);
//.........这里部分代码省略.........
示例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();
}
示例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);
}
示例13: SendMessage
public static extern void SendMessage(HandleRef hWnd, uint msg,
IntPtr wParam, ref tagRECT lParam);
示例14: GetClientRect
public static extern bool GetClientRect(IntPtr hWnd, out tagRECT lpRect);
示例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;*/
}