MATLAB 代码通常和一张图一起发,也就是说代码图片和图表是被当成一对来看的。
Codeshot 会根据你粘贴的代码识别 Matlab,不存在选错语言的问题。下面是同一段代码在内置 30 款主题中的三款下的效果,由应用自身的样式表渲染。
Matlab
不必离开 Mac,就能把 Matlab 代码片段变成值得分享的图片。
MATLAB 代码通常和一张图一起发,也就是说代码图片和图表是被当成一对来看的。
Codeshot 会根据你粘贴的代码识别 Matlab,不存在选错语言的问题。下面是同一段代码在内置 30 款主题中的三款下的效果,由应用自身的样式表渲染。
function img = exportSnapshot(code, theme, scale)
arguments
code (1,:) char
theme (1,:) char = 'xcode'
scale (1,1) double = 2
end
img = render(code, theme);
imwrite(imresize(img, scale), 'snapshot.png');
end
function img = exportSnapshot(code, theme, scale)
arguments
code (1,:) char
theme (1,:) char = 'xcode'
scale (1,1) double = 2
end
img = render(code, theme);
imwrite(imresize(img, scale), 'snapshot.png');
end
function img = exportSnapshot(code, theme, scale)
arguments
code (1,:) char
theme (1,:) char = 'xcode'
scale (1,1) double = 2
end
img = render(code, theme);
imwrite(imresize(img, scale), 'snapshot.png');
end
把代码图片的宽度和旁边那张图对齐。同一条帖子里两张宽度不同的图,看着像是失误。
让图片随内容自适应,或锁定一个比例——1:1、4:3、3:2、16:9、9:16、2:3 或 3:4——然后以 1×、2× 或 3× 导出,在 Retina 屏上依然清晰。用 ⌘⇧C 直接复制到剪贴板,或用 ⌘S 保存。
查看全部 30 款主题对比,或阅读完整流程。
一切都在你的 Mac 上完成,代码不会外传。