Re: Zoom2D
- To: mathgroup at smc.vnet.net
- Subject: [mg78677] Re: Zoom2D
- From: dh <dh at metrohm.ch>
- Date: Sat, 7 Jul 2007 05:50:41 -0400 (EDT)
- References: <f6i8s9$1in$1@smc.vnet.net> <f6ign0$4p8$1@smc.vnet.net>
Hi Dimitris,
yes, I have a 2dim Zoom for version 5. However, it is part of an larger
application but I can extract the relevant routines. You would then have
to write the main program that feeds these routines. I have no time and
interest to do this just now.
Daniel
dimitris wrote:
> dh :
>> Hello All,
>>
>> here is a slightly improved version of a 2 dimensional zoome utility.
>>
>> Either copy the code directly into a notebook and execute or put it into
>>
>> a file with extension *.m and load it by <<"Filename". This will pop up
>>
>> a palette with a single button "Zoom". Select a 2 dim graphics and hit
>>
>> the button. This will open a new notebook with 2 panes, the upper pane
>>
>> contains the original graphics with a transluctance changable rectangle
>>
>> overlaid. The lower pane contains the zoomed rectangle region. If you
>>
>> resize the Notebook, the upper pane stays small.
>>
>> Daniel
>>
>>
>>
>>
>>
>> (*==== CODE ======*)
>>
>> (*Creates a Palette with a zoom button*)
>>
>>
>>
>>
>>
>> Zoom2D[g0_]:=Module[{g,pp1,pp2},
>>
>> If[!MatchQ[Head[g0],Graphics| GraphicsBox],CreateDialog[{TextCell["Zoom:
>>
>> No Input available."],DefaultButton[]}];Return[];];
>>
>> g=If[Head[g0]=!=Graphics,Replace[g0,head_[x1_,x2___]:>Graphics[{x1},{x2}]],g0];
>>
>> g = g/.NCache[_, x_] :> x;
>>
>>
>>
>> {pp1,pp2}=FullOptions[g,PlotRange]//Transpose;
>>
>>
>>
>> g1=DynamicModule[{p1=pp1,p2=pp2,lp={0,0}},
>>
>> Column[{
>>
>> LocatorPane[Dynamic[{p1,p2}],Show[{g,Graphics[{Opacity[0.1],Rectangle[Dynamic[p1],Dynamic[p2]]}]},ImageSize->Small]]
>>
>> ,EventHandler[Show[g,PlotRange:>Dynamic[Transpose[{p1,p2}]],Frame->True,ImageSize->Full]
>>
>> ,{"MouseClicked":>(lp=MousePosition["Graphics"])}
>>
>> ]
>>
>> ,Dynamic[lp]
>>
>> },Center]];
>>
>>
>>
>> CreateDocument[g1,WindowSize->{Small,All},WindowTitle->"Zoom-DH",WindowElements->{},WindowFrame->"Palette",BoxForm`ClosingSaveDialog->False];
>>
>>
>>
>> ]
>>
>>
>>
>> CreatePalette[
>>
>> Button["Zoom",Zoom2D[NotebookRead[SelectedNotebook[]]]
>>
>> ],WindowTitle->""];
>
> Do you have something a similar function for version 5.2?
>
> Dimitris
>
>