Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to print data to screen in C# Pin
Christian Graus6-May-08 15:37
protectorChristian Graus6-May-08 15:37 
GeneralRe: How to print data to screen in C# Pin
mary okon6-May-08 15:41
mary okon6-May-08 15:41 
AnswerRe: How to print data to screen in C# Pin
javedk096-May-08 20:01
javedk096-May-08 20:01 
QuestionChat Building - transfering data between server and client Pin
nelsonpaixao6-May-08 15:03
nelsonpaixao6-May-08 15:03 
AnswerRe: Chat Building - transfering data between server and client Pin
Reelix6-May-08 21:10
Reelix6-May-08 21:10 
QuestionGetting an Angle for Rotations Pin
RedHotFunk6-May-08 14:28
RedHotFunk6-May-08 14:28 
AnswerRe: Getting an Angle for Rotations Pin
Christian Graus6-May-08 15:42
protectorChristian Graus6-May-08 15:42 
GeneralRe: Getting an Angle for Rotations Pin
RedHotFunk7-May-08 16:00
RedHotFunk7-May-08 16:00 
it rotates the original image, not the rotated one, so i don't have to subtract the last angle from the current one. I got something working actually, but it's a bit ridiculous, perhaps anyone else could simplify my code?

try<br />
            {<br />
                //rotationz = true;<br />
<br />
                if (e.X > 250 && e.X < lastx)<br />
                {<br />
                    //right side, positive instance (going left)<br />
                    curangle = (int)((Math.Atan((500 - e.Y) / (250 - e.X))) * (-180 / Math.PI));<br />
                }<br />
                else if (e.X > 250 && e.X > lastx)<br />
                {<br />
                    //right side, negative instance (going right)<br />
                    curangle = (int)((Math.Atan((500 - e.Y) / (250 - e.X))) * (180 / Math.PI));<br />
                    curangle = -180 - curangle;<br />
                }<br />
                if (e.X < 250 && e.X < lastx)<br />
                {<br />
                    //left side, positive instance (going left)<br />
                    curangle = (int)((Math.Atan((500 - e.Y) / (250 - e.X))) * (180 / Math.PI));<br />
                    curangle = 180 - curangle;<br />
                }<br />
                else if (e.X < 250 && e.X > lastx)<br />
                {<br />
                    //left side, negative instance (going right)<br />
                    curangle = (int)((Math.Atan((500 - e.Y) / (250 - e.X))) * (-180 / Math.PI));<br />
                }<br />
<br />
            }<br />
            catch (DivideByZeroException)<br />
            {


For some of those, you'll notice my curangle is touched upon once again within the if statements; I only did that in order to account for both positive and negative rotations left and right. It's kinda long though, so any suggestions would be great Big Grin | :-D ! Thanks again for the help guys!
AnswerRe: Getting an Angle for Rotations Pin
Reelix6-May-08 21:26
Reelix6-May-08 21:26 
QuestionMdi Child Pin
hadad6-May-08 12:53
hadad6-May-08 12:53 
AnswerRe: Mdi Child Pin
Anindya Chatterjee6-May-08 18:52
Anindya Chatterjee6-May-08 18:52 
QuestionC# background Worker and Progress Bar help Pin
Relentless6-May-08 11:35
Relentless6-May-08 11:35 
AnswerRe: C# background Worker and Progress Bar help Pin
Christian Graus6-May-08 11:38
protectorChristian Graus6-May-08 11:38 
GeneralRe: C# background Worker and Progress Bar help Pin
Relentless6-May-08 11:42
Relentless6-May-08 11:42 
AnswerRe: C# background Worker and Progress Bar help Pin
Gareth H6-May-08 11:59
Gareth H6-May-08 11:59 
AnswerRe: C# background Worker and Progress Bar help Pin
GuyThiebaut6-May-08 12:24
professionalGuyThiebaut6-May-08 12:24 
GeneralRe: C# background Worker and Progress Bar help Pin
Relentless6-May-08 13:08
Relentless6-May-08 13:08 
GeneralRe: C# background Worker and Progress Bar help Pin
Christian Graus6-May-08 13:11
protectorChristian Graus6-May-08 13:11 
GeneralRe: C# background Worker and Progress Bar help Pin
Relentless6-May-08 13:13
Relentless6-May-08 13:13 
GeneralRe: C# background Worker and Progress Bar help Pin
Christian Graus6-May-08 13:24
protectorChristian Graus6-May-08 13:24 
QuestionWriting output in a windows application Pin
Jerry Graham6-May-08 11:21
Jerry Graham6-May-08 11:21 
AnswerRe: Writing output in a windows application Pin
Pete O'Hanlon6-May-08 11:28
mvePete O'Hanlon6-May-08 11:28 
GeneralRe: Writing output in a windows application Pin
Jerry Graham6-May-08 11:30
Jerry Graham6-May-08 11:30 
AnswerRe: Writing output in a windows application Pin
Gareth H6-May-08 11:30
Gareth H6-May-08 11:30 
AnswerRe: Writing output in a windows application Pin
PIEBALDconsult6-May-08 13:46
mvePIEBALDconsult6-May-08 13:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.