How to enlarge/reduce bitmaps on a report

O

Oliver Keim

Hi,

I have implemented several test reports with additional screenshots.
Most of the screenshots are of different size. Some are just 200x20
pixels, others are 500x400 pixels.
The bitmaps are in my filesystem and the bitmaps are initialized during
the format event using this code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim lf As String

lf = GetWindowsPath("TestApplication:")

If Not IsNull(Me.ModePicture) Then
Me.ImagePreview.Picture = lf & "Pictures\" & Me.ModePicture
Else
Me.ImagePreview.Picture = ""
End If
End Sub

How can I output these bitmaps within the report so the bitmap appears
with correct aspect ratio and a correct output. The access report's
image control does offer alignment plus an size mode (zoom, stretch,
clip) but all of them do not offer a possibility to enlarge the bitmap
output if the bitmap is larger than the image control's size on the report.

Even worse, the image control seems not to be readjustable during format
events, where I would have added additional code to achive correct size
and positioning.

Does anyone know how to achieve the dynamic sizing of bitmaps on reports
during output format events?

Is there any other way to achieve the output of bitmaps with different
sizes?

I am using Access 2003.

Thank you in advance,

Oliver Keim.
(I didn't provide a mail address because of spam, sorry)
 
D

Duane Hookom

You might try add a column to your report's record source that has a varying
number of CrLf based on a field in the query. For instance if you have a
field named Quantity and want this field to determine the height of the
section. Add the function below to a standard module. Add a column to your
query:
GrowShrink: GetCrLf(Quantity)
Then bind a text box to GrowShrink and allow it to grow and shrink.


Function GetCrLf(intNum As Integer) As String
Dim intQty As Integer
For intQty = 1 To intNum
GetCrLf = GetCrLf & Chr(13) & Chr(10)
Next
End Function
 
E

Exponent

If you know the image dimensions it should be possible to resize the image control at runtime, although
the scaling may depend on various factors.

We have certainly been able to do this using our own image control, and it should be possible with Access
controls.

Ideally store the image dimensions in the table and resize the control before loading the image. Note
that scaling may depend on various things, like printer resolution, so take care if you need a general
solution. You may also want to limit the size, to prevent the image spanning several pages in the case
of higher resolution pictures, or scale dynamically to fit the largest image.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top