Search
 
SCRIPT & CODE EXAMPLE
 

PHP

generateThumbnailRepresentations


func generateThumbnailRepresentations() {
    
    // Set up the parameters of the request.
    guard let url = Bundle.main.url(forResource: "example", withExtension: "png") else {
        
        // Handle the error case.
        assert(false, "The URL can't be nil")
        return
    }
    let size: CGSize = CGSize(width: 60, height: 90)
    let scale = UIScreen.main.scale
    
    // Create the thumbnail request.
    let request = QLThumbnailGenerator.Request(fileAt: url,
                                               size: size,
                                               scale: scale,
                                               representationTypes: .all)
    
    // Retrieve the singleton instance of the thumbnail generator and generate the thumbnails.
    let generator = QLThumbnailGenerator.shared
    generator.generateRepresentations(for: request) { (thumbnail, type, error) in
        DispatchQueue.main.async {
            if thumbnail == nil || error != nil {
                // Handle the error case gracefully.
            } else {
                // Display the thumbnail that you created.
            }
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: how to disable html coding property in php 
Php :: How do I output top readers from MySql table 
Php :: seeder name singular or plural laravel 
Php :: laravel required_if fileld has value 
Php :: import csv laravel 8 
Php :: laravel retain old value 
Php :: Remove default product data tabs 
Php :: how check word is in sentence php 
Php :: odoctrine querybuilder print sql 
Php :: Do not call the observer when there is a model update in laravel 
Php :: add code in header 
Php :: ipay generate hash id 
Php :: GZIP COMPRESSION With PHP 
Php :: #@923uf8023hFO@I#H# 
Php :: how to write a php program for an electricity bill using if-else conditions 
Php :: leaf php 
Php :: codeception send text in ckeditor 
Php :: how to check if a user sent you money in paypal in php 
Php :: laravel find query 
Php :: php pdo fetch from db 
Php :: laravel facade 
Php :: file_get_contents with url 
Php :: php oop crud database 
Php :: Syntax error or access violation: 1055 
Php :: howw to see if a value is posted laravel 
Java :: import java math 
Java :: Console color text java 
Java :: how to loop through code 3 times java 
Java :: java how to print an array 
Java :: center justify jlabel 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =