如何为图片上的计算机添加键盘?
致谢罗兰
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{positioning}
\usepackage{tikzpeople}
\usetikzlibrary{backgrounds,calc,shadings,shapes.arrows,shapes.symbols,shadows}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% taken from: https://texample.net/tikz/examples/computer-diagram/
\usetikzlibrary{fit}
\tikzset{
comp/.style = {
minimum width = 8cm,
minimum height = 4.5cm,
text width = 8cm,
inner sep = 0pt,
text = green,
align = center,
font = \Huge,
transform shape,
thick
},
monitor/.style = {draw = none, xscale = 18/16, yscale = 11/9},
display/.style = {shading = axis, left color = black!60, right color = black},
ut/.style = {fill = gray}
}
\tikzset{
computer/.pic = {
% screen (with border)
\node(-m) [comp, pic actions, monitor]
{\phantom{\parbox{\linewidth}{\tikzpictext}}};
% display (without border)
\node[comp, pic actions, display] {\tikzpictext};
\begin{scope}[x = (-m.east), y = (-m.north)]
% filling the lower part
\path[pic actions, draw = none]
([yshift=2\pgflinewidth]-0.1,-1) -- (-0.1,-1.3) -- (-1,-1.3) --
(-1,-2.4) -- (1,-2.4) -- (1,-1.3) -- (0.1,-1.3) --
([yshift=2\pgflinewidth]0.1,-1);
% filling the border of the lower part
\path[ut]
(-1,-2.4) rectangle (1,-1.3)
(-0.9,-1.4) -- (-0.7,-2.3) -- (0.7,-2.3) -- (0.9,-1.4) -- cycle;
% drawing the frame of the whole computer
\path[pic actions, fill = none]
(-1,1) -- (-1,-1) -- (-0.1,-1) -- (-0.1,-1.3) -- (-1,-1.3) --
(-1,-2.4) coordinate(sw)coordinate[pos=0.5] (-b west) --
(1,-2.4) -- (1,-1.3) coordinate[pos=0.5] (-b east) --
(0.1,-1.3) -- (0.1,-1) -- (1,-1) -- (1,1) -- cycle;
% node around the whole computer
\node(-c) [fit = (sw)(-m.north east), inner sep = 0pt] {};
\end{scope}
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{tikzpicture}[mylabel/.style={text width=8 mm, align=center}]
\node[draw] at (0,10.5) {closed room};
\node[police,minimum size=1.5cm] (B) at (0,4) {Interrogator};
\node[duck,minimum size=1.5cm,mirrored,good] (B) at (10,4) {User};
filldraw (0,4) node [below] {center here} circle (1pt);
\node [draw,dashed, very thick, shape=rectangle, minimum width=10cm, minimum height=10cm, anchor=center] at (0,5) {};
\pic(comp0) [draw,scale=0.4,fill = gray!20, pic text = {Supercomputer}] at (-8,2) {computer};
\node[draw,text width=4cm] at (-8,-1.5) {Supercomputer running an intelligent program};
\draw[thick] (-3,4) -- (-6.2,2.5);
\pic(comp0) [draw,scale=0.2,fill = gray!20, pic text = {something}] at (7,4) {computer};
\node[draw] at (7,2) {T3};
\pic(comp1) [draw,scale=0.2,fill = gray!20, pic text = {CAT}] at (3,4) {computer};
\node[draw] at (3,2) {T2};
\pic(comp0) [draw,scale=0.2,fill = gray!20, pic text = {DOG}] at (-3,4) {computer};
\node[draw] at (-3,2) {T1};
\draw[thick] (4,4) -- (6,3.5);
\node[draw] at (0,-1) {T1, T2, T3: Dumb Terminals};
\end{tikzpicture}
\end{document}