How to open an image file after clicking on Picture Box?Hello Everybody,
I am using picture boxes to display 4 images loaded from files. The size of images needs to be reduced for displaying purposes. However, I would like to open an original image file after clicking on the image displayed in the picture box. I would appreciate for hints how to do that.
Best regards.
//initially no images
img1 = empty();
img2 = empty();
img3 = empty();
img4 = empty();
New Window("Images",
H List Box(
Panel Box("El 1", //place for EL images
EL1 = Picture Box(img1),
),
Panel Box("El 2",
EL2 = Picture Box(img2),
),
Panel Box("El 3",
EL3 = Picture Box(img3),
),
Panel Box("El 4",
EL4 = Picture Box(img4),
),
);
//here images will be opened
//img1 = open("D:\image.tif", tif);
//img1 << set size({image_w_new, image_h_new});
//EL1 << set image (img1);Re: How to open an image file after clicking on Picture Box?Thank you for suggestions and code! With opening of an original image I meant opening the file for example in Paint in order examine details of image in original size. Is there way to do that? Regards
EDIT:
Actually I could create a new window and then open the image again but in original size.
EDIT:
Ok, I managed to open the new window and display the image (using Paint or something another is actually not necessary). I am providing code from vince_faller with very small changes, maybe it will be helpful for somebody. Thank you once again.
Names default to here(1);
//initially no images
img1 = empty();
img2 = empty();
img3 = empty();
img4 = empty();
New Window("Example",
V List Box(
H List Box(
mb = MouseBox(
Panel Box("El 1", //place for EL images
EL1 = Picture Box(img1),
),
<<SETTRACKENABLE></SETTRACKENABLE>Re: How to open an image file after clicking on Picture Box?Could use a mousebox. But understand that the mousebox will make you lose other mouse functionality for that object (context menus, selecting graphs, etc)
Names default to here(1);
//initially no images
img1 = empty();
img2 = empty();
img3 = empty();
img4 = empty();
New Window("Images",
H List Box(
mb = MouseBox(
Panel Box("El 1", //place for EL images
EL1 = Picture Box(img1),
),
<<SETTRACKENABLE></SETTRACKENABLE>