Question Help refresh image controls on form

josephbupe

Registered User.
Local time
Today, 22:33
Joined
Jan 31, 2008
Messages
247
Hi,

I am building a database for a local museum in Lusaka to manage art works images, following the idea by Lebans which allows one to zoomin and zoomout an image.

ZoomIn:
Code:
Dim intWidth As Integer
Dim intHeight As Integer

With Me![imageframe1]
    intWidth = .Width
    intHeight = .Height

    .Width = intWidth * 1.05
    .Height = intHeight * 1.05
    .SizeMode = acOLESizeZoom
End With

' Allow Access time to Repaint Screen
' since we have Autorepeat set to TRUE for
' this Command Button
DoEvents

ZoomOut:
Code:
Dim intWidth As Integer
Dim intHeight As Integer

With Me![imageframe1]
    intWidth = .Width
    intHeight = .Height

    .Width = intWidth / 1.05
    .Height = intHeight / 1.05
    .SizeMode = acOLESizeZoom
End With

' Allow Access time to Repaint Screen
' since we have Autorepeat set to TRUE for
' this Command Button
DoEvents

What I want now is to include a button that will refresh image controls to their original size view on form if they were zoomedin or zoomedout.

Kindly see attached sample am working on. I will appreciate.

Joseph
 

Attachments

You could do it by putting hidden and unbound text boxes on your form for each image. One called OrgImHgt the other OrgImWdt.

The Control Source for OrgImHgt would be;
Code:
=[ImageHolderName].[ImageHeight]
and for OrgImWdt;
Code:
=[ImageHolderName].[ImageWidth]

Now in the On Click event of your reset button;
Code:
Dim intWidth As Integer
Dim intHeight As Integer

With Me![ImageHolderName]
    intWidth = Me.OrgImWdt
    intHeight = Me.OrgImHgt

    .Width = intWidth
    .Height = intHeight
    .SizeMode = acOLESizeZoom
End With
 
Hi John,

I will try it. Thank you.

Joseph
 
Hi again John,

I tried your code. It does work but returns the image to its actual original size, not the preview size in the image control on form, which i want.

Joseph
 
OK then instead of populating the unbound fields with the original image size, you'll need to work out how record the image preview size.
 

Users who are viewing this thread

Back
Top Bottom