[Mono-winforms-list] Graphics.FromHwnd(IntPtr.Zero) not working
joncham at gmail.com
Wed Feb 10 09:01:49 EST 2010
It's been a while since I looked at Windows.Forms issues, but I don't
think you can acquire a desktop graphics context on Linux (what windows does
when you pass IntPtr.Zero).
On Wed, Feb 10, 2010 at 3:46 AM, Stefano Del Furia <delfo at edudotnet.it>wrote:
> thaks for the reply but i don't know what you mean.
> In Windows i can use the three lines of code below and all works fine.
> Why i cannot do the same in Mono ??
> If this line
> Graphics g = Graphics.FromHwnd(IntPtr.Zero);
> create a Graphics object why i cannot use the Draw methods for drawing
> inside it ??
> Thanks again.
> -----Original Message-----
> From: Carlos Alberto Cortez <calberto.cortez at gmail.com>
> To: Stefano Del Furia <delfo at edudotnet.it>
> Cc: mono-winforms-list at lists.ximian.com
> Date: Tue, 9 Feb 2010 23:24:23 +0100
> Subject: Re: [Mono-winforms-list] Graphics.FromHwnd(IntPtr.Zero) not
> This method is defined basically to retrieve available information in the
> Graphics instance, not to do actual draw work on the screen (this could be
> accomplished by a different way, but it would be system specific, as nothing
> like that appears in the winforms api).
> 2010/2/7 Stefano Del Furia <delfo at edudotnet.it>
>> i'm using Graphics.FromHwnd(IntPtr.Zero) for drawing directly on screen
>> but under Ubuntu 9.04 it don't work.
>> The method don't return a null value but when i try to draw some object
>> like a a line nothing happened like in this way:
>> Graphics g = Graphics.FromHwnd(IntPtr.Zero);
>> Point pMousePos = new Point(e.X, e.Y);
>> g.DrawLine(p, pMousePos, lastPoint);
>> What am i wrong ??
>> Thanks in advance.
>> Mono-winforms-list maillist - Mono-winforms-list at lists.ximian.com
> Mono-winforms-list maillist - Mono-winforms-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-winforms-list