shanley06 that will not work. the algorithm cannot know if there is a line passing between the two points that does not touch the endpoints. it only successfully tests for overlapping segments on a single horizontal or vertical line, one or the other and not both.
I just slapped this together in ten minutes in VB6 with some line functions I had already written.
Probably the most effecient approach would be to maintain an array of end points and each time you create a new random line segment, loop through each set and check if they intersect using...
n$ = STRING$(6-LEN(n$), "0") + n$
or
num$ = STRING$(6, "0")
MID$(NUM$, 6 - LEN(n$) + 1, LEN(n$)) = n$
MID$ allows you to set string characters or read certain characters. MID$(String, StartIndex, NumChars) it can be used as an assignment or as a value returning function...
qb your algorithim is called a selection sort invented over a half century ago which has an algorithmic complexity of n^2, quicksort is a very good algorithm because it is n*log n .... so the difference is major for large arrays... for an of 1024 quicksort needs 10000 iterations where yours...
umm, I am working on a project that uses TransparentBlt and I noticed that the autosize property IS set to True on both pictures. I must have been mistaken before when I associated my problem with the Autosize property. Sorry to send you on a wild goose chase. I haven't had any other problems...
For some reason TransparentBlt does not work if the source picture(haven't checked if the same is true for the dest) has the AutoSize property set to True on XP. I can't even guess why. Maybe this is your problem. I don't see anything else that could be an issue. They do recommend a DoEvents...
like this is what i mean.
Private Sub Command1_Click()
Dim Xin As Double, Xout As Double, e As Double, R As Double
Xin = 210034
e = 1
Xout = Xin
Do
Xout = Xout / (10 ^ e)
R = Round(Xout - Int(Xout))
Xout = (Int(Xout) * 10 ^ e) + ((10 ^ R) * R)
e=e+1
Loop Until Xout Mod 10 = 0
Me.Print...
I personally don't know of one but I'm guessing your primary concern here is not having to write a lot of conditionals. One way to accomplish your task is to take an approach sort of like that used to round numbers I will describe it in pseudo code and then in real VB code. I believe it is...
haven't had any trouble with bitblt on XP. maybe if you post the part of your code where you set up your DCs and handles and where you call bitblt we can check if there is something else that could be a potential problem on XP...
I think you just need to understand that VB processes large strings slowly, and also that string functions are slow. Also using ThisString + ThatString is slow as well. There are a lot of unneccessary operations going on there. If I use large strings on my 400 Celeron I never make them larger...
I think there should be a relatively easy solution to this. If you only have this problem when you click on a textbox then Windows may be redrawing the window when it doesn't need to. Theres lots of ways to minimize the amount of drawing you need to do to improve performance. Maybe you could...
strongm's suggestion is the most convenient method for most tasks. For learning purposes I'm posting code from an old voxel landscape renderer that copies the base address of the bitmap bits to the address of an array so you can access them like pict(x,y) or pict(x) if you use a one dimensional...
If you can't find a standalone then runs it there may not be one. I'm not sure. But it's easy to call the SHRunDialog function to do it.
If you have VB you can follow the link below(go to the example code), paste the code in a project, set the Form's Visible property to False, Place the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.