Click here to Skip to main content
15,895,011 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Advanced .NET cource Pin
Richard MacCutchan17-May-10 21:26
mveRichard MacCutchan17-May-10 21:26 
GeneralRe: Advanced .NET cource Pin
marca29217-May-10 22:18
marca29217-May-10 22:18 
GeneralRe: Advanced .NET cource Pin
Richard MacCutchan18-May-10 10:59
mveRichard MacCutchan18-May-10 10:59 
AnswerRe: Advanced .NET cource Pin
Luc Pattyn18-May-10 1:19
sitebuilderLuc Pattyn18-May-10 1:19 
QuestionRender Method Pin
Mountainking0217-May-10 8:37
Mountainking0217-May-10 8:37 
AnswerRe: Render Method Pin
Luc Pattyn17-May-10 8:58
sitebuilderLuc Pattyn17-May-10 8:58 
QuestionRe: Render Method Pin
Mountainking0220-May-10 4:48
Mountainking0220-May-10 4:48 
AnswerRe: Render Method Pin
Luc Pattyn20-May-10 5:14
sitebuilderLuc Pattyn20-May-10 5:14 
Hi,

1. rendering
depends on your environment. in WinForms, use Graphics.DrawLine() and the like. In other environments, use whatever is appropriate.

2. hit testing
in my view hit testing takes a method, maybe an int HitTest(Point p), which exists in the base class, and needs to be overridden by the specialized shapes. There are many ways to implement it, it depends on what you want to call a hit. Here is one I like a lot, although it isn't the easiest one:

- it basically calculates the distance from the mouse position (the Point parameter) to the nearest segment of the shape, and returns that.
- it gets called for all shapes, and the closest one wins, with an upper bound on the distance.
This works very comfortably for the user, as there is no need to exactly hit a line, and it allows to "see through" hollow shapes, so you can hit a small circle overlayed by a large hollow (i.e. unfilled) rectangle.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

QuestionRe: Render Method Pin
Mountainking0220-May-10 5:48
Mountainking0220-May-10 5:48 
AnswerRe: Render Method Pin
Luc Pattyn20-May-10 6:07
sitebuilderLuc Pattyn20-May-10 6:07 
QuestionAdvice: Transaction Processing using MSMQ Pin
DotNetJoe17-May-10 5:28
DotNetJoe17-May-10 5:28 
Question.net framework temporary error Pin
Zeyad Jalil17-May-10 2:21
professionalZeyad Jalil17-May-10 2:21 
AnswerRe: .net framework temporary error Pin
Not Active17-May-10 2:28
mentorNot Active17-May-10 2:28 
GeneralRe: .net framework temporary error Pin
Zeyad Jalil17-May-10 2:32
professionalZeyad Jalil17-May-10 2:32 
GeneralRe: .net framework temporary error Pin
Pete O'Hanlon17-May-10 2:49
mvePete O'Hanlon17-May-10 2:49 
AnswerRe: .net framework temporary error Pin
Tripathi Swati18-May-10 22:57
Tripathi Swati18-May-10 22:57 
QuestionHow to get dll's functions? Pin
phowarso16-May-10 21:55
phowarso16-May-10 21:55 
AnswerRe: How to get dll's functions? Pin
Hristo-Bojilov16-May-10 23:33
Hristo-Bojilov16-May-10 23:33 
AnswerRe: How to get dll's functions? Pin
Eddy Vluggen16-May-10 23:46
professionalEddy Vluggen16-May-10 23:46 
AnswerRe: How to get dll's functions? Pin
Peace ON16-May-10 23:47
Peace ON16-May-10 23:47 
AnswerRe: How to get dll's functions? Pin
neal12318-May-10 19:14
neal12318-May-10 19:14 
QuestionAbout Garbage collector Pin
sujithkumarsl16-May-10 20:51
sujithkumarsl16-May-10 20:51 
AnswerRe: About Garbage collector Pin
Peace ON16-May-10 23:51
Peace ON16-May-10 23:51 
AnswerRe: About Garbage collector Pin
Eddy Vluggen16-May-10 23:51
professionalEddy Vluggen16-May-10 23:51 
QuestionHow to customize Windows Regional options Pin
kindman_nb16-May-10 19:04
kindman_nb16-May-10 19:04 

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.