VS 2010 Graphics.DrawCurve Length?
May 3, 2010
I am pretty sure that my questions will soon get so annoying you won't answer them, but before it happens.I am using DrawCurve (with density set to default) to draw on my picturebox. I need to know the exact length (well, not *exact* but knowing it is around +/- 1px from exact length would be nice) of the curve drawn.
Is there any function in API I could use to get what I want? If not, could you point me to the algorithm (preferably implemented in any language) that I could use with array of points as an input and length as an output value?
View 13 Replies
ADVERTISEMENT
Nov 19, 2010
Im working on a project that needs to print a report of one client.Everything went smooth untill i came across my multiline input text data.When i display it in the PrintPagePreview the text go's outside my page. Even when im printing it only the halve of my text is displayed. I googled and looked everywhere but i can't get a clear fix for it.
[Code]...
View 3 Replies
Sep 15, 2009
I'm making a class to basically print the screen. I'm going through each field and doing a drawstring, but things aren't lining up correctly. I tracked the problem down and don't know why it's happening.Take this line of code as an example:
Me.CreateGraphics.DrawString(Label1.Text, Label1.Font, Brushes.Black, Label1.Left, Label1.Top + 30)
This should draw the same text that is in label1 directly below label1 on the form. However, the drawn text is a different length than the label's text. Courier draws shorter, Sans Serif draws longer. It's doing the same thing going to a print document; it isn't matching how the label is being rendered.
View 3 Replies
May 10, 2011
I have an existing vb.net application which uses a home grown database. The database has over 60,000 unique multi-field records in it.The user can search in each field using drill-down to find a record, and then can add that record to a separate database.(60,000 collectibles described in a master database. User can drill down by category, manufacturer, year produced, etc. to find a record and then add it to their own 'collection', 'wanted', 'have for sale', or 'spares' database for record keeping.)
Instead of having them drill down, I would like for them to be able to perform a search and have all of the results (any amount of matches from 1 to 60,000+) appear on a scrolling form with a checkbox next to each so that they can simply check any that they want and do a mass add to their list databases.
The part I cannot figure out is how to have vb.net (2008) create a variable length scrolling form with the results, and how to identify the checkboxes (generated by the system for search matches) to see which, if any, have been checked by the user.
View 1 Replies
Apr 7, 2011
I am trying to do a game application similar to chess, where i need to move the game peaces(graphics) over another graphics which is the game board. using the mouse. How can I do multiple layers of graphics and control their movement(without using direct x, i know nothing about it)? Note: I have visual basic 2010 express, windows xp home
View 1 Replies
Apr 17, 2009
this is not working?
[Code]...
End WhileI am trying to read from the ": " to the end of the line. I keep getting this error: Index and length must refer to a location within the string. Parameter name: length
View 3 Replies
Feb 17, 2011
am getting the above exception while swaping Items in the list(lstRoutePriority).PFB my code
if (lstRoutePriority.SelectedIndex > 0)
{
//Swap the two items
[Code].....
View 2 Replies
May 31, 2010
I have an array in my application and I don't know how many values there will be in the array because it gets the data from a webpage. Filling the array with information from the webpage works except for the length, it always returns 999. This is my
dim Array() as string
Array = GBA(source, "<b>", "</b>")
Count = Ubound(Array)
How can I find out the length of my array?
View 8 Replies
Jul 17, 2011
I have an API that loads into memory from a button click. It can then either load an approx 10MB txt file (ASCII comma delimited characters/decimal list as a string) or live timed data from the internet. The idea is to be able to view the data in a text box. From there I can see what I am doing as far as spitting that info into a datagridview or database. The data is completely out of order in the txt file but has various Getinfo Functions / DLL's accessed via button clicks that split the data into its correct format to display in the text box. The problem I am having is not having fixed length strings in VB 2010. I don't know enough to work out if there is a simple work around or something more complicated required. Everything I have tried has left the textbox empty.
VB 2005 code that works:
Option Strict Off - I want to solve with this ON
Option Explicit On - I want to solve with this ON
Imports VB = Microsoft.VisualBasic
Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal eventArgs As
[Code] ....
View 13 Replies
Feb 3, 2012
I have a title (in one line) that can have different lengths. I need to print this title on A4 landscape - page ( draw string in print page event), but always it should be located in the middle of the page, regardless of length. If I want to determine the exact location I have to calculate the length of the string in pixels. Or maybe there is a better way to center the string on page? How can I do it?
View 2 Replies
Mar 14, 2011
This is related to my last question.Even though Access considers Nulls and zero-length strings (ZLS) separate values, often developers wish to treat them as equivalent for the sake of an If...Then statement or some other stretch of code. One way to accomplish this is to write code like this:
' Not so efficient
If IsNull(varAge) or varAge = "" Then
' do something
[code].....
View 4 Replies
Jan 6, 2010
I have a field displaying on a datagrid that the user has asked to be variable length based on the data that is returned. Is there an easy way to determine how many characters are returned for a field and then converting that to a pixel length so that I can change the length of the field in the code.
View 2 Replies
May 2, 2012
i am trying to import a fixed length text file into an access database (accdb). I already have the table created but it doesn't have to be that way. i am wondering if i know the field lengths, can i a use a SELECT INTO query to get the data into access. or do i need a schema file?
View 1 Replies
Nov 20, 2011
I am creating a math related class and one of the problems I have been having was how to create a function to return the fractional part of a double as an integer. I could easily do that if there was a way I could get the length of the digits.
-3.141 should return 3
-0.125 should return 3
-0.5 should return 1
-0.4545 should return 4
I would like to do this without using string manipulation. So far all I have gotten on the web is unanswered questions. I thought of using log, but it doesn't give the desired result when working with numbers < 0
View 3 Replies
Aug 15, 2011
I have a problem with snake game. I never tried to make a game with VB, but now i tried to make snake from this tutorial:So i added food to this snake game, and when i taking food, it increases score, but length cannot be increased and i don't know why. This code is in timer to check if snake head is on the food:
If p(m).X = food.Location.X And p(m).Y = food.Location.Y Then
score += 25
food.Visible = False
[code]....
View 9 Replies
Jun 11, 2011
[Code]...
By my logic, this should only assign .length to index IF the length of strItem is longer than 0. This check is there in case the listbox is empty, or the user has not selected an item. However, everytime I go through this code without an item selected I get:
[Code]...
View 4 Replies
Dec 26, 2011
I am wanting to create 2 tables called Stores and Locations. Locations is a table containing a unique location_code and a location. Stores is a table containing a unique store_code a store name and a variable number of location_code's and a relationship is set up between the 2 tables.
creating the Stores table in particular the location_ code. Can rows in a table have differing numbers of columns? as a particular store type could be in many diferent locations. I feel it should be possible to set up some sort of array of Location_code's in the Stores table.
View 2 Replies
Feb 6, 2012
I need to seperate a name into 2 parts using split the first part being 2 letters "That was easy" but the last part of the name would have an unknown lenght. so how do I get the unknown length? I believe I understand the Join Part here is what I have but it only works when you know the lenght of the name
Project Notes
'Form has two textboxes and one button
'first text box holds a first and last name
' 1-seperate the first and last name into 2 variables
[code]....
View 7 Replies
Nov 27, 2011
Is there a problem with changing the column length in table and using comboboxes that display a partial list of the records from that table.I had a column(Name) that was 18 chars long. I would then display only a subset of those names in a combobox by not listing records where a column called privileges was set to X. This and other uses of combobox worked fine till I increased the column length to 24. The combobox no longer filters on the privileges field though when I select the column priviliges after my selection it will display the value X.
View 1 Replies
Jan 27, 2012
Need to get length of a string minus the line feed chars and came up with this. Is there a better/more efficient way?
Function GetLenMinus_LF(s As String) As Integer
s = s.Replace(ControlChars.Lf, String.Empty)
Return s.Length
End Function
View 5 Replies
Mar 30, 2012
[Code]...
I want to create a ProgressBar with my array length, whithout timer object. When ProgressBar increment, the value in array appears in a label.
View 7 Replies
Feb 19, 2012
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fso, inputFile
Dim str As String
fso = CreateObject("Scripting.FileSystemObject")
[code]....
View 5 Replies
Jul 11, 2011
I'm trying to design cathodic protection for offshore pipelines using visual basics. However, I'm not very familiar with vb. I'm hoping I can start with basic calculations like finding pipe surface area etc. how I can design a dialog box to input pipe dimensions like length and diameter to enable me calculate the surface area?
View 4 Replies
Mar 23, 2009
"Index and length must refer to a location within the string. Parameter name: length" whenever I run this code
[Code]...
View 1 Replies
Jul 21, 2010
If using the following in an if statement I get an error: If trg.Name.Substring(4, 6).ToUpper <> ("ABCDEF") Then I get the error: "Index and length must refer to a location within the string. Parameter name: length"
I assume this is because the string (trg.name) is too small for the 4, 6 substring. What would be the correct method of working around this problem? VB.net Studio 2008.
View 3 Replies
May 16, 2012
I've rendered a simple rectangle for the background and a bunch of star polygons randomly placed across the form. On the form is a picturebox component which I can move around, but for some reason it overwrites the background and stars when it passes over them. Could someone please explain what is going on there? I've tried performing searches, but have been unsuccessful in finding anything useful.
View 4 Replies
Feb 6, 2012
get the raw data of zoomed image in a picture box. But I am zooming the image using,e.Graphics.DrawImage(Picturebox.Image, New Rectangle(ZoomXCordinate, ZoomYCordinate, ZoomWidth, ZoomHeight)).Now I am not getting how to get the raw data of zoomed graphics image displayed on the Picturebox.I am actually trying to get the image data into a byte array.
View 5 Replies
May 5, 2011
I need to write a simple program that imports tab delimited x,y coordinates into a simple form, by clicking an "Import" button and navigating to the particular .txt file. On the button press I want to read the text file and display these in the shape of anything from a simple square to a slightly more complex closed polygon (maybe using a path function) in the main picture box to view the shape.
Then I would like to press an "Export" button and save the displayed shape coordinates/vertices back to a file location of my choice as a .txt file.
View 16 Replies
Apr 23, 2012
I want to know if anyone here can teach me how to make graphics in visual basic 2010. For example, you have a form where you put everything about a graphic (type, data for x, data for y), you press a button and it appears.
View 8 Replies
Jan 18, 2012
For some reason I could never get over the look of my application, and the Microsoft controls together. Just never looked right. Nor were the controls exactly what I needed. By creating controls I can pretty much custom fit them for my application, and I love it.My question is with drawing these controls. I have 12 of them now in my current project, so I would like to make them all as efficient as possible. The biggest set back to most of them is the drawing can be a little extensive, or at least to a point where they could be more efficient. At the moment, under each paint event I have the brushes created by using blocks and then the drawing happens within them(I create all brushes first, then do the drawing, vice versa with disposing them). My question however came up when I was creating my most recent control, a SimpleList.
I experimented to see(though I'm not sure how exactly to track performance) but instead of recreating the brushes and pens etc in the paint event, I put them at the top so they're only made once, and destroyed once, rather being made and destroyed every time my control paints. My common sense tells me this is a better way of going about this but my experience can't back that up. is this the way I should be going about user drawn controls?, is there any limitations to this?(like would it be okay if I only had a limited number of brushes etc) and is the performance even that greatly impacted by making these changes that it's worth my while?
View 2 Replies