von Crys » Do 28. Aug 2014, 12:51
Nur mit copy'n'paste ist es leider nicht gemacht.
onimage ist gut und sehr kompakt (wenn man es mal installiert hat) und TikZ kann auch das Gitter darstellen.
Nur möchte ich nicht ein x-belibiges Gitter, sondern Einteilungen in mm, cm oder px.
Und ich weiß wirklich nicht wie ich das machen soll.
\documentclass[
tikz,
border=15pt,
%convert={outext=.png,density=300,size=600},
convert=false,
]{standalone}
\makeatletter
\newif\ifpgf@nodescope@grid
\tikzset{
nodescope grid/.is if=pgf@nodescope@grid,
every nodescope grid node/.style={
shape=rectangle,
font=\small\ttfamily,
inner sep=+0pt,
outer sep=+1pt,
fill=white,
overlay},
every nodescope node/.style={
shape=rectangle,
inner sep=+0pt,
outer sep=+0pt,
draw=none,
fill=none}}
\def\tikz@nodescope@env{%
\pgfutil@ifnextchar[\tikz@@nodescope@env{\tikz@@@nodescope@env{}[]}}
\def\tikz@@nodescope@env[#1]{%
\pgfutil@ifnextchar[{\tikz@@@nodescope@env{#1}}{\tikz@@@nodescope@env{#1}[]}}
\def\tikz@@@nodescope@env#1[#2]#3{%
\pgfutil@ifnextchar[{\tikz@@@@nodescope@env{#1}{#2}{#3}}{\tikz@@@@nodescope@env{#1}{#2}{#3}[]}}
\def\tikz@@@@nodescope@env#1#2#3[#4]{%
\tikz@scope@env[#4]
\node[every nodescope node/.try, #1, alias=tikz@last@nodescope]{\includegraphics[#2]{#3}};%
\pgftransformresetnontranslations
\pgftransformshift{\pgfpointanchor{tikz@last@nodescope}{south west}}%
\pgfsetxvec{\pgfpointdiff{\pgfpointanchor{tikz@last@nodescope}{south west}}{\pgfpointanchor{tikz@last@nodescope}{south east}}}%
\pgfsetyvec{\pgfpointdiff{\pgfpointanchor{tikz@last@nodescope}{south west}}{\pgfpointanchor{tikz@last@nodescope}{north west}}}%
\ifpgf@nodescope@grid
\draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
\foreach \x in {0,1,...,10}{
\node[every nodescope grid node/.try, left, rotate=90] at (\x/10,0) {\ifnum\x=10\relax1.0\else0.\x\fi};
\node[every nodescope grid node/.try, left] at (0,\x/10) {\ifnum\x=10\relax1.0\else0.\x\fi};
}
\fi
}
\tikzaddtikzonlycommandshortcutlet\tikz@orignodescope\nodescope
\tikzaddtikzonlycommandshortcutlet\tikz@origendnodescope\endnodescope
\tikzaddtikzonlycommandshortcutlet\tikz@origstartnodescope\startnodescope
\tikzaddtikzonlycommandshortcutlet\tikz@origstopnodescope\stopnodescope
\tikzaddtikzonlycommandshortcutlet\nodescope\tikz@nodescope@env
\tikzaddtikzonlycommandshortcutlet\endnodescope\endscope
\tikzaddtikzonlycommandshortcutlet\startnodescope\nodescope
\tikzaddtikzonlycommandshortcutlet\stopnodescope\endnodescope
\pgfutil@g@addto@macro\tikz@uninstallcommands{%
\let\nodescope\tikz@orignodescope
\let\endnodescope\tikz@origendnodescope
\let\startnodescope\tikz@origstartnodescope
\let\stopnodescope\tikz@origstopnodescope
}
\tikzdeclarecoordinatesystem{nodescope}{%
\edef\pgf@temp{#1}%
\expandafter\pgfutil@ifnextchar\expandafter x\expandafter\tikz@nodescope@split\expandafter\tikz@nodescope@split\pgf@temp\pgf@stop
}
\def\tikz@nodescope@split#1:#2\pgf@stop{%
\begingroup
\edef\pgf@temp{#1}%
\pgftransformresetnontranslations
\pgfsetxvec{\pgfpointdiff{\pgfpointanchor{#1}{south west}}{\pgfpointanchor{#1}{south east}}}%
\pgfsetyvec{\pgfpointdiff{\pgfpointanchor{#1}{south west}}{\pgfpointanchor{#1}{north west}}}%
\tikz@scan@one@point\tikz@nodescope@shift(#2)\relax
\endgroup
}
\def\tikz@nodescope@shift#1{%
\pgf@process{\pgfpointadd{#1}{\pgfpointanchor{\pgf@temp}{south west}}}%
}
\makeatother
\begin{document}
\begin{tikzpicture}
\begin{nodescope}[draw][width=.9\textwidth]{test_bild}[nodescope grid]
\end{nodescope}
\end{tikzpicture}
\end{document}
Nur mit copy'n'paste ist es leider nicht gemacht.
onimage ist gut und sehr kompakt (wenn man es mal installiert hat) und TikZ kann auch das Gitter darstellen.
Nur möchte ich nicht ein x-belibiges Gitter, sondern Einteilungen in mm, cm oder px.
Und ich weiß wirklich nicht wie ich das machen soll.[code]\documentclass[
tikz,
border=15pt,
%convert={outext=.png,density=300,size=600},
convert=false,
]{standalone}
\makeatletter
\newif\ifpgf@nodescope@grid
\tikzset{
nodescope grid/.is if=pgf@nodescope@grid,
every nodescope grid node/.style={
shape=rectangle,
font=\small\ttfamily,
inner sep=+0pt,
outer sep=+1pt,
fill=white,
overlay},
every nodescope node/.style={
shape=rectangle,
inner sep=+0pt,
outer sep=+0pt,
draw=none,
fill=none}}
\def\tikz@nodescope@env{%
\pgfutil@ifnextchar[\tikz@@nodescope@env{\tikz@@@nodescope@env{}[]}}
\def\tikz@@nodescope@env[#1]{%
\pgfutil@ifnextchar[{\tikz@@@nodescope@env{#1}}{\tikz@@@nodescope@env{#1}[]}}
\def\tikz@@@nodescope@env#1[#2]#3{%
\pgfutil@ifnextchar[{\tikz@@@@nodescope@env{#1}{#2}{#3}}{\tikz@@@@nodescope@env{#1}{#2}{#3}[]}}
\def\tikz@@@@nodescope@env#1#2#3[#4]{%
\tikz@scope@env[#4]
\node[every nodescope node/.try, #1, alias=tikz@last@nodescope]{\includegraphics[#2]{#3}};%
\pgftransformresetnontranslations
\pgftransformshift{\pgfpointanchor{tikz@last@nodescope}{south west}}%
\pgfsetxvec{\pgfpointdiff{\pgfpointanchor{tikz@last@nodescope}{south west}}{\pgfpointanchor{tikz@last@nodescope}{south east}}}%
\pgfsetyvec{\pgfpointdiff{\pgfpointanchor{tikz@last@nodescope}{south west}}{\pgfpointanchor{tikz@last@nodescope}{north west}}}%
\ifpgf@nodescope@grid
\draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
\foreach \x in {0,1,...,10}{
\node[every nodescope grid node/.try, left, rotate=90] at (\x/10,0) {\ifnum\x=10\relax1.0\else0.\x\fi};
\node[every nodescope grid node/.try, left] at (0,\x/10) {\ifnum\x=10\relax1.0\else0.\x\fi};
}
\fi
}
\tikzaddtikzonlycommandshortcutlet\tikz@orignodescope\nodescope
\tikzaddtikzonlycommandshortcutlet\tikz@origendnodescope\endnodescope
\tikzaddtikzonlycommandshortcutlet\tikz@origstartnodescope\startnodescope
\tikzaddtikzonlycommandshortcutlet\tikz@origstopnodescope\stopnodescope
\tikzaddtikzonlycommandshortcutlet\nodescope\tikz@nodescope@env
\tikzaddtikzonlycommandshortcutlet\endnodescope\endscope
\tikzaddtikzonlycommandshortcutlet\startnodescope\nodescope
\tikzaddtikzonlycommandshortcutlet\stopnodescope\endnodescope
\pgfutil@g@addto@macro\tikz@uninstallcommands{%
\let\nodescope\tikz@orignodescope
\let\endnodescope\tikz@origendnodescope
\let\startnodescope\tikz@origstartnodescope
\let\stopnodescope\tikz@origstopnodescope
}
\tikzdeclarecoordinatesystem{nodescope}{%
\edef\pgf@temp{#1}%
\expandafter\pgfutil@ifnextchar\expandafter x\expandafter\tikz@nodescope@split\expandafter\tikz@nodescope@split\pgf@temp\pgf@stop
}
\def\tikz@nodescope@split#1:#2\pgf@stop{%
\begingroup
\edef\pgf@temp{#1}%
\pgftransformresetnontranslations
\pgfsetxvec{\pgfpointdiff{\pgfpointanchor{#1}{south west}}{\pgfpointanchor{#1}{south east}}}%
\pgfsetyvec{\pgfpointdiff{\pgfpointanchor{#1}{south west}}{\pgfpointanchor{#1}{north west}}}%
\tikz@scan@one@point\tikz@nodescope@shift(#2)\relax
\endgroup
}
\def\tikz@nodescope@shift#1{%
\pgf@process{\pgfpointadd{#1}{\pgfpointanchor{\pgf@temp}{south west}}}%
}
\makeatother
\begin{document}
\begin{tikzpicture}
\begin{nodescope}[draw][width=.9\textwidth]{test_bild}[nodescope grid]
\end{nodescope}
\end{tikzpicture}
\end{document}[/code]