Re: Zooming and 2D Graphics
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.
Re: Zooming and 2D Graphics
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.
Re: Zooming and 2D Graphics
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.
Re: Zooming and 2D Graphics
Hey, thanks a bunch. I think this will do for my purposes. I feel kind of lame for not thinking of that in the first place. Thanks again.
Re: Zooming and 2D Graphics
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.