gettingstarted
[Top] [All Lists]

Re: gettingstarted Digest, Vol 2, Issue 26

To: gettingstarted at lists dot realsoftware dot com
Subject: Re: gettingstarted Digest, Vol 2, Issue 26
From: Andrew Keller <andrew at kellerfarm dot com>
Date: Sun, 30 May 2004 09:34:18 -0400
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: <20040529065752 dot C37EA1F3A85 at lists dot realsoftware dot com>
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
  factor=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
Okay, I understand what it's supposed to do. From that code, I've figured out that DrawPicture is a function that draws a picture with specific dimensions. The code before it figures out what the dimensions should be. How do you identify the picture to figure out its length and with?

_______________________________________________
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>
  • Re: gettingstarted Digest, Vol 2, Issue 26, Andrew Keller <=