gettingstarted
[Top] [All Lists]

Re: Scaling movies and pictures

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Scaling movies and pictures
From: David Austin <daustin777 at cox dot net>
Date: Fri, 28 May 2004 12:48:13 -0700
Delivered-to: gettingstarted at lists dot realsoftware dot com
List-help: <mailto:gettingstarted-request@lists.realsoftware.com?subject=help>
List-id: Getting Started <gettingstarted.lists.realsoftware.com>
List-post: <mailto:gettingstarted@lists.realsoftware.com>
References: <95FF9870-B029-11D8-87B8-00039396177E at kellerfarm dot com>

On May 27, 2004, at 3:02 PM, Andrew Keller wrote:

In my app, I need to be able to scale (proportionally, not x/y independent) movies and pictures. How can I do this?

For picture objects you can do something like this ( from a canvas paint event ):

  dim dw, dh as Integer // destination
  dim sw, sh  as Integer // source
  dim x, y as Integer // start coordinate
  dim factor as Double // scale factor

  dw=250 // destination size
  dh=250 // destination size
  if thePicture<>nil then
    sw=thePicture.Width
    sh=thePicture.Height
    fact=min(me.Width / sw, me.Height / sh)
    dw=sw*factor
    dh=sh*factor
    x=(me.Width-dw)*0.5
    y=(me.Height-dh)*0.5
    g.DrawPicture thePicture, x, y, dw, dh, 0, 0, sw, sh
  end if

--
David

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>