Change Pictureboxes X2 Y2 To Tilt Some Degrees Other Than 90 Degree Angles?
Jan 15, 2011I dont even know if you can do this in vb.net but, how do you change the pictureboxes x2 y2 to tilt some degrees other than 90 degree angles?
View 2 RepliesI dont even know if you can do this in vb.net but, how do you change the pictureboxes x2 y2 to tilt some degrees other than 90 degree angles?
View 2 RepliesTo detect rotation of the mouse wheel in .NET/WinForms, I can override OnMouseWheel. Clicking can be detected by overriding OnMouseDown (it's just the Middle button). But how do I detect tilting of the wheel (tilt to the left/right for horizontal scrolling)? Neither OnMouseWheel, not OnMouseDown is being called when I tilt the mouse wheel.
View 2 RepliesI am adding a gps function to an existing app, but the only examples that I can find for getting the sentence from the device is through a serial port. How do you get the sentence from the sirf chipset on an at&t tilt?
View 2 RepliesI'm designing a form with a horizontal scroll bar docked at the bottom. I wanted to add support for side-scrolling using mouse tilt buttons and found this solution which, after a bit of tinkering, seemed to do the trick - that is, while the form only had GDI graphics drawn on its surface.
However, since then I've added some controls to the form and found that when the mouse is over any of them the tilt operation only fires once-at-a-time instead of repeatedly as it does when the mouse is over any other part of the form.To see what I mean (if you have a mouse with tilt buttons) dock a horizontal scrollbar onto the bottom of a form, add a few other controls and paste in this code:
Public Class Form1
Const WM_MOUSEHWHEEL As Integer = &H20E
Protected Overrides Sub WndProc(ByRef m As Message)
[code]....
You'll see that side-scrolling repeats when the mouse is over a blank part of the form, but only "one-shots" when it's over a control.I'm guessing the solution lies somewhere in the message's .Result value, but I'm at a loss as to what that should be. In fact I'm not even sure I'm returning a correct value anyway because the code in the original solution threw an exception to the DirectCast function so I swapped that for CType, which seemed to work okay. I've tried working it out using Spy++ but I can't see anything obvious.
UPDATE:I've noticed when I include 'Child' windows in Spy++ there are two (0x020E) messages and two return values, 1 then 0. I presume the message is being passed onto the control by the form. So I guess the question now is: can the message be prevented from being passed to the control? Or can the control's return value be intercepted and converted to 1?
Well I attempted collision detection and it was only ok. First of all only the out of bounds place would work because I just made the right side of the screen make you go left etc.My moving button also goes outside of the area for a brief second before it teleports back to the bounds + 3 or w/e.Never mind all of that I guess.Could someone give me some source code for the simplest way to do collisions from all angles (like a zelda game or something...) or just up/down or left/right (like in pong).
View 1 RepliesHow can i calculate the angles of a triangle, where i have the lengths in cm of all 3 sides?
heres an example where i already know the angles. i know its a sin, cos or tan formula, but nothing i've tried works.
I have got the code to draw the line at the angle. the issue is that I need 0 degrees to be the right hand side and not the top.[code]
View 37 RepliesI followed this tutorial [URL] in creating a pong game in VB NET, everything worked well as followed but believe there is still more development that needs to be done to it, for example if the ball is moving horizontally in a straight line, it will just re-bound of the paddles in the same angle everytime which means there is no point to the game. When the game starts moving the ball at a random angle and the ball re-bounds of either paddles, it will re-bound in the same angle it started with each time.
Pointed out what code this is:
Dim random As New Random() ' Random instance
Dim xVel As Single = Math.Cos(random.Next(6, 8)) * speed ' Move ball from randomized angle in X-axis
Dim yVel As Single = Math.Sin(random.Next(6, 8)) * speed ' Move ball from randomized angle in Y-axis
[code]....
If the ball hits the top of the paddle object, it should re-bound at a different angle How it should be is when the ball hits the paddle object, it should re-bound at a different angle, if it intersects at the top of the paddle, it should re-bound up or bottom of paddler should re-bound down.
Here's the code i'm using to rotate:
Dim m As New System.Drawing.Drawing2D.Matrix
Dim size = image.Size
m.RotateAt(degreeAngle, New PointF(CSng(size.Width / 2), CSng(size.Height / 2)))
Dim temp As New Bitmap(600, 600, Imaging.PixelFormat.Format32bppPArgb)
Dim g As Graphics = Graphics.FromImage(temp)
g.Transform = m
g.DrawImage(image, 0, 0)
(1) Disposals removed for brevity.
(2) I test the code with a 200 x 200 rectangle.
(3) Size 600,600 it just an arbitrary large value that I know will fit the right and bottom sides of the rotated image for testing purposes.
(4) I know, with this code, the top and left edges will be clipped because I'm not transforming the orgin after the rotate.
The problem only occurs at certain angles:
(1) At 90, the right hand edge disappears completely.
(2) At 180, the right and bottom edges are there, but very faded.
(3) At 270, the bottom edge disappears completely.
Is this a known bug?If I manually rotate the corners an draw the image by specifying an output rectangle, I don't get the same problem - though it is slightly slower than using RotateAt.
I'm working on a Pythagorean Theorem program that calculates the sides and angles of a right triangle. I have the side measurements and all that down, but I can't find the Visual Basic function that will allow me to calculate the angles from the side measurements. I've tried asin and sinh, but both give me the wrong measure.
View 2 RepliesI need a Function or section of code that finds the angle of a lineShape. Alternitively, a code to find the angle between two set coordinates would also work. I need to know the angle in order for my program to work properly. I'm using VB Express 2010.
View 2 RepliesIm making a little game. All it does is make a bunch of Random Letters. Move around the screen. Im drawing to the form with paint. But i wanted to make it. So you have to click the letter that my program ask's you to click. I know there is easy ways of doing this. Like just getting the x,y and the mouse x,y on the click event. But i was wondering. If i could accomplish this task. Just by Scanning about 10x10 pixels from where the mouse down event is triggerd. to see if a letter is there. And how i could make it see if it is an A or B etc. The font is white. And about this size. I was thinking about it counting all the white pixel's but that wouldn't work?
View 3 Replies- how to convert degree to radian
-how to use a function sqrt
-how to use a funtion pow
-how to use a function sinus
I want to paint the background of a form with gradient using the LinearGradientBrush; but I have troubles using degrees.Basically, I want using linear gradient in diagonal.
View 1 Replieshow to rotate a label 45 degree's ? The label is in a group box.I'm using vb.net 2005
View 10 RepliesI am capturing images from a webcam and I have to compare the degree of similarity between two or more images. that is... which two images are the closest match.
I know I cannot compare the pixels...so how do i go about it?
I am using Visual basic 2010 on Win7
This comparison need to be sufficiently fast. Within 2-3 seconds.
I was looking into pixel by pixel comparison. but webcam pictures as I understand do have slight changes between frames(disturbances).
I am working on recognizing hand gestures...which would in turn control a small mechanical crane...
for example a thumbs-up sign would mean a signal for crane to be switched on...and a full palm shown would mean a stop your work sign.
I plan wearing a white glove against a black background.
I also have ideas like dividing the screen into a 10x10 matrix.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]...
Just curious ... for those whose main occupation is as a software developer what percentage of you had computer science degree vs. self taught?
View 2 RepliesIs anybody good with math?
CODE:
I'm not sure if this is the right thread for this.
i have a decimal number like 35,23456834 the rapresent a latitude or longitude (in degree but with decimal form for the decimal )
My need is to transform that number in xx° - xx' - xx'' in a variabli of string
I'm doing lessons from a book on VB Express. My problem is a wierd key character.Dim db?Var As Double?= what looks like an "L" flipped 180 degrees. what is it?
View 4 RepliesAnyone knows (or has a function) to convert a latlong to degrees, min, sec?
example: 53.21884, 5.49217 > N 53 9 34.2, E 5 25 56.9
Convert radians to degrees?
COS (X / 57.3)
Where X is your variable or constant.Your number is now in degrees.
The reason why I want to do this is a little much to get into, but how can I rotate text by 90 degrees?
View 4 RepliesI want to rotate my progressbar 90 degrees.
View 6 RepliesI have a space ship, and am wanting to calculate how long it takes to turn 180 degrees. This is my current code to turn the ship: .msngFacingDegrees = .msngFacingDegrees + .ROTATION_RATE * TV.TimeElapsedMy current .ROTATION_RATE is 0.15, but it will change.I have tried:Math.Ceiling(.ROTATION_RATE * TV.TimeElapsed / 180)
View 1 RepliesI need to make two programs and i have a hard time doing them my first program is: Calculate the value between 0 & 180 degrees that makes the function sinx = x my second program is: calculate sinx with taylor formula, x=0 ill wait for answer
View 1 RepliesCalculate the value between 0 & 180 degrees that makes the function sinx=x
View 6 RepliesHow do I convert, let's say, a variable such as X from radians to degrees. I am designing weather forecasting software and cannot get it to work. proper syntax and much obliged.
View 9 RepliesFirst of all I got app to convert Degrees, Minutes and Seconds to decimal. But now I need to get Decimal back to Degrees, Minutes and Seconds and I can't get it how to make it because I'm terrible with math formulas... Here is what I done so far:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox4.Text = TextBox1.Text + (TextBox2.Text * 1 / 60) + (TextBox3.Text * 1 / 60 * 1 / 60)
End Sub
End Class
Textbox1 - Degrees
Textbox2 - Minutes
Textbox3 - Seconds
Textbox4 - DECIMAL RESULT