beamer中暗背景插入图片

本文介绍如何在LaTeX文档中使用标准包graphicx来嵌入带有透明背景的图片,并通过xcolor包设置不同的背景颜色。此外,还展示了如何利用PGF/TikZ实现更高级的效果,如图案填充和渐变背景。

http://tex.stackexchange.com/questions/18685/techniques-for-embedding-images-with-transparent-backgrounds-in-latex

 

 

You need the standard package graphicx to include the image. Loaded xcolor would also be a good idea. Here some examples which use a transparent test PNG I got from http://entropymine.com/jason/testbed/pngtrans/rgba16.png .

 

写道
\documentclass{article}

\usepackage{xcolor}
\usepackage{graphicx}

\begin{document}

\framebox{\includegraphics{rgba16.png}}
\colorbox{red}{\includegraphics{rgba16.png}}
\colorbox{white}{\includegraphics{rgba16.png}}
\colorbox{yellow}{\includegraphics{rgba16.png}}

\end{document}

 

The first image shown is the original transparent PNG. As you can see the other work fine with some background color.

Result 1

For advanced effects like patterns and shadings I would recommend you PGF/TikZ (i.e. the tikz package).

 

写道
\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{patterns}

\begin{document}
\begin{tikzpicture}
\node [pattern=north east lines,inner sep=10pt] {\includegraphics{rgba16.png}};
\end{tikzpicture}
\begin{tikzpicture}
\node [shade,left color=yellow,right color=blue,inner sep=10pt] {\includegraphics{rgba16.png}};
\end{tikzpicture}
\end{document}

 

Result 2

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值