Roberto Freitas wrote: > Using a lot of data from a table (and calculations) I design on BM > (TBitMap), using commands like BM.Canvas.Ellipse, BM.Canvas.TextOut, > BM.Canvas.Polyline, etc. This task takes some time (about 30 seconds). > When the design is complete, I show it on screen using Tela.Canvas.Draw > (0, 0, BM) (Tela is a TImage object). > If I want to print the design, I do everything again using Printer > instead of BM. > I have almost no experience with Canvas, so I don't know if it is the > right way to do these things, but it's working well. > My problem is: after designing and showing it on screen, I would like > to zoom in or zoom out clicking the mouse (actually this is a very > common feature in many applications). The way I'm doing things, it > seems to me I would have to redesign everything (from the beginning) > using new paramaters (number of pixels / mm), but this is inconvenient > because it takes the same amount of time again (30 seconds). > Is there any way to zoom in or zoom out within a design on the screen > without having to "calculate" it again? And what about transfering > a "calculated" design from screen to printer maintaining appropriate > size?
I'm not a Delphi expert, but I do know Windows has a built in API called StretchBlt(). It essentially takes a bitmap and stretches it...which is how many programs do zooming operations. Searching Google for "StretchBlt delphi" turned up: http://www.swissdelphicenter.ch/torry/showcode.php?id=137 That's a starting point anyway for seeing how StretchBlt() operates. And apparently this has source code: http://www.delphi3000.com/articles/article_1088.asp (There's a comment toward the bottom where someone has an idea for "one improvement"). -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* VerifyMyPC 2.0 Change tracking and management tool. Reduce tech. support times from 2 hours to 5 minutes. Free for personal use, $10 otherwise. http://www.CubicleSoft.com/VerifyMyPC/

