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
Post a Comment