VS 2008 Finding An Ellipse From 4 Points?
Mar 30, 2011How can I calculate the bounding rectangle of an ellipse using 4 points on the ellipse?
View 1 RepliesHow can I calculate the bounding rectangle of an ellipse using 4 points on the ellipse?
View 1 RepliesI'm making a game for a school project We've created a character that moves around the screen and creates blocks behind him as he moves around.We want to make it so that when the character moves from one edge of the screen to another, it fills the screen. So in order to do this we have a Points array that stores every point the character touches on his way to a wall.We then fill the Points array with "formsurface.fillPolygon(Points)"Now I'm wondering is there anyway we can retrieve all the points that are WITHIN or INSIDE the Points array we made? ( remember the points array simply contains the outline or the path the character created, we're filling inside that outline)
View 1 RepliesA 2D object has an x/y location, x/y direction, and a velocity.During each update, its location = (location + (direction * velocity)).
This enables it to travel in any and all directions at varying speeds.Using this information, how would you find the angle (in degrees, from 0 to 360) between it's current location, and it's next location, and then use that to determine it's heading (N, S, E, W, NE, NW, SE, or SW)?
Imagine a grid of 16x16. All points are integers, there will be no partial points.I have a list of points that fall somewhere on that grid. Since each point is has an integer x,y coordinate, there can be a maximum of 256 points, but normally there will be considerably less than that.What I am trying to do is take a new point N and find the closest point to it in my list of points. The brute force approach is to use the Pythagorean theorem to find the absolute distance from each point on the list to N, and the minimum of all those distances would give me the closest point. However, since there could easily be 100 points, or so, and there is a real advantage to speed in this case, I am looking for a faster way to do this.
The first thing I thought of would be to divide the grid into four quadrants of 8x8. I could then quickly determine which quadrant N was in, and I was able to pre-compute which quadrant each of the points on the list was in. Therefore, I could easily narrow the search down to the points in the same quadrant as N, but that is invalid. If N lies near the boundary of a quadrant, the closest point might not actually be in the same quadrant as N.So what I am looking for is a way to search a list of X,Y points to quickly find the point closest to some other point N. The fact that the search area is 16x16 might help. A certain amount of pre-computation can be done on the points in the list if it helps, but N can fall anywhere in the grid.
is there a way to offset the points in a polygon without having to change each one individually the points are in an array
View 2 RepliesI am moving an ellipse over a UserControl that has a gradient filled background, how can I retrieve the background and place it in the ellipse as it moves? I need this to hide the original text, I will draw new text within the ellipse. I will capture the background in the UserControl Paint event before the original text is drawn.
View 5 RepliesI dont no if this if possible but im trying to set a tooltip on a ellipse that is drawn at run time on the system. I am able to attach the tooltip to a texbox etc but cannot attach it to the graphic.
View 4 RepliesIs it possible to draw an ellipse on each row of under a specific column of a ListView control like the following picture?[cde]...
View 3 RepliesI want a outward curve at 90 degree in the ellipse, and outward curve at 225 and another one outward curve at 270degree in the same ellipse.
View 22 Replieshow can i type text in a ellipse that i draw using graphics.drawellipse method
View 2 RepliesI have a picture box. The user can click with in the picture box. Anywhere they click it will draw another Ellipse. The problem is the edges of the picture boxes cut the image of the newly drawn ellipse. Is there a way draw the new ellipse so the user can see the entire thing?
View 6 RepliesHow to draw a rectangle inside an ellipse at runtime?
View 8 RepliesHow can I angle an ellipse by 7 degrees? My intentions are to angle the ellipse so the left side is up and the bottom right is down. [code]
View 1 RepliesI was wondering if there's a way to add points to something defined like this
[Code]....
Using the attached code, the goal is to draw a series of 1x1 rectangles to produce an image of a line. The image begins okay at point (0,0) but ends up after 5600 passes through the loop at (1884,5273) instead of at (1965, 5244). To prove the scale factor accurate I also use Drawline to draw the entire line with the same scale factor. Drawline ends up at the correct location (1965,5244).
I've manually checked the calculations with the results as noted. I'm at a total loss to understand what's going on.
' Xc = 1965
' Xp = 0
' Yc = 5244
[Code]....
The picture is a graphicspath drawing a curve through the specified green dots... the red points are the Bezier points that are auto generated by the graphics path.
Basically I want to pass in an array of points (in this case the green dots in the pic) and get an array back of the Bezier (red points) - I want to calculate the location of these points MANUALLY - and not use the graphicspath object to work it out.
It doesn't have to be exactly the same just similar.
how to place text inside an ellipse? I didn't see that anywhere in here.
View 5 Replieshow can i get the points which make a polygon from a region which was derived from the polygon's points?
View 1 RepliesA couple of options seem to be available to achieve better accuracy and shorter periods than the Timer control in VB allows, however they too seem to have their own unique drawbacks. I am trying to plot (draw) points that are calculated in my VB application and then represent them in real time with an accuracy of a couple percent. If VB can calculate the points in the microsecond time range, would it be reasonable to hang an external pulse source on a usb port and use the "Datachanged" event to count the pulses that will be summed and used to plot the points?Ultimately, this is a machine control application that requires "reasonably precise" timing - ie. CNC type control. The points are scaled and drawn and then step and direction signals are sent out through another USB port.
View 2 RepliesWhy my math keeps getting rounded to 0 decimal points by default?When I do this I get return value of 1
Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim numb1 As Integer
numb1 = 100 / 78
MsgBox(numb1)
End Sub
How to get that value up to two decimal points (like 0.00)?
How to draw a rectangle inside an ellipse by mouse events like mousedown,up,move
View 2 RepliesWhat i got is a checkedlistbox with a list of text files, iam trying to search thru the text file and add to a listbox, my code works, But from 2 Txt files its returning 2 found and each txt file has 5 lines with excat names.
[Code]....
I have a problem that I�m sure will not be hard to fix for anyone who has been using CR for some time.
To start I have created a program in VB2008 that uses a MS Access data file, I can connect to it with no problem and can also add data and amend data, so all seems to work perfectly. I have published it and it once again runs perfectly on another/s machines.I have now a requirement for a number of reports so have chosen CR for this purpose. I have connected the report to the database and that runs with no problems at all, that is until I try to run it on another machine, it seems not to be able to find the database and comes up with a database Login panel wanting me to log in with a password and Admin name.
I feel it's properly a problem with the path to the database but if I modify the path manually it still won't work.
G:DevelopmentDOT NET DevColony_4ImagesBattenhallAve_Plan.bmpand i want to find and return the value after the last '' for example in the string above i would want to return:BattenhallAve_Plan.bmp
View 5 RepliesI have FolderBrowserDialog1, how do I find the last latter of FolderBrowserDialog1.SelectedPath?
View 1 RepliesI am attempting to calculate a range of prime numbers determined by two user inputs (textboxes) I have the following code, but it displays nothing but zeros in the multiline textbox. I just need a bit of guidance here as to what is causing my code to show nothing but zeros.
Public Class PrimeNumbers
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lowBound As Double
Dim upBound As Double
[code]....
I'm connected to an access database using VB 2008.. there is information already located in the tables. But what I am looking to do, is find the "SUM" of all the data in a certain column.
View 35 RepliesI'm trying to work out a bit of a memory leak and was hoping someone can assist. The below program is running fine except for one thing. 1. The memory leak. When I run the program and watch task manager, I can see the memory usage of the program starts at roughly 14 meg. Over a period of hours, that increases pretty substantially. Eg. at 6am this morning, it was at 14 meg, and by 3pm it was at 36 meg.In a nutshell this program takes an incoming stream of data which looks like this.
MSG,3,51,350,461D3B,1427,2007/02/24,10:58:35.441,2007/02/24,11:03:35.829,,33975,,,53.82440,10.19830,,,0,0,0,0
MSG,3,51,673,44CE6D,1429,2007/02/24,10:58:35.098,2007/02/24,11:03:35.829,,39000,,,53.87798,9.88422,,,0,0,0,0
MSG,3,51,350,461D3B,1427,2007/02/24,10:58:35.848,2007/02/24,11:03:36.829,,33975,,,53.82353,10.19696,,,0,0,0,0
It basically parses the stream and places items into hash tables depending on the type of data. Eg. I have a hash table for latitude, one for longitude, one for altitude, etc.The key is always the hex code eg. in the first line above the key would be 461D3B.Essentially, as the data arrives in and is parsed and placed into hash tables depending on the type of data, I also have another hash table dedicated to keeping track of timeout times for that individual piece of data. The timer event fires and if the timeout is exceeded for that piece of data then it gets removed from all the hash tables.
I believe this is working. I've done heaps of debug output to the output window ensuring that items are being added to and removed from the hash tables successfully. Eg. ensuring that the hash table record count matches what I believe the number of active records should be.I'm at a loss what could be causing this memory leak though. I'm assuming i'm not disposing of an object properly, or not initializing/declaring it properly, but I can't work out what i'm doing wrong.One thing i'll mention though. The timer event occasionally comes up with a warning about the contents having changed during the For..Next loop. I don't think this will affect things though. As long as the hash table item count matches what it should be, I don't see that being an issue.
Imports nsoftware.IPWorks
Imports System.Data.SQLite
Public Class frmMain
[code]....
I am needing to locate a given set of numbers in a string, and have limited success, it is almost always finding the numbers that I want, but I need it to be more reliable.Below is a test program that I am using to test with and also 2 picures that may explain better that I can put into words.
[Code]...
I have a string. I need to check what characters it contains because certain invalid characters are causing my sql query not to work. In the query I select where SupplierName is equal to the string. I need to replace the invalid characters at database and vb level. But I need to know first what the characters are.
View 15 Replies