Tom thanks as I will try this out today.

Jonathon

----- Original Message ----- From: "Dixon, Tom" <[EMAIL PROTECTED]>
To: "REALbasic NUG" <[email protected]>
Sent: Sunday, October 22, 2006 9:50 AM
Subject: RE: Picture set size in OpenDialog?


Open the Picture off-screen and then scale it so that the largest
dimension is a maximum of 100 pixels then draw it to the imagewell.

Function ScalePicture(myfile As FolderItem)
 Dim p1,p2 As Picture
 Dim w,h,x,y,wn,hn As Integer
 Dim r As double
p1 = myfile.OpenAsPicture w = p1.Width
 h = p1.Height
If w > h Then
   r = (w / 100)
   wn = 100
   hn = (h / r)
   x = 0
   y = (99 - hn) / 2
 ElseIf h > w Then
   r = (h / 100)
   wn = (w / r)
   hn = 100
   x = (99 - wn) / 2
   y = 0
 Else // w and h must be equal
   wn = 100
   hn = 100
   x = 0
   y = 0
 End If
p2 = New Picture(100,100,32) p2.Graphics.DrawPicture p1,x,y,wn,hn,0,0,w,h ImageWell1.Image = p2

End Function


How does one set an OpenDialog so that the picture being opened is only to a set size? I can only have pictures that are 100x100 in size, any bigger then is will not fit all into the ImageWell.

Thanks

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

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


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.9/490 - Release Date: 10/20/2006




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.9/490 - Release Date: 10/20/2006

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

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

Reply via email to