POINT(x,y) command ! please help..

  • Thread starter Thread starter Serdar C
  • Start date Start date
S

Serdar C

i am looking for similar a command in VB.NET or c# which
acts same as Point(x,y) command used in VB6.0.. please
mail me if u know the answer..
 
Hi,

On a form I use the line command.
Dim g As Graphics = e.Graphics

g.DrawLine(Pens.Black, 10, 10, 10, 10)

Ken
 
Hello,

Ken Tucker said:
On a form I use the line command.
Dim g As Graphics = e.Graphics

g.DrawLine(Pens.Black, 10, 10, 10, 10)

Point was used to get the color at a specific location.

Regards,
Herfried K. Wagner
 
José Manuel Agüero said:
Well... not exactly. There is no fast-enough method, but there is a
way in .NET:

'e is a system.graphics object...
dim b as new system.drawing.bitmap(e.clip.getbounds().width,
e.clip.getbounds().height, e) return e.getpixel(x, y) 'Returns a
system.drawing.color value.

Please check and correct any possible mistake (I tried to give an
idea only).

Of course this method is too slow for a single pixel, but it uses
managed code... I'm not really sure, but I think there is a way of
creating a system.graphics.bitmap from any hDC (I leave this for
experts ;-) )

AFAIK there is no way to create a bitmap from an hDC (doesn't mean there is
no way to fill a bitmap from an hDC). There is
System.Drawing.Graphics.FromHdc, but a graphics object does not have a
GetPixel method.
 
Back
Top