I have this request or idea that I think you have not covered yet. I work at a pathology lab in a hospital and we work with a lot of images of tissues. In my database I can open images and everything has been great so far. I have learned very much thanks to your effort and courses. Now I have this challenge: I want to open an image and automatically go to a specific spot by giving the coordinates. For example if there are 3 spots on that picture, you should be able to specify (zoom in) on those 3 spots. This should be working also by opening an external program. I submit an image to show you what I mean. I know this is highly specialized but I am sure this technique is good for anyone who's working graphically with any image analysis. Thanks for your feedback.
This isn't so much a Microsoft Access problem as it is an image viewer problem. You would need to find an image viewer that you could open from Access, where you can specify the file name and then the coordinates to zoom into. I'm not personally familiar with any that can do this, and I asked GPT and here's what it said:
There aren't many dedicated image viewers that allow specifying a filename and zooming into a set of coordinates directly from the command line. However, you can achieve this functionality using some workarounds or scripting. Here are a few approaches:
1. IrfanView - IrfanView is a powerful image viewer for Windows that supports command-line arguments.
- While it does not support zooming into specific coordinates directly from the command line, you can use command-line arguments to open an image and set zoom levels.
- Example: Details i_view32.exe filename.jpg /zoom=(zoomlevel)
- You could create a script that opens the image at a set zoom level, but you'd need some manual intervention to pan to specific coordinates.
2. ImageMagick (via scripting) - ImageMagick is a command-line tool that can manipulate images in various ways, including cropping to certain coordinates.
- You could crop the image to the region you want to zoom into using the following command:
Details magick input.jpg -crop WxH+X+Y output.jpg
Where `W` is the width, `H` is the height, and `X`, `Y` are the coordinates of the top-left corner of the region to zoom into.
3. Python (PIL/Pillow) with a GUI Toolkit - Using Python and the Pillow library, you could create a small script to load an image, zoom into specific coordinates, and display the image using a GUI toolkit (e.g., Tkinter or PyQt).
- Example:
- Use Pillow to open the image.
- Use a GUI window to display the zoomed-in section.
- Zoom to specific coordinates based on your input.
If you want help creating a script or another solution for a specific scenario, let me know.
So I've never used any of these applications before, but if you want to play with them and see if they work for what you're trying to do, then I can certainly show you how to control them from Microsoft Access. It's basically just a shell command with the right parameters. And I've covered this in a million other videos.
Hi Richard, ChatGPT is once again close but only half-way there. The correct syntax to display a zoomed image is not with the /zoom option (which doesn't exist), but with the /display option. E.g.:
This will display the image at the top left corner (0, 0) of the desktop, in a 1000x1000 window, at 300% zoom, centered at the virtual resolution of (3900, 1100). If the original image is 2000x2000, then its "virtual" resolution after 300% zoom is 6000x6000.
The IrFanView software has a help document (in .CHM format) in About -> Help, and that was where I got the correct command line options. ChatGPT wouldn't know how to look inside a .CHM file. Tons of stuff don't reside on the Internet. So ChatGPT needs to acquire the ability (I don't know how) to look for info in non-Internet sources before it can be as good a finder of info as a human.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Developer 45.