Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ private void markImageByText(
Rect textBounds = new Rect(left, top, right, bottom);

textPaint.setAntiAlias(true);

textPaint.setShadowLayer(10F, 11F,5F, Color.GRAY);
try {
//设置字体失败时使用默认字体
textPaint.setTypeface(ReactFontManager.getInstance().getTypeface(fontName, Typeface.NORMAL, this.getReactApplicationContext().getAssets()) );
Expand Down
8 changes: 7 additions & 1 deletion ios/RCTImageMarker/RCTImageMarker.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,17 @@ void saveImageForMarker(NSString * fullPath, UIImage * image, float quality)
int w = image.size.width;
int h = image.size.height;

NSShadow *shadow = [[NSShadow alloc]init];
shadow.shadowBlurRadius = 1.0;
shadow.shadowOffset = CGSizeMake(1, 1);
shadow.shadowColor = [UIColor grayColor];

UIGraphicsBeginImageContextWithOptions(image.size, NO, scale);
[image drawInRect:CGRectMake(0, 0, w, h)];
NSDictionary *attr = @{
NSFontAttributeName: font, //设置字体
NSForegroundColorAttributeName : color //设置字体颜色
NSForegroundColorAttributeName : color, //设置字体颜色
NSShadowAttributeName : shadow
};
CGRect position = CGRectMake(X, Y, w, h);
[text drawInRect:position withAttributes:attr];
Expand Down