Click here to Skip to main content
15,889,542 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SQL transaction rollback problem Pin
zhang80060520-May-07 19:37
zhang80060520-May-07 19:37 
GeneralRe: SQL transaction rollback problem Pin
Moonis Ahmed20-May-07 19:50
Moonis Ahmed20-May-07 19:50 
GeneralRe: SQL transaction rollback problem Pin
Moonis Ahmed22-May-07 22:55
Moonis Ahmed22-May-07 22:55 
Questiondirect3d in layered wnd Pin
johny_d20-May-07 10:26
johny_d20-May-07 10:26 
QuestionHow to get hWnd in MFC? Pin
bankai12320-May-07 7:40
bankai12320-May-07 7:40 
AnswerRe: How to get hWnd in MFC? Pin
Hamid_RT20-May-07 7:57
Hamid_RT20-May-07 7:57 
AnswerRe: How to get hWnd in MFC? Pin
prasad_som20-May-07 20:16
prasad_som20-May-07 20:16 
QuestionPolygons / PtInRegion Pin
m.dietz20-May-07 6:49
m.dietz20-May-07 6:49 
Hi,

There's a small problem with my polygons: To create Run codes from my polygon structure I came up with an algorithm that looked up for each horizontal line which polygon lines crossed them and where, then sorting them and going from left to right to check wether the actual point is an entry point, an exit point or a single point that is either ignored (if it's a point that is between two "inside" fractions of the run codes) or results in an one-point run code (if it's a single point between two "outside" fractions. The problem I have is, that I checked for the "entering" the polygon or "leaving" it by checking the pixel to the right of it with a CRgn::PtInRegion. It seemed to work fine, but then (mostly by random) I had a polygon with a horizontal line and had to find out that the pixels on the line seemed to be detected as "outside" by PtInRegion, which resulted in two single-point run codes instead of one run code from the the start point to the end point.

Is there an easy way to check if the point is ON a polygon line, so that I can modify the criterium for the "entering" points by if(PtInRegion(pt) || PtOnLine(pt)), or even better, is there a way to modify the PtInRegion by parameters given to the CRgn object that points on the bounding line are recognized as inside?

Another problem in this context might be the calculation of the crossing points between polygon lines and horizontal lines. If it's not a horizontal line (which means y==y1==y2) I calculate it by a formula x=(x1+(y-y1)*((x2-x1)/(y2-y1))) rounding it to an integer afterwards, but this calculation is too exact, not taking in account the inaccuracy due to alias effects, so some pixels that would be drawn as bounding line for the polygon are not recognized by my algorithm. Is there an easy and fast algorithm that can help me find the min-crossing an max-crossing points to be used in my run code algorithm?

Hope anyone can help
Martin Dietz
Question_CrtSetBreakAlloc does nothing! Pin
dum20-May-07 6:37
dum20-May-07 6:37 
AnswerRe: _CrtSetBreakAlloc does nothing! Pin
Mark Salsbery20-May-07 7:09
Mark Salsbery20-May-07 7:09 
GeneralRe: _CrtSetBreakAlloc does nothing! Pin
dum20-May-07 8:50
dum20-May-07 8:50 
GeneralRe: _CrtSetBreakAlloc does nothing! Pin
Mark Salsbery20-May-07 9:04
Mark Salsbery20-May-07 9:04 
QuestionRe: _CrtSetBreakAlloc does nothing! Pin
dum20-May-07 9:47
dum20-May-07 9:47 
AnswerRe: _CrtSetBreakAlloc does nothing! Pin
Mark Salsbery20-May-07 11:00
Mark Salsbery20-May-07 11:00 
GeneralRe: _CrtSetBreakAlloc does nothing! Pin
dum20-May-07 14:08
dum20-May-07 14:08 
GeneralRe: _CrtSetBreakAlloc does nothing! Pin
Nibu babu thomas20-May-07 19:19
Nibu babu thomas20-May-07 19:19 
AnswerRe: _CrtSetBreakAlloc does nothing! Pin
Gary R. Wheeler20-May-07 14:04
Gary R. Wheeler20-May-07 14:04 
Questionreturn program Pin
KARFER20-May-07 6:25
KARFER20-May-07 6:25 
AnswerRe: return program Pin
Mark Salsbery20-May-07 6:35
Mark Salsbery20-May-07 6:35 
AnswerRe: return program Pin
Hamid_RT20-May-07 7:33
Hamid_RT20-May-07 7:33 
Questionreturn program Pin
KARFER20-May-07 6:21
KARFER20-May-07 6:21 
AnswerRe: return program Pin
Hamid_RT20-May-07 7:35
Hamid_RT20-May-07 7:35 
AnswerRe: return program Pin
Moonis Ahmed20-May-07 20:30
Moonis Ahmed20-May-07 20:30 
QuestionInfo on one process Pin
nofearxd20-May-07 5:47
nofearxd20-May-07 5:47 
AnswerRe: Info on one process Pin
Mark Salsbery20-May-07 6:30
Mark Salsbery20-May-07 6:30 

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.