Discussion:
zoom picture in fixed size control
(too old to reply)
tst
2006-11-11 16:40:07 UTC
Permalink
I have actually written a VI that does just that as an experiment once, but to find it, backsave it to 6.1 and upload it may take a day or two.
In the mean time, you can do the main part (the resizing) like this:
<img src="Loading Image..."><a href="http://forums.ni.com/attachments/ni/170/214967/1/Resize%202D%20array2[1].png" target="_blank"></a>
If you don't want to code this, you can search OpenG or LAVA for "Bird's Eye View", which has a bi-linear image resizing VI somewhere inside it and should be saved in 6.1.


Resize%202D%20array2[1].png:
http://forums.ni.com/attachments/ni/170/214967/1/Resize%202D%20array2[1].png
tst
2006-11-13 20:10:10 UTC
Permalink
JoeCAE wrote:I tried to resize bitmap of size 800x600 to new height and width 1000x1000 and the computation time was very long (more than a minute or two).


That doesn't sound right at all.&nbsp;These sizes&nbsp;take&nbsp;me a lot less than a second using a pretty old laptop. They shouldn't take you any longer. I think there might be something you're missing in your implementation. You can find the VI posted online, so you can open it in 8 and compare to your own version.
The VI was only a&nbsp;quick and dirty test, so it's not much to look at. Basically, it draws a rectangle on the picture as you move the mouse to show you the zoom area and when you click it cuts the relevant part out of the picture and uses the resizing VI to do the zooming. Anyway, I have it on another computer and it will probably be another day or two before I can get to it.
As I previously suggested, you can also get the Bird's eye view toolkit, which uses a fake bi-linear interpolation to do the resizing. I haven't tested whether the quality is better, but I have benched it and my VI is just a tiny bit faster (when I opened a folder with a lot of big pictures it took about 15 seconds with the other VI and 14.something with mine).
tst
2006-11-16 08:40:08 UTC
Permalink
OK, I finally managed to dig up the example I did back then, and here it is, in 6.1.
Remember that this was basically just a proof of concept to myself, so it's quite messy, but it's not very complicated, so you should have no problem figuring it out.


Zoom.llb:
http://forums.ni.com/attachments/ni/170/215709/1/Zoom.llb

Loading...