init(cgImage:size:device:)
Creates a new image from a CGImage.
Declaration
convenience init?(cgImage: CGImage, size: CGSize, device: any MTLDevice)Parameters
- cgImage:
The Core Graphics image to create the texture from.
- size:
The size of the image in points.
- device:
The Metal device used to create the texture.
Return Value
A new TCControlImage instance, or nil if texture creation fails.