ios - Downscaled image is drawn in very low quality? -


i have big logo image (1000x500). want use image , draw in frame of size 100x100. here how it:

self.logo = uiimageview(image: uiimage(named: "logobig")!) self.logo?.contentmode = uiviewcontentmode.scaleaspectfit self.logo?.frame = cgrectmake(self.view.bounds.width/2 - 50, 50, 100, 100) self.view.addsubview(self.logo!) 

this works. problem image quality low after reduction of image size.

how can draw big image smaller frame without loosing quality?

try this:

let logo = uiimageview(frame: cgrectmake(view.bounds.midx - 50, 50, 100, 100)) logo.contentmode = .scaleaspectfit logo.image = uiimage(named: "logobig")! view.addsubview(logo) 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -