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)?
Who is Participating?
frodomanConnect With a Mentor Commented:
If you're using the RDC components then you can do this by setting the mode to "auto-size".  See more details here:

If you're just pulling in a picture from a database then AFAIK there isn't a way to do this.

in with a small application you can reference the picture object and resize it programatically

CrystalDecisions.CrystalReports.Engine.PictureObject picobject;
picobject.ObjectFormat.EnableCanGrow = true
picobject.height = xx = xx
picobject.width = xx
picobject.left = xx

If you need more help let me know

craduzaAuthor Commented:
i'm still working on the code...:) hope it will work.
craduzaAuthor Commented:
i'm using VB6 with Crystal report 8
craduzaAuthor Commented:
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\desktop\yahoo.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)
    Picture1.Height = CLng(thePicture.Height * yRatio)
    Picture1.Width = CLng(thePicture.Width * yRatio)
End If

Set Picture1.FormattedPicture = LoadPicture("c:\temp\myPicture.bmp")
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.