Hello, I am writing a 2D graphics program to draw basic shapes and I was hoping someone could help me figure out how to write a function which would allow the user to zoom in on the screen. My program uses Windows BGI. If you follow this link (http://csci.biola.edu/csci105/using_winbgi.html) you'll find winbgi2.cpp and graphics2.h, both of which are in my program, and I've also attached my ShapeGeometry.cpp and ShapeGeometry.h in case they are of any use to anyone. Any help would be much appraciated!
Wow! Is this the same BGI graphics used by Borland in the Eighties? I didn't think modern command prompt windows even support DOS based graphics anymore. Why not use Windows GDI or GDIPlus?
I don't think there's any easy way to do what you want with the tools you're using.
Well, this is what I was given to use by my professor. The main point of the project is to show that we can use objects. I know it is possible to make a zoom method because some of my classmates have done it. I am just not sure where to begin. The graphics I can make fairly easily. Zooming in and out is a different story. I'm not sure how zooming works in general, otherwise I am sure I could figure it out.
I haven't looked at your BGI code, but I think you should be able to achieve this by basically multiplying all your x,y coordinates by your zoom factor.
Sigh... And then they wonder why students taking Object Oriented programming courses end up being so bad at doing proper OO.
'Graphical Shapes' is such a bad example to work with. Taking real life 'objects' and trying to match them with the 'Objects' (classes) in OO is just a really really bad mindset. It's one of the first things we always have to stamp out of new job recruits.
In real life a circle is a special form of an oval
a square is a special form of a rectangle
trying to enforce this type of thinking into an OO design class hierarchy (class shape has a derived class rectangle and this in turn has a derived class square) is just asking for problems.
Most books and courses using this very 'shapes' example invariably end up weasling their way out of it either by awful implementation or by just avoiding the issue altogether.
Your teacher deserves a slapping.
For perpetuating bad design concepts, and for making you use antiquated user interfaces.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.