objective c - size of .PNG file was increased after save back from NSView -


i read png file , save back, size of increased though have same picture me fix bug of below code?

fcimageview *imgview = (fcimageview*)(tabitem.view); cgimageref cgref = [imgview.imageview image]; nsbitmapimagerep *newrep = [[nsbitmapimagerep alloc]initwithcgimage:cgref]; [newrep setsize:[imgview.imageview imagesize]]; nsdata *pngdata = [newrep representationusingtype:nspngfiletype properties:nil];      //write file nsstring *filepath =@"/users/apple/02_workspace/testsavefile.png"; [pngdata writetofile:filepath atomically:yes]; 


in above code, [imgview.imageview image] return cgimageref instance


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -