The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: xandaz on September 03, 2011, 09:32:15 AM

Title: Image zooming
Post by: xandaz on September 03, 2011, 09:32:15 AM
  Hi. I dont suppose that someone could show me how to do zooming for a graphics app? Thanks ...
  I aint got the slightest idea on how to. I dont think it's with stretch.
Title: Re: Image Editor Test (03-08-2005)
Post by: jj2007 on September 11, 2011, 07:51:44 AM
Quote from: xandaz on September 03, 2011, 09:32:15 AM
  Hi. I dont suppose that someone could show me how to do zooming for a graphics app? Thanks ...
  I aint got the slightest idea on how to. I dont think it's with stretch.

StretchBlit is the way to go for raster graphics. For vector stuff, check the ViewPortXX family.

ClientToScreen
CombineTransform
DPtoLP
GetCurrentPositionEx
GetGraphicsMode
GetMapMode
GetViewportExtEx
GetViewportOrgEx
GetWindowExtEx
GetWindowOrgEx
GetWorldTransform
LPtoDP
MapWindowPoints
ModifyWorldTransform
OffsetViewportOrgEx
OffsetWindowOrgEx
ScaleViewportExtEx
ScaleWindowExtEx
ScreenToClient
SetGraphicsMode
SetMapMode
SetViewportExtEx
SetViewportOrgEx
SetWindowExtEx
SetWindowOrgEx
SetWorldTransform
Title: Re: Image zooming
Post by: xandaz on September 17, 2011, 09:32:28 PM
   i've been trying that also.... I don't see how SetWorldTransform works. I've tried in a rotation operation but it didn't work. I know i must set graphis to GM_ADVANCED but still i don't know what i'm doing wrong. Thanks jj
Title: Re: Image zooming
Post by: qWord on September 18, 2011, 12:32:34 AM
Probably StretchBlit() is the better choose for you. However, in the attachment a example using SetWorldTransform().
Title: Re: Image zooming
Post by: dedndave on September 18, 2011, 02:08:20 AM
very nice qWord   :U
i can use that for schematics and other technical drawings   :bg
Title: Re: Image zooming
Post by: jj2007 on September 18, 2011, 07:01:18 AM
Nice indeed, but limited to scaling raster graphics. For better quality, you need vector graphics, i.e.

      invoke LineTo,ebx,0,100*scalefactor

and similar. Instead of scalefactor, you can use ViewPortxx.
Another option is to stick to raster graphics and work with a huge compatible bitmap from which you can downscale to the required size.
If it's for anything that goes on printed matter, the editor will explain to you what "300 DPI minimum resolution" means :bg
Title: Re: Image zooming
Post by: ToutEnMasm on September 18, 2011, 08:24:55 AM

The griddemo (masm32\\examples\bcraven\griddemo)  show a method to do this.
Title: Re: Image zooming
Post by: xandaz on September 18, 2011, 05:05:56 PM
   How does one make a Screen dc smalled than the client area? I was trying the SetWindow/Viewport and the OffsetView/Window fuctions but nothing changed. can someone show me how? Showld i process the mouse messages so i draw only to a confined space? Thanks in advanced