473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Trouble Creating a Point Object

I'm trying to create a Point object and set it at X = 0.5, Y = 0.5. I've
tried the following two ways:

--------------------------------------------------------
Dim pt as new System.Drawing.Point(0.5, 0.5)
--------------------------------------------------------

and

--------------------------------------------------------
Dim pt as new System.Drawing.Point
pt.X = 0.5
pt.Y = 0.5
---------------------------------------------------------

However, both methods result in a point object containing the point (0, 0)
instead of (0.5, 0.5)

How can I get the coordinates into the point object?
Nov 21 '05 #1
2 1236
Phil,

"Phil Galey" <pa*****@starcalif.com.nospam> schrieb:
--------------------------------------------------------
Dim pt as new System.Drawing.Point
pt.X = 0.5
pt.Y = 0.5
---------------------------------------------------------

However, both methods result in a point object containing the point (0, 0)
instead of (0.5, 0.5)


First, turn 'Option Strict On'. This will cause the IDE to detect the
mistake you made. 'Point' can only deal with integral coordinates. Use
'PointF' instead of 'Point' to deal with arbitrary numbers.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
If you look at the constructor for Point it takes an integer. You are
trying to send in a decimal.

Chris

"Phil Galey" <pa*****@starcalif.com.nospam> wrote in message
news:eu**************@TK2MSFTNGP14.phx.gbl...
I'm trying to create a Point object and set it at X = 0.5, Y = 0.5. I've
tried the following two ways:

--------------------------------------------------------
Dim pt as new System.Drawing.Point(0.5, 0.5)
--------------------------------------------------------

and

--------------------------------------------------------
Dim pt as new System.Drawing.Point
pt.X = 0.5
pt.Y = 0.5
---------------------------------------------------------

However, both methods result in a point object containing the point (0, 0)
instead of (0.5, 0.5)

How can I get the coordinates into the point object?

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: mcmg | last post by:
Hi, I have an asp app that works fine on a windows xp machine but does not work on a windows 2000 server. I have the following code in my global.asa: <OBJECT RUNAT=Server SCOPE=SESSION...
1
by: Saeed Amrollahi | last post by:
Dear All C++ Programmers Hello I am Saeed Amrollahi. I am a software engineer in Tehran Sewerage Company. I try to use std::map and map::find member function. I use Visual Studio .NET. my...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
16
by: scorpion53061 | last post by:
Well as some of you know I was using a tab control for a project I was building for my boss. Today he tells me that he wants: When he switches tabs to be able to switch back and see whatever...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
16
by: tshad | last post by:
This is a little complicated to explain but I have some web services on a machine that work great. The problem is that I have run into a situation where I need to set up my program to access one...
17
by: Lee Harr | last post by:
I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm)
0
by: scottf35 | last post by:
Hi, I am working on (read that - upgrading) an application. This application creates an HTTPWebRequest object, populates it with values which are then sucked out of the Request.Form object (eg...
10
by: Hendri Adriaens | last post by:
Hi, I'm trying to automate the creation of an excel file via COM. I copied my code below. I read many articles about how to release the COM objects that I create. The code below runs just fine...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.