Click here to Skip to main content
15,897,704 members
Home / Discussions / C#
   

C#

 
NewsIcon c# library Pin
Matthew Hazlett14-Jun-16 10:37
Matthew Hazlett14-Jun-16 10:37 
GeneralWrong forum Pin
Richard Deeming14-Jun-16 11:18
mveRichard Deeming14-Jun-16 11:18 
GeneralRe: Icon c# library Pin
BillWoodruff14-Jun-16 16:06
professionalBillWoodruff14-Jun-16 16:06 
Questionhow to create three moving cars from different directions meeting at the junction Pin
Member 1252666814-Jun-16 5:22
Member 1252666814-Jun-16 5:22 
AnswerRe: how to create three moving cars from different directions meeting at the junction Pin
Simon_Whale14-Jun-16 5:30
Simon_Whale14-Jun-16 5:30 
AnswerRe: how to create three moving cars from different directions meeting at the junction PinPopular
OriginalGriff14-Jun-16 6:19
mveOriginalGriff14-Jun-16 6:19 
GeneralRe: how to create three moving cars from different directions meeting at the junction Pin
Kenneth Haugland14-Jun-16 6:52
mvaKenneth Haugland14-Jun-16 6:52 
GeneralRe: how to create three moving cars from different directions meeting at the junction Pin
OriginalGriff14-Jun-16 8:14
mveOriginalGriff14-Jun-16 8:14 
GeneralRe: how to create three moving cars from different directions meeting at the junction Pin
Kenneth Haugland14-Jun-16 8:30
mvaKenneth Haugland14-Jun-16 8:30 
GeneralRe: how to create three moving cars from different directions meeting at the junction Pin
OriginalGriff14-Jun-16 8:47
mveOriginalGriff14-Jun-16 8:47 
AnswerRe: how to create three moving cars from different directions meeting at the junction Pin
Pete O'Hanlon14-Jun-16 6:23
mvePete O'Hanlon14-Jun-16 6:23 
AnswerRe: how to create three moving cars from different directions meeting at the junction Pin
Matthew Hazlett15-Jun-16 9:58
Matthew Hazlett15-Jun-16 9:58 
QuestionError in listing open windows Pin
srikrishnathanthri13-Jun-16 20:08
srikrishnathanthri13-Jun-16 20:08 
AnswerRe: Error in listing open windows Pin
Richard MacCutchan13-Jun-16 21:03
mveRichard MacCutchan13-Jun-16 21:03 
GeneralRe: Error in listing open windows Pin
srikrishnathanthri13-Jun-16 23:49
srikrishnathanthri13-Jun-16 23:49 
GeneralRe: Error in listing open windows Pin
Pete O'Hanlon14-Jun-16 0:37
mvePete O'Hanlon14-Jun-16 0:37 
AnswerRe: Error in listing open windows Pin
KumarArunR10-May-17 20:03
KumarArunR10-May-17 20:03 
QuestionRX - Creating a Retry with a timer, and catch the exceptions Pin
Kenneth Haugland13-Jun-16 8:45
mvaKenneth Haugland13-Jun-16 8:45 
QuestionSQL Server 2005 query that uses the IIF with style date bool ? Pin
Member 245846711-Jun-16 22:44
Member 245846711-Jun-16 22:44 
AnswerRe: SQL Server 2005 query that uses the IIF with style date bool ? Pin
OriginalGriff11-Jun-16 23:14
mveOriginalGriff11-Jun-16 23:14 
GeneralRe: SQL Server 2005 query that uses the IIF with style date bool ? Pin
Member 245846712-Jun-16 17:08
Member 245846712-Jun-16 17:08 
GeneralRe: SQL Server 2005 query that uses the IIF with style date bool ? Pin
OriginalGriff12-Jun-16 20:23
mveOriginalGriff12-Jun-16 20:23 
QuestionMouse click poisition vary after stretching the image c# Pin
Shithun NK10-Jun-16 23:09
Shithun NK10-Jun-16 23:09 
AnswerRe: Mouse click poisition vary after stretching the image c# Pin
OriginalGriff11-Jun-16 0:48
mveOriginalGriff11-Jun-16 0:48 
Um. What do you suppose PictureBoxSizeMode.StretchImage does?
It takes the image in the Picturebox and "distorts" it to fit the size and shape of the container. That doesn't affect mouse locations within the image, it just affects the image as displayed.
So if you click the mouse on two points in the distorted PictureBox that correspond to the start and end points of a line (on the distorted image) and draw a line (on the underlying image graphics context) using the mouse coordinates it will be drawn as is - the coordinates you draw from and to will not be "mapped" into the distorted image but drawn exactly as you requested on the undistorted image. As a result, they aren't in "the right place" - which is why when you remove StretchImage from the PictureBox it works fine: the coordinates don't change at all, but now they match with the image.

Two options:
1) Don't use StretchImage
2) Convert the mouse location points so they aren't relative to the distorted image. That means looking at the box dimensions, the image dimensions and working out teh X and Y scalign factors you need to apply to "undistort" the click location.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...


modified 11-Jun-16 6:58am.

QuestionHow to know all windows are in minimized state Pin
srikrishnathanthri10-Jun-16 19:15
srikrishnathanthri10-Jun-16 19:15 

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.