开发者

Cocoa resize NSImage while preserving animation

is there a way to resize a NSImage (animated gif) and preserve the animation? I want to make the animated gif with 512x256px size, fit a rect of 256x256px.

[newImage lockFocus];

[animatedGif drawInRect:newRect
        fromRect:NSMakeRect(0.0f, 0.0f, self.size.width, self.size.height)
        operation:NSCompositeCopy
        fraction:1.0f];开发者_JAVA百科

[newImage unlockFocus];


I would save the first picture of the animated gif. When you are going to resize the NSImage, just draw the first image of the animation.

I hope I understood your question correctly.


perhaps you can animate it manually with a timer which shows every 0.1 second another frame?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜