title: SwiftUI actual Image size of a scaled image
body: <p>I am new to SwiftUI and trying to test an idea with it. I am sure what I want to do is simple but I am missing it. I want to get the size of the actual image as the scale changes. Everything I read tells me to use GeometryReader. But that seams to give me the size of the view it will be displayed in. As the scale changes, it does not change. 
  Below is my code, but it does not produce what I need. My end goal is so I know the size of the image and I can restrict the user so they can not slide the image out of the view independent of the scale. </p>
  
  <p>With following line of code, I would like to be able to position the image anywhere from the left side (0.0 offset) to the right side (1.0 x ?) independent of the scale of the image. </p>
  
  <p><code>.position(x: self.sharedImageOffset * geometry.size.width, y: 200 )</code></p>
  
  <p>Thanks for any help. </p>
  
  <pre><code>import SwiftUI
  
  struct ContentView: View {
      @State var sharedImageScale: CGFloat = 1.0
      @State var sharedImageOffset: CGFloat = 0.0
  
      var body: some View {
          VStack{
              GeometryReader { geometry in
                  Image("IMG_1650")
                      .resizable()
                      .aspectRatio(contentMode: .fill)
                      .scaleEffect(self.sharedImageScale)
                      .position(x: self.sharedImageOffset * geometry.size.width, y: 0 )
                      .background(Color.blue)
                      .gesture(
                          TapGesture()
                              .onEnded { _ in
                                  print("SIZE \(geometry.size)")
                          }
                  )
              }.border(Color.green, width: 2)
                  .clipped()
  
              HStack{
                  Text("Scale")
                  Slider(value: self.$sharedImageScale, in: 0.5...10 ).frame(minWidth: 10, idealWidth: 100, maxWidth: 200)
                  Text("Offset")
                  Slider(value: self.$sharedImageOffset, in: -1.0...1 ).frame(minWidth: 10, idealWidth: 100, maxWidth: 200)
              }
          }
      }
  }
  
  struct ContentView_Previews: PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  </code></pre>