cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

Zooming into Picture Box Image

I have a window that pops up with an image, I would like to have the users able to zoom into the image to see more details but I don't see any zoom capabilities in the window. How can I accomplish this?

dt = Current Data Table();
// Plot bitmap bitmap = New Window( (dt << Get Name()) || " Bit Map", pic_file = Open( file_path, png); pic_file << Set Size( {500, 500} ); pb = Picture Box( pic_file ); );
3 REPLIES 3
jthi
Super User

Re: Zooming into Picture Box Image

Offering images through Graph Box is one option which would allow the users can use Magnifier tool from toolbar.

Edit: forgot to add example script

Names Default To Here(1);

imgBox = Graph Box(frameSize(500, 500), SuppressAxes);
win = New Window("Image", imgBox);

img = Open("$SAMPLE_IMAGES/tile.jpg", "jpg");
img << Set Size({500,500});

fb = win[framebox(1)];
fb << AddImage(Image(img));
img_seg = fb<< FindSeg(PictSeg(1));

img_seg << Fill Graph;
img_seg << lock(1);

Write();
-Jarmo
hogi
Level XIII

Re: Zooming into Picture Box Image

wow, very creative/useful workaround !!!

 

hogi
Level XIII

Re: Zooming into Picture Box Image

After defining imageZoom, one can use it wherever it's needed:

PictureBoxZoom = Function( {filename},
	window:img = Open( filename, "jpg" );
	Graph Box(
		frameSize( 300, 300 ),
		SuppressAxes,
		<<AddImage( Image( window:img ), Fill Graph, Lock( 1 ) )
	);
);

New Window( "Image",
	Outline Box( "Zoom Image",
		Text Box( "press CTRL to zoom"),
PictureBoxZoom( "$SAMPLE_IMAGES/tile.jpg" ) 
	)
);

Recommended Articles