使用 TikZ 間諜庫來監視投影機中的像素值

使用 TikZ 間諜庫來監視投影機中的像素值

我嘗試使用該TikZspy來放大某個像素圖像;我正在使用示波器在圖像中繪製圖像,並在此處繪製關於示波器座標問題的紅色 使用 TikZ 間諜放大圖片的一部分,以相對範圍座標表示

我的問題是,那個間諜似乎把重點放在了影像正確,但隨後選擇了錯誤的部分進行放大,例如在 MWE 中

\documentclass[german,10pt,xcolor=colortbl,compress]{beamer}
\usepackage{xunicode}
\usepackage{calc}
\usepackage{graphicx,tikz}
\usetikzlibrary{spy,calc}
\RequirePackage[no-math]{fontspec} 
\RequirePackage{xltxtra}
\setbeamertemplate{navigation symbols}{}
\begin{document}
    \begin{frame}{Example}{Spy on Images in Beamer}
        \begin{tikzpicture}[spy using outlines={circle,size=.1\textwidth, magnification=3, connect spies}]
            \node[anchor=south west,inner sep=0pt] (image) at (0,0) {%
            % \includegraphics[height=.5\textwdth]{exampleA}
            \begin{tikzpicture}
                \draw[draw=blue,fill=green!50] (0,0) rectangle (.5\textwidth,.5\textwidth);
                \shade[top color=black, bottom color=white] (.25\textwidth,.25\textwidth) rectangle (.5\textwidth,.5\textwidth);                    
            \end{tikzpicture}
            };
            \begin{scope}[x={(image.south east)},y={(image.north west)}]
                % Draw besides image
                \shade[top color=red, bottom color=blue] (1.025,.66) rectangle (1.075,1);
                \node (spy1) at (128/256,192/256) {};
                \coordinate (spyto1) at (-.5,.75); 
                \spy [black,thick] on (spy1) in node at (spyto1);
                \node (spy2) at (256/256,224/256) {};
                \coordinate (spyto2) at (-.5,.25); 
                \spy [black,thick] on (spy2) in node at (spyto2);
            \end{scope}
            % Adress a point in “pixels”
        \end{tikzpicture}
\end{frame}
\end{document}

放大倍率應直接位於綠色部分與陰影的邊界。儘管如此,放大倍率僅顯示綠色,並且在玩第二個,我認為它在左下角的兩個方向上都關閉了。

帶有瞄準鏡的投影機中的間諜錯誤

我沒有看到任何方法來獲取有關放大過程的信息,因此 - 任何線索,哪些計算仍然受到某些錯誤的影響範圍內的座標會非常有幫助。

編輯:正如 Andrew 指出的,這個問題在 TikZ/PGF 3.0 中得到了修復(現在對我來說也是如此);不過,如果有人可以提供有關此處出現問題的詳細資訊 - 請隨時分享。

相關內容