|
Hi,
i have searched for a code which shows me the actual webcam-image. so i have found the DirectShowLib, all fine with it.
Now i want to capture a singe Bitmap from this "stream". In the Code there is something like that:
hr = Me.CaptureGraphBuilder.RenderStream(PinCategory.Preview, MediaType.Video, sourceFilter, Nothing, Nothing)<br />
Debug.WriteLine("Render the preview pin on the video capture filter : " & DsError.GetErrorText(hr))<br />
DsError.ThrowExceptionForHR(hr)
There i also can say, that the Stream should be saved into an .avi-File. But How can I Capture a single Image and display it in a picturebox?
I always found examples for c, c++ or c#, but no vb.net examples.
Can anyone help me??
thanks
milschkuh
|
|
|
|
|
It always amazes me that people think C# and VB.NET are so different. Look at the C# example and you can figure out what the VB.NET code is quite easily. Or you can copy and the code into an one of the online C# to VB.NET conversion tools. To find those, all you need to do is Google for "C# to VB.NET conversion".
|
|
|
|
|
Hi milschkuh,
Have you had the solution for This Post ?
Can you please share to us ?
Thanks alot,
VuVinh
|
|
|
|
|
I am Using Oracle8i with Vb.net 2003
I am trying to connect to Oracle database...
but it is giving me TNS errror: Unable to connect to designation
myConnection = New OleDbConnection("Provider= MSDAORA.1; UserID=scott;password=tiger; datasource; database=demo1)
i want to know ,should datasource be empty in this
i am using oledb connection,
can anyone specify the corrrect format
|
|
|
|
|
parkash_C wrote: should datasource be empty
No
parkash_C wrote: can anyone specify the corrrect format
Look here[^]
|
|
|
|
|
thanks for your time,
i ve visited this, but can you explain me
what is datasource ,
iN MS access , i write pathname to file,
|
|
|
|
|
I don't know, I don't use Oracle.
I do know how to use Google.
I found this[^].
|
|
|
|
|
connection string for the oracle
use the following string as connction string
"Provider=msdaora.1;Data Source = ORA9I;User ID = myuser;password = mypass;"
provider: provider is provided by the oracle corporation. it install in your pc while oracle client(minimum) installing
oracle provides two providers
1. msdaora.1
2. OraOledb.Oracle
Data Source : Host string of your server, if u r using standlone this will empty like this
"Provider=msdaora.1;Data Source =;User ID = myuser;password = mypass;"
userid,password: user id , password
Thanks
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
hi,
i am developing billing software in vb.net.
i want to export all accounts details into Tally software.
how is it possible for that?
plz help me...
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
For developing a pariticular interfaced software you should know that what this software can access?
Like: If Tally or Other softwares can import data from Excel,Word,Access or Other Medium then you can export data by that source.
Best Regard
Anubhava Dimri
If you can think then I Can.
|
|
|
|
|
Your going to have to consult with either the Tally documentation or contact Tally Support to get that kind of information. Or you can try to Google for something like "Tally import file".
|
|
|
|
|
Hi All
I am working on a vb 6.0 + MySQL project.
I need to create a Database(for local use Ex:- If user wants to create database they can create and dump data from online databas) Dynamically and restore the database with production database backup.
Is it possible?
Thanks,
Willington D
|
|
|
|
|
Yes.. it is.. (As long as you code it)
Do Or Don't, there is no "try catch ex as exception end try"
|
|
|
|
|
Why in VB 6.0?
Surely you have VB.Net?
VB 6 is deeply unsupported, whereas VB.Net is not only supported but has more inbuilt sql connectivity.
------------------------------------
"Children today are tyrants. They contradict their parents, gobble their food and tyrannize their teachers. I despair for the future."
Socrates 400BC
|
|
|
|
|
Hi Guys,
not sure if im in the right forum but this is the error i am getting in my script.
i have googled and tried many things but to no avail....
the error:
"Object Required: WScript"
the code:
dim wshShell ,Wscript
set WshShell = CreateObject("WScript.Shell")
while StockCode <>""
Wscript.Sleep 1000
wend
the error fails on Wscript.sleep command...
any idea on how to solve this....
thanks in advance
Anoop
|
|
|
|
|
You create WshShell in line 2 but never create Wscript!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how do i do that? i.e. create the wscript?
thanks
|
|
|
|
|
The same as you did for wshscript.. but i'm guessing this is copy past. Brushing up on OOP could help a lot more ..
Do Or Don't, there is no "try catch ex as exception end try"
|
|
|
|
|
It's obvious you have no clue what you're doing. I suggest starting with the basics, here[^].
|
|
|
|
|
I'm looking for some help with computing values of a triangle and then drawing it to screen
Known;
Two points in degrees exist on a circle
Two line lengths representing ;
base, adjacent side (a)
and
opposite (c)
we want to derive side (b) hypotenuse
and also angles (A), (B), (C)
We already know that sides (a) and (c) join and we know that the longest side length will not exceed the diameter of the circle that the triangle is circumscribed within
The triangle created will be variable as different degrees and side lengths are entered, typically this will be scalene triangles but the may also be at times right triangles
I've been using a derived arc cos function ;
------------------------------------------------------------------------
Public Function Arccos(X As Double) As Double
Arccos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
End Function
------------------------------------------------------------------------
I know we can convert degrees to radians via "* Pi) / 180"
I know I can get the hypotenuse by;
------------------------------------------------------------------------
side_b_squared = CDbl(c1 ^ 2 + a1 ^ 2 - (c1 * a1)) * Cos(angle_B_degree_value_radians)
b1 = Sqr(side_b_squared)
------------------------------------------------------------------------
I know we can get the angles A,B,C via ;
------------------------------------------------------------------------
angle_C_cos_value = CDbl(a1 ^ 2 + b1 ^ 2 - c1 ^ 2) / (2 * (a1 * b1))
angle_B_cos_value = CDbl(c1 ^ 2 + a1 ^ 2 - b1 ^ 2) / (2 * (c1 * a1))
angle_A_cos_value = CDbl(b1 ^ 2 + c1 ^ 2 - a1 ^ 2) / (2 * (b1 * c1))
angle_C_acos_value = (Arccos(angle_C_cos_value))
angle_B_acos_value = (Arccos(angle_B_cos_value))
angle_A_acos_value = (Arccos(angle_A_cos_value))
angle_C_degree_value = angle_C_acos_value * 180 / Pi
angle_B_degree_value = angle_B_acos_value * 180 / Pi
angle_A_degree_value = angle_A_acos_value * 180 / Pi
------------------------------------------------------------------------
Although, I've had some trouble with this since some of the returned angles for some previous testing I did didn't
seem to be working very well, for instance I'd enter 60 degrees for angle (B) but it would somehow crunch it to
angle_B_Degree Value 38.8700377933938
I'm a little stuck on the math for all this.... here is an example scenario that I hope illustrates really clearly what I'm trying to do ;
A small VB app does the following ;
A small circle is drawn to the screen
On the form of the VB app there are text boxes that accept inputs ;
Text 1 = side (c) length as a number
Text 2 = side (a) length as a number
Text 3 = a value in degrees that represents a point of one of the ends of side (c)
Text 4 = a value in degrees that represents a point of one of the ends of side (a)
Then the following are computed ;
side length of the hypotenuse as a number, and output to a different text box
Angles (A), (B), (C) are computed as values in degrees, and output to another text box
The drawn circle may be say four inches in diameter, and all side lengths computed, regardless of their number value
are fit proprotionally, circumscribed within the circle, so even if one of the side lengths is really long, all side lengths are fit proportionally in the circle but retaining the same intrinsic unit measure values of their lengths.
Any help or insights on the above are really appreciated, especially the math and formula end and any code ideas, samples are a God send.
I'm a bit of a newbie with all this and I'm using an older version of VB (4.0)
I have a basic idea on using some of the draw functions and I think I can tinker my way through this, but again am very open to any feedback
Thanks people!
|
|
|
|
|
It would help if you stopped using the term Hypotenuse, as this only applies to Right Angles.
Also, is the radius known or unknown?
------------------------------------
"Children today are tyrants. They contradict their parents, gobble their food and tyrannize their teachers. I despair for the future."
Socrates 400BC
|
|
|
|
|
Ok, will stop using the term hypotenuse!
Also, the longest triangle side will never exceed the diameter of the circle, but here are some more notes that may be helpful in better understanding what I'm trying to do ;
The triangle, circumscribed within the circle is situated so that each point of the triangle must fall somewhere on the perimeter of the circle itself For example sides 'a' and 'b' both have one of their ends at the centerpoint of the circle, and the angle between them is angle 'C'
What Im hoping for here, is that the circle centerpoint is not used at all, so no ends of the triangle will everland there
There needs to be actually four inputs... I know this sounds a bit unorthodox, but here is the interesting part of the problem... I'll clarify this.....
We want two inputs that store the lengths of two of the sides of the triangle ;
Text 1 = side (c) length as a number
Text 2 = side (a) length as a number
We also want two inputs that store two values that are points on the perimeter of the circle in degrees
Text 3 = a value in degrees that represents a point of one of the ends of side (c)
Text 4 = a value in degrees that represents a point of one of the ends of side (a)
So in the end we know that we have two sides of specific lengths that must fit within the circle, and we know that one of the ends of each line is connected to a specific degree point on that circle, we also know that both these side lengths do join somehow somewhere, but the degrees that are input ARE NOT the angles of any part of the triangle, here in this case, the degrees that are input are ONLY points on the circle itself that are simply where the lines of each respective triangle, so for example
A circle of four inches diameter
a line length of 10 units has one end point at 30 degrees
a second line length of 8 units has its end point at say, 78 degrees
where does the third point fall on the circles perimeter? at what degree?
what is the line length of the missing side, and then what are the angles contained within the triangle....
This is the math, code part I am hoping for help on..... I hope this clarifies?
Also... I'm using VB 4.0 and can't upgrade for a while - long story
|
|
|
|
|
Rockoon!
Thank you so much for your reply!
I just realized I made an assumption that may not be correct at all.
I had thought earlier that if we knew two points in degrees on the circle, then the difference or sum between them must be either one of the values of the unknown internal angle, or at least it would represent the other 3rd unknown point on the circle.
Now I'm thinking that, thats just a poor guess on my part!
Although, I then realized that if we knew two of the lengths of two of the sides, and if we knew that each line was associated with one of the points, then one of the lines must also intersect the two known points, and since that is the case then if the line that joins the two points is not equal to either of the two known line lengths then that gives us the missing side!?
If thats the case then its a matter of deriving where the third unknown point in degrees on the circle would be where the two known line lengths would meet?
I'm guessing, but if I'm not mistaken there could only be a maximum of two specific points on the circle where these two lines could join? But maybe only one place?
I'm hoping there is a way to 'algebra-tize' all this and then code it!?
Also, this is really important I feel ;
The lines of the triangle will be variable and in generic units, but say we know that the diameter of the circle is four inches. Line lengths may be values of 10, 23, 5, what ever... but they will fit proportionately in the circle, so the lines of generic unit measure need to be fit within the circle.
Here, we only know two of the points on the circle
In this exercise we don't know any of the internal angles, all we know are two points in degrees on the circle (the third is unknown) and we know that each point will be associate with one of the two known line lengths
We have the following unknowns;
All three internal angles, and one of the side lengths
All we know is two side lengths, two points on the circle in degrees where each point is associated with one of the side lengths, and we know which point on the circle is associate with which line,
We also know that the two known points on the circle must join and that this line may or may not be one of the known lines. Some sort of check, if statement could verify it when measured proprtionately somehow and if its not one of the known line lengths then we have our third unknown line
|
|
|
|
|
If you only know two side lengths of a scalene triangle (but none of the angles) can you determine the third side length?
I had been using this formula to determine the length of the hypotenuse ;
SQRT ( side1^2 + side2^2)
But realized that this is meant ONLY to determine the side length of the hypotenuse for right triangles and not scalenes per se.... is there some other formla that can be used to get the line length of the hypotenuse for a scalene in the above situation?
If there isn't a way to get the 3rd line length of scalenes this way, do you know if there is a way to get the hypotenuse line length AND the angle between the hypotenuse and the base, if we have the two side lengths of the base(adjacent) and the opposite side, and if we have the associated angles for these sides?
I've tried to incorporate all I've learned so far... but I keep getting weird errors and as far as I can tell all my formulas are correct?
I've built a small VB program, am including a sample below and the critical formulas and code I'm using... if any one can shed some light on where I've gone wrong it would be so nice!
( I'm using VB 4.0 and can't upgrade right now so I have to work within that limitation)
Here is an example ;
Accept input from three text entry boxes
1.) Value for Side (a), Adjacent Base
the value of 14 is entered
2.) Value for Side (c), Opposite
the value of 10 is entered
3.) Angle (B) [ entered as degrees ]
the value of 60 degrees is entered
The hypotenuse is computed to be ;
8.83176086632785
The arc cos function is derived ;
Public Function Arccos(X As Double) As Double
Arccos = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
End Function
Its then called from code below
Pi is declared as a constant in a module
'=======================
'=======================
'Converts the entry from degrees to radians
angle_B_degree_value_radians = (angle_B_degree_value * Pi) / 180
'get hypotenuse side length and outputs it to a text box
side_b_squared = CDbl(c1 ^ 2 + a1 ^ 2 - (c1 * a1)) * Cos(angle_B_degree_value_radians)
b1 = Sqr(side_b_squared)
Text5.Text = b1
angle_C_cos_value = CDbl(a1 ^ 2 + b1 ^ 2 - c1 ^ 2) / (2 * (a1 * b1))
angle_B_cos_value = CDbl(c1 ^ 2 + a1 ^ 2 - b1 ^ 2) / (2 * (c1 * a1))
angle_A_cos_value = CDbl(b1 ^ 2 + c1 ^ 2 - a1 ^ 2) / (2 * (b1 * c1))
angle_C_acos_value = (Arccos(angle_C_cos_value))
angle_B_acos_value = (Arccos(angle_B_cos_value))
angle_A_acos_value = (Arccos(angle_A_cos_value))
angle_C_degree_value = angle_C_acos_value * 180 / Pi
angle_B_degree_value = angle_B_acos_value * 180 / Pi
angle_A_degree_value = angle_A_acos_value * 180 / Pi
'=======================
'=======================
The problem is, that
angle_B_Degree Value 38.8700377933938
is returned as a degree value very different from what I entered ( 60 ) degrees! I wanted to recompute this angle to confirm that it was working ok.... but it seems often off, so now I dont know how valid any of my calculations are! I don't understand why this is happening?
I've also tried entering angles different from 60 degrees but with the samed side length values, for instance if I enter 90 degrees or 120 degrees it jus automatically fails.... if I enter 80 degrees I also get an error back....?
|
|
|
|
|
Without angles, no.
There is a maximum length for the third side, which is the sum of the lengths of the other 2 sides.
Imagine a pair of compasses, the length of the two legs is fixed, but the third length can be changed bu pushing them apart or pulling them together, so length of two sides does not give length of third.
Euclidian Geometry and Pythagorean Maths are a pain yes?
------------------------------------
"Children today are tyrants. They contradict their parents, gobble their food and tyrannize their teachers. I despair for the future."
Socrates 400BC
|
|
|
|
|