Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Zoom Picture (A2k)

    I'm trying to zoom a picture as below.
    I keep having errors with the line that says:-

    With Me![imgPicture].Picture

    I'm getting runtime 424 object required with the line :- intWidth = .Width

    I've tried, With me.imgpicture which just expands the control over all controls.
    Any ide'a om how to just have the picture zoom within ImgPicture ??

    Private Sub Command74_Click()
    Dim intWidth As Integer
    Dim intHeight As Integer
    With Me![imgPicture].Picture
    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
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Zoom Picture (A2k)

    Dave,

    You need to distinguish between the picture (image) control and the Picture property.

    The Picture property is just a string - it contains the path and file name of the picture that is displayed in the image control. The Picture property is not an object with properties on its own (such as Width or Height). You can change the size of the control itself, as you found out, but that's not what you want. I don't think you can zoom the picture within the image control - the only options you have are clip (display picture at actual size), stretch (fill entire control, distorting the picture if necessary) and zoom (make the picture as large as possible without distorting it). The zoom setting does not mean that you can set an arbitrary zoom percentage.

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Zoom Picture (A2k)

    Hans
    I'd seen the zoom function on a demo from lebans.com which was really impressive.
    It's not really important that I implemented it in my system.
    Just thought it would be an attractive add-on.
    Thanks anyway.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Zoom Picture (A2k)

    What Stephen Lebans' demo does (apart from a whole lot of advanced other things), is put the image control on a subform. The subform has no record selector or navigation buttons, but it does have scroll bars. Zooming in or out is accomplished by increasing / decreasing the size of the image control, while SizeMode is set to Zoom.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •