Hi! I am unable to add a Picture to imagewell.image in Windows 64
It works perfect on Windows 32 and Mac OS 64… but not in windows. This is my method. Please Help!
Public Sub drawImageFileToWell(well as ImageWell, theFile as text)
dim maxWidth as Double, maxHeight as double
dim p as Picture
dim pic as Picture
maxWidth=well.width
maxHeight=well.Height
p = picture.Open(GetFolderItem(theFile,1))
if p<>nil then
dim factor as Double
//factor = Min( maxWidth / p.Width, maxHeight / p.Height )
//factor = Min( factor, 1.0 ) // (don't scale it up if it's too small!)
'
factor = Min( maxWidth / p.Width, maxHeight / p.Height )
factor = Min( factor, 1.0 ) // (don't scale it up if it's too small!)
dim destWidth as Integer = p.Width * factor
dim destHeight as Integer = p.height * factor
pic = New Picture( destWidth, destHeight, 32 )
pic.graphics.DrawPicture p, 0,0, pic.width, pic.height, 0,0,p.width,p.height
well.Image=pic
else
drawWarningIconIntoWell(well,“File not found”)
end if
well.Refresh
well.window.refresh
Exception e
if e IsA NilObjectException then
MsgBox “Nil Object Exception while drawingImageFileToWell”
end if
End Sub