System.Drawing.Graphics 中的 IntPtr.Zero 是什么意思 [英] What does IntPtr.Zero mean in System.Drawing.Graphics
本文介绍了System.Drawing.Graphics 中的 IntPtr.Zero 是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在下面的函数中获得 IntPtr.Zero 的确切含义.我使用这个函数将word文档文本范围位置像素值转换为WPF单位值.
I need to get the exact meaning of IntPtr.Zero in below function. I used this function for convert word document text range position pixel value to WPF unit value.
Graphics g = Graphics.FromHwnd(IntPtr.Zero)
通常说要传递句柄,但我没有得到它.
That normally said to pass the handle,but I didn't get it.
推荐答案
Graphics.FromHwnd
方法用于从窗口的指定处理程序创建一个 Graphics
对象.
Graphics.FromHwnd
method is used to create a Graphics
object from the specified handler of a window.
当您将 IntPtr.Zero
作为参数传递时,您正在从 Windows 桌面创建一个 Graphics
,允许您直接在屏幕上绘制.
When you pass IntPtr.Zero
as parameter you are creating a Graphics
from the windows desktop that allow you draw directly in the screen.
这篇关于System.Drawing.Graphics 中的 IntPtr.Zero 是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文