Click here to Skip to main content
15,899,937 members
Home / Discussions / Graphics
   

Graphics

 
GeneralRe: very important Pin
Dave Kreskowiak13-Feb-09 5:12
mveDave Kreskowiak13-Feb-09 5:12 
Questionrefresh device context? Pin
Member 19061757-Feb-09 10:53
Member 19061757-Feb-09 10:53 
AnswerRe: refresh device context? Pin
plexted1-Nov-09 2:35
plexted1-Nov-09 2:35 
QuestionConvert PCL to image Pin
Cosmin Ciuraru29-Jan-09 6:16
Cosmin Ciuraru29-Jan-09 6:16 
QuestionTranslate vertext in shader Pin
Member 445625228-Jan-09 19:49
Member 445625228-Jan-09 19:49 
Questioncan not run DirectX sdk samples Pin
chandrapal27-Jan-09 21:52
chandrapal27-Jan-09 21:52 
QuestionScaling Rotated Points Pin
Richard Blythe19-Jan-09 6:12
Richard Blythe19-Jan-09 6:12 
GeneralRe: Scaling Rotated Points Pin
Luc Pattyn19-Jan-09 6:29
sitebuilderLuc Pattyn19-Jan-09 6:29 
Hi,

this is one approach:
- create an abstract base class that represents a drawable item; give it a Transformation Matrix member that initially is set to the unity matrix.
- derive all drawable items (lines, rectangles, circles, ...) from it; in the Paint handler, apply the transformation matrix to your Graphics object before drawing the object.
- when one or more drawable items are selected and a transformation gets ordered (translation, rotation, scaling) adjust the matrix for each selected object, i.e. calculate the matrix that represents the new transformation and combine it with the individual matrices.

The main problem that remains now is mapping mouse positions to the relevant drawable item;
there is no inverse matrix so you can't directly go from mouse position to item; you have to enumerate the items, for each enumerate the clickable parts (points, edges, surfaces), apply the transformation to them and check for a mouse hit.

Hope I made this sufficiently clear.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).


GeneralRe: Scaling Rotated Points Pin
Richard Blythe19-Jan-09 6:41
Richard Blythe19-Jan-09 6:41 
GeneralRe: Scaling Rotated Points Pin
Luc Pattyn19-Jan-09 6:50
sitebuilderLuc Pattyn19-Jan-09 6:50 
GeneralRe: Scaling Rotated Points Pin
Mark Churchill28-Jan-09 19:59
Mark Churchill28-Jan-09 19:59 
AnswerRe: Scaling Rotated Points Pin
Dan20-Jan-09 21:53
Dan20-Jan-09 21:53 
QuestionMultiple windows with OpenGL initialized Pin
Nishad S19-Jan-09 2:15
Nishad S19-Jan-09 2:15 
QuestionHow do I Display a 2D array as an image in a MDI using MFC Pin
Darryl Bryk15-Jan-09 14:11
Darryl Bryk15-Jan-09 14:11 
AnswerRe: How do I Display a 2D array as an image in a MDI using MFC Pin
Baltoro25-Jan-09 10:07
Baltoro25-Jan-09 10:07 
AnswerRe: How do I Display a 2D array as an image in a MDI using MFC Pin
Darryl Bryk26-Jan-09 13:10
Darryl Bryk26-Jan-09 13:10 
QuestionDirectShow Video capturing Pin
Hadi Dayvary14-Jan-09 10:27
professionalHadi Dayvary14-Jan-09 10:27 
QuestionopenGL SwapBuffers Pin
Nishad S13-Jan-09 22:11
Nishad S13-Jan-09 22:11 
AnswerRe: openGL SwapBuffers Pin
Dan14-Jan-09 9:07
Dan14-Jan-09 9:07 
GeneralRe: openGL SwapBuffers Pin
Nishad S14-Jan-09 17:41
Nishad S14-Jan-09 17:41 
GeneralRe: openGL SwapBuffers Pin
Dan14-Jan-09 20:40
Dan14-Jan-09 20:40 
GeneralRe: openGL SwapBuffers Pin
Nishad S14-Jan-09 21:03
Nishad S14-Jan-09 21:03 
GeneralRe: openGL SwapBuffers Pin
Nishad S14-Jan-09 23:49
Nishad S14-Jan-09 23:49 
GeneralRe: openGL SwapBuffers Pin
Dan15-Jan-09 9:27
Dan15-Jan-09 9:27 
GeneralRe: openGL SwapBuffers Pin
Nishad S18-Jan-09 17:24
Nishad S18-Jan-09 17:24 

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.