LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scale image on PDA (Pocket PC)

Hi!
Is it possible to scale an image on a PDA-screen?
I found the zoom-property for images within  Windows,  but it's not implemented within LabVIEW PDA.

So do you know a way to display the whole picture with a resolution of perhaps 800x600 on a PDA-window?

Martin

0 Kudos
Message 1 of 12
(6,232 Views)
I wrote a pure G implementation for resizing images once which can be found here. PDAs are often slow, but I don't think resizing a picture of 800x600 to 320x240 should take more than a second at most.

___________________
Try to take over the world!
Message 2 of 12
(6,227 Views)
Thank you, tst!
I've tried your VI, it works fine on windows, but it doesn´t work on the PDA:

On both Platforms I read a JPG with a resolution of 800x600 and scaled it to 300x200 with your VI.
Afterwards I stored the 24bit-pixmap in a binary file and read both files (the one from the PDA and the one from the PC).
As you can see in the attached VI the PDA-version doesn´t contain the whole image.
Any ideas why? (See attached vi...)

Saving the pixmap before scaling works fine.

Another problem is, that with LabVIEW PDA only pictures with a resolution proportion of 4:3 are displayed right, i don´t know why...
Download All
0 Kudos
Message 3 of 12
(6,211 Views)

I don't have LV 8 (and I don't have an available PDA at the moment anyway), and your description isn't entirely clear to me, but I would say that if you can't see the whole picture then your display area is probably not as big as you think it is or maybe you're mixing up the horizontal and vertical resolutions?

Another thing to watch out for is the 24 bit color. I believe that at least PocketPCs only work with 16 bit color and I know that LV before 8 only supported 8 bit color. I seem to remember hearing that it now supports more colors, but I don't remember exactly how much, and I don't know what would happen with extra bits of color information.

As for the proportions, the aspect ratio boolean should handle that - it either stretches the image to fit the rectangle or places white bars on the shorter axis. Make sure you select the right option.


___________________
Try to take over the world!
Message 4 of 12
(6,210 Views)
hi...
I´m sorry for the little bit unclear description before.
As you can see in the attached pictures, a picture scaled with your function on a PC (PC-Resize-Test.jpg) is different from a picture scaled by the same way on a PDA (PDA-Resize-Test.jpg) and I don´t know why....


I don´t really think that it´s a problem of the PDA´s display depth or resolution because I don´t display pictures on the PDA at the moment.

The only thing I mentioned about displaying pictures is, that there seem to be problems with displaying pictures with proportions <> 4:3.

Message 5 of 12
(6,203 Views)
Martin,

Are you trying to put an image on the front panel of a PDA VI?  If so the only way I have found to make it look decent is to build with a scale factor of 1.  The default for a build is 2.  When you create or edit your build specification for the Pocket PC set your "Front Panel Scale Factor" to 1 and your VI will look the same from PC to PDA.

Hope this helps,

Steve

Message Edited by Murfi on 05-17-2006 08:53 AM

Message 6 of 12
(6,199 Views)
The next interesting fact is, that the pixmap generated by reading a JPG-File in Windows is different from the pixmap generated on the PDA with the same file.
The differences are only a few digits, (f.e. A9 and A5...).
Is it possible that this comes from different decompressing algorithms within LV for Windows und LV PDA?

Martin

0 Kudos
Message 7 of 12
(6,189 Views)
If you've been running exactly the same code in both targets then my guess would be that there is some bug in the way the PDA module processes the loop or the array functions in my VI - if you will look at the picture you posted you will see that it is 320x240, but that the code replaced the pixels only until 240 (you should probably see this better if you replace my initial color from white to something else). If you have the patience for it I would suggest trying to examine my code and seeing if you can find exactly what causes this.

___________________
Try to take over the world!
Message 8 of 12
(6,178 Views)
Hi folks,
I think, I´ve found the reason why tst´s vi doesn´t work on LV PDA:
There seems to be a bug within LV PDA, that indexing arrays without a given index or the autoindexing mode with loops doesn´t really work every time.
Since I´ve reduced your VI to the only features I need, replaced the autoindexing parts with indexing by the loop counter and put numbers in front of the array indexing parts the image size is ok.

Now I can begin to work on the other problems.

Martin

PS: See my scaling-version as attachment.

Message 9 of 12
(6,168 Views)

Well, I can't look at your code, but I believe I understand your described solution. It might be better if you can actually describe exactly when there is a problem, but that's not necessary.

This actually reminds me of another problem with arrays in the PDA module - If I remember correctly, using Insert into Array (it was either 7.0 or 7.1) without providing an indexing value would result in an operation opposite to that on regular LV - on the PC the new elements would be added at the end of the array and in the PDA they were added at the beginning of the array (probably element 0, since nothing was wired into the index).


___________________
Try to take over the world!
Message 10 of 12
(6,163 Views)