当前位置: 首页>>代码示例>>C#>>正文


C# Hwnd.AddNcInvalidArea方法代码示例

本文整理汇总了C#中System.Windows.Forms.Hwnd.AddNcInvalidArea方法的典型用法代码示例。如果您正苦于以下问题:C# Hwnd.AddNcInvalidArea方法的具体用法?C# Hwnd.AddNcInvalidArea怎么用?C# Hwnd.AddNcInvalidArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Hwnd的用法示例。


在下文中一共展示了Hwnd.AddNcInvalidArea方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddExpose

		void AddExpose (Hwnd hwnd, bool client, int x, int y, int width, int height) {
			// Don't waste time
			if ((hwnd == null) || (x > hwnd.Width) || (y > hwnd.Height) || ((x + width) < 0) || ((y + height) < 0)) {
				return;
			}

			// Keep the invalid area as small as needed
			if ((x + width) > hwnd.width) {
				width = hwnd.width - x;
			}

			if ((y + height) > hwnd.height) {
				height = hwnd.height - y;
			}

			if (client) {
				hwnd.AddInvalidArea(x, y, width, height);
				if (!hwnd.expose_pending) {
					if (!hwnd.nc_expose_pending) {
						hwnd.Queue.Paint.Enqueue(hwnd);
					}
					hwnd.expose_pending = true;
				}
			} else {
				hwnd.AddNcInvalidArea (x, y, width, height);
				
				if (!hwnd.nc_expose_pending) {
					if (!hwnd.expose_pending) {
						hwnd.Queue.Paint.Enqueue(hwnd);
					}
					hwnd.nc_expose_pending = true;
				}
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:34,代码来源:XplatUIX11.cs

示例2: AddExpose

		private void AddExpose (Hwnd hwnd, bool client, int x, int y, int width, int height) {
			// Don't waste time
			if ((hwnd == null) || (x > hwnd.Width) || (y > hwnd.Height) || ((x + width) < 0) || ((y + height) < 0)) {
				return;
			}

			// Keep the invalid area as small as needed
			if ((x + width) > hwnd.width) {
				width = hwnd.width - x;
			}

			if ((y + height) > hwnd.height) {
				height = hwnd.height - y;
			}

			if (client) {
				hwnd.AddInvalidArea(x, y, width, height);
				if (!hwnd.expose_pending && hwnd.visible) {
					MSG msg = new MSG ();
					msg.message = Msg.WM_PAINT;
					msg.hwnd = hwnd.Handle;
					EnqueueMessage (msg);
					hwnd.expose_pending = true;
				}
			} else {
				hwnd.AddNcInvalidArea (x, y, width, height);
				if (!hwnd.nc_expose_pending && hwnd.visible) {
					MSG msg = new MSG ();
					Region rgn = new Region (hwnd.Invalid);
					IntPtr hrgn = rgn.GetHrgn (null); // Graphics object isn't needed
					msg.message = Msg.WM_NCPAINT;
					msg.wParam = hrgn == IntPtr.Zero ? (IntPtr)1 : hrgn;
					msg.refobject = rgn;
					msg.hwnd = hwnd.Handle;
					EnqueueMessage (msg);
					hwnd.nc_expose_pending = true;

				}
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:40,代码来源:XplatUICarbon.cs


注:本文中的System.Windows.Forms.Hwnd.AddNcInvalidArea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。