Still on displaying images

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Firstly, by the lack of response I've received to my questions on images,
I'm beginning to assume people are steering clear of them. Is there a reason
for this?

Secondly, can anyone tell me if there is a method of altering the size of
the image placeholder to almost zero in height when there is no image to
display. eg within the report I may have 10 training sessions with no
certificate and then have 10 which do have certificates. I don't want a 9cm
blank space between between training sessions when there is no image for them.

Thanks in advance
Teewan
 
Thanks for that Paul,

My current issue is actually with reducing the height of a report details
section when I have no image to display, so still searching.

Teewan
 
If you have no image then set Me.Detail.Height to zero in the Detail_Format event. You must also set the
content to occupy zero space.

For example:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If HasImage Then
ImageCtrl.Width = x
ImageCtrl.Height = y
Me.Detail.Height = y
Else
ImageCtrl.Width = 0
ImageCtrl.Height = 0
Me.Detail.Height = 0
End If
End Sub

HasImage is your test for the presence or absence of an image.
x and y are the desired width and height of the image control & detail section when an image is present.

Alternatively, if you know the width and height of the image and want to display images sized proportionally,
you can use something like the following:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
ImageCtrl.Width = ImageWidth * Scale
ImageCtrl.Height = ImageHeight * Scale
Me.Detail.Height = ImageHeight * Scale
End Sub
 
Back
Top