Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Serdar C
Guest
 
Posts: n/a
#1: Nov 20 '05
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..

Ken Tucker
Guest
 
Posts: n/a
#2: Nov 20 '05

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


Hi,

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

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

Ken

-------------------

"Serdar C" <serdarc@interaktif.gen.tr> wrote in message
news:030e01c36c1a$7daee7f0$a601280a@phx.gbl...[color=blue]
> 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..[/color]


Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#3: Nov 20 '05

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


Hello,

"Ken Tucker" <vb2ae@bellsouth.net> schrieb:[color=blue]
> On a form I use the line command.
> Dim g As Graphics = e.Graphics
>
> g.DrawLine(Pens.Black, 10, 10, 10, 10)[/color]

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

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet


Armin Zingler
Guest
 
Posts: n/a
#4: Nov 20 '05

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


"José Manuel Agüero" <jmaguero@vodafone.es> schrieb[color=blue]
> 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 ;-) )[/color]

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.


--
Armin

Closed Thread