craduza
asked on
resizing picture object in crystal report 8.
i'm creating a report that include a picture object in it. i want the picture to be displayed in it's own size. The problem with picture object is the picture will be displayed fix the picture object size (stretch). Is the any other way to show the picture with it's own size (not stretched)?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i'm still working on the code...:) hope it will work.
ASKER
i'm using VB6 with Crystal report 8
ASKER
i've solved the prob. with my own style..:D
Dim thePicture As Object
Dim xRatio As Single, yRatio As Single
Set thePicture = LoadPicture("c:\windows\de sktop\yaho o.bmp")
'calculate the ratio
xRatio = Picture1.Width / thePicture.Width
yRatio = Picture1.Height / thePicture.Height
'use the smallest ratio value to resize the original picture
If xRatio < yRatio Then
Picture1.Width = CLng(thePicture.Width * xRatio)
Picture1.Height = CLng(thePicture.Height * xRatio)
Else
Picture1.Height = CLng(thePicture.Height * yRatio)
Picture1.Width = CLng(thePicture.Width * yRatio)
End If
Set Picture1.FormattedPicture = LoadPicture("c:\temp\myPic ture.bmp")
Dim thePicture As Object
Dim xRatio As Single, yRatio As Single
Set thePicture = LoadPicture("c:\windows\de
'calculate the ratio
xRatio = Picture1.Width / thePicture.Width
yRatio = Picture1.Height / thePicture.Height
'use the smallest ratio value to resize the original picture
If xRatio < yRatio Then
Picture1.Width = CLng(thePicture.Width * xRatio)
Picture1.Height = CLng(thePicture.Height * xRatio)
Else
Picture1.Height = CLng(thePicture.Height * yRatio)
Picture1.Width = CLng(thePicture.Width * yRatio)
End If
Set Picture1.FormattedPicture = LoadPicture("c:\temp\myPic
Code:
CrystalDecisions.CrystalRe
picobject.ObjectFormat.Ena
picobject.height = xx
picobject.top = xx
picobject.width = xx
picobject.left = xx
If you need more help let me know