QuickAnswer
by

SwiftUI Overlay the image on the image at any position

SwiftUI Overlay the image on the image at any position

Overlay the image on the image at any position with Swift UI.

Overlay an image of 90 pixels in height and width on an image of 900 pixels in height and width at an arbitrary position

Swift 5.3.2
Xcode 12.4
iOS Target 14.4
macOS 11.2.3 BigSur

Example

struct ContentView: View {
    @State private var imageOne: String = "imageOne"
    @State private var imageTwo: String = "imageTwo"
    @State private var imageTwoPosition: CGPoint = CGPoint(x: 0, y: 0)

    var body: some View {
        NavigationView {
            Image(self.imageOne)
                .resizable()
                .frame(width: bodyView.size.width, height: bodyView.size.width, alignment: .center)
                .overlay(
                    Image(self.imageTwo)
                        .resizable()
                        .frame(width: bodyView.size.width / 10, height: bodyView.size.width / 10, alignment: .center)
                        .position(x: bodyView.size.width * self.imageTwoPosition.x / 900, y: bodyView.size.width * self.imageTwoPosition.y / 900)
                )
        }
    }
}

An image of 900 pixels in height and width is displayed to the full width of the screen.

An image of 90 pixels vertically and horizontally is superimposed on it at an arbitrary position.

imageOne
imageTwo
imageTwoPosition
These can be dynamically replaced or their values can be changed.

Of course, if the size is different, adjust accordingly.

CONTENTS
Web Browser