Home > Enterprise >  Invert image captured from ImageRenderer
Invert image captured from ImageRenderer

Time:10-23

I have an image (outlined in red) displaying the result of Image of simulator showing canvas view and smaller view of the image derived from the canvas drawing

CodePudding user response:

enter image description here

ColorInvert enables you to implement the features you want.

import SwiftUI

struct ContentView: View {
    
    var body: some View {
        
        VStack {
            Image("sample")
                .colorInvert()
                .padding()
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
  • Related