This commit is contained in:
启星
2025-08-08 10:49:36 +08:00
parent 6400cf78bb
commit b5ce3d580a
8780 changed files with 978183 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
// Copyright (c) 2024 Tencent. All rights reserved.
// Author: eddardliu
#import "TUIMultimediaPasterView.h"
#import "TUIMultimediaPlugin/TUIMultimediaCommon.h"
#import "TUIMultimediaPlugin/TUIMultimediaStickerView.h"
#define PASTER_INITIAL_WIDTH 150
@interface TUIMultimediaPasterView () {
UIImageView *_imgView;
}
@end
@implementation TUIMultimediaPasterView
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self != nil) {
[self initUI];
}
return self;
}
- (void)initUI {
_imgView = [[UIImageView alloc] init];
_imgView.translatesAutoresizingMaskIntoConstraints = NO;
self.editButtonHidden = YES;
self.content = _imgView;
}
- (UIImage *)paster {
return _imgView.image;
}
- (void)setPaster:(UIImage *)paster {
self.content = nil;
_imgView.image = paster;
int width = MIN(PASTER_INITIAL_WIDTH, paster.size.width);
int height = width / paster.size.width * paster.size.height;
_imgView.bounds = CGRectMake(0, 0, width, height);
self.content = _imgView;
}
@end