图像放大技术,需要澄清

发布于 2024-12-19 03:51:45 字数 168 浏览 0 评论 0原文

在我开始重新发明轮子之前,我想我应该在这里检查一下是否有人们知道和喜爱的已知图像放大技术?

我在想..对于每个图像,用手指点击,我会弹出同一图像的放大版本(可能是一部分)。我可以使用单个图像(并实际上放大它)还是应该在用户移动他/她的手指时交换图像?

这听起来合理吗?或者,这是否过于暴力?

Before i start reinventing the wheel, i thought i'd check here to see if there are known image magnification techniques people know and love?

I am thinking .. for each image, on finger tap, i'd pop up an enlarged version of the same image (part of probably). Can i get away with a single image (and actually magnify it) or should i just swap images as user moves his/her finger?

Does this sound reasonable or, is this too much of a brute force approach?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哽咽笑 2024-12-26 03:51:45

根据我对你的问题的理解 - 你想点击缩略图,它会转换为完整尺寸/更大尺寸。

我想到的最好方法是将 UIImageview 的内容模式设置为 UIViewContentModeAspectFill。

添加 CGSize 为 50X50 的图像视图 - 然后在其上添加一个 UITapGestureRecogniser 来触发执行类似以下操作的函数:

- (void)tapped:(id)sender{
    UIImageView *v = [(UITapGestureRecognizer *)sender view];
    CGRect f = [v frame];
    f.size = CGSizeMake(200,200);//or whatever size
    [UIView animateWithDuration:0.25f 
                     animations:^(){
                         [v setFrame:f];
                     }];
}

希望这有帮助

干杯,

迈克尔

From what I understand of your question - you want to tap on a thumbnail and it transitions to the full size/ larger size.

Best way of the top of my head would be to have a UIImageview with it's content mode set to UIViewContentModeAspectFill.

add the image view with CGSize of say 50X50 -- then add a UITapGestureRecogniser on it that triggers a function that does something like this:

- (void)tapped:(id)sender{
    UIImageView *v = [(UITapGestureRecognizer *)sender view];
    CGRect f = [v frame];
    f.size = CGSizeMake(200,200);//or whatever size
    [UIView animateWithDuration:0.25f 
                     animations:^(){
                         [v setFrame:f];
                     }];
}

hope this helps

Cheers,

Michael

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文