LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Max number of pictures in a picture ring control

My empirical testing seems to indicate that the picture ring control is limited to a maximum of 60 pictures.  However, I can't find any documentation that states the maximum number.  Can anyone confirm this?  If the max is 60, is there a better work around than just creating multiple picture ring controls on top of each other and bringing the one you want to the top?
0 Kudos
Message 1 of 6
(3,520 Views)

Tony:

 

What error are you getting?

 

What version of CVI are you using?  What size are your bitmap files?  What format are your files (bmp, jpg, etc.)?

How much RAM is in your system?

 

I tested loading different BMP files and I got the following results.

 

I added the BMP files to the picture ring using InsertListItem() directly on the filename.  I didn't use GetBitmapFromFile() first.

 

I just inserted the same file repeatedly until I got an out-of-memory error.

 

CVI 6.0

BMP file size 130 bytes: out of memory after inserting 9907 items.

BMP file size 9618 bytes: out of memory after inserting 9906 items.

BMP file size 960k bytes: out of memory after inserting 610 items.

 

CVI 9.0.1

BMP file size 130 bytes: out of memory after inserting 9904 items.

BMP file size 9618 bytes: out of memory after inserting 9903 items.

BMP file size 960k bytes: out of memory after inserting 609 items.

 

I compiled for debug.  My project does nothing other than insert items in a loop until it runs out of memory.

I have 3.48G of RAM.

Message Edited by Al S on 10-27-2009 03:54 PM
0 Kudos
Message 2 of 6
(3,484 Views)

I think this may be a UI problem instead of a memory problem.  I'm trying to create a static picture ring control that allows me to show a picture rotated to any angle between 0 and 360 degrees.  I began adding images to the ring control one at a time by pasting each image in through the UI editor.  Once I got to 60 pictures, any pictures I added after that were ignored.  I didn't get any error message.  It just threw away any image I tried to add after the first 60.

 

0 Kudos
Message 3 of 6
(3,479 Views)

Have you considered using code to rotate the bmp image?

 

If you Google rotate windows bmp image "ANSI C", you'll get over 13,000 hits, including from experts-exchange, codeproject, and codeguru, which are often pretty reliable.  For a lot of the posted code, you may need to write a C wrapper to a C++ class.

 

There's also a thread here that kicks around a couple of ideas and points to a CVI sample program for rotating text.

http://forums.ni.com/ni/board/message?board.id=180&message.id=20210&query.id=1345823#M20210

0 Kudos
Message 4 of 6
(3,468 Views)

I did consider using a canned rotation algorithm, but I'm responding to real time input from a touch panel and I don't think the rotation algorithms will be fast enough.

 

I actually gave up on the ring control idea and just decided to draw a basic polyline figure on a canvas control.  Its much faster rotating and transforming three points than an entire raster image.  At this point my interest in the ring control problem is more academic.

0 Kudos
Message 5 of 6
(3,459 Views)

Hi Tony,

 

I'm also not aware of any user interface editor limitation on the number of images in a picture ring. I tested it just now with CVI 9.0.1 and got up to 107 images before giving up. To make things faster, I simply kept pasting the same image over and over again, so I realize that it's not an absolutely identical experiment to what you were attempting (presumably, you were loading different images from file each time), but if there were some editor dialog limits on the number of images, what I was doing should have triggered it. There must be some bug in there somewhere that is causing this to happen, but it might only be triggered by some factor related to the actual images you were using (size, etc...)

 

In any case, I'm glad you got things working well with the canvas. By the way, if you decide that you want to use the raster images after all, you can always add the images to the ring programmatically, as Al suggested, or you can continue using a canvas and draw the images with the CanvasDrawBitmap function.

 

Luis

0 Kudos
Message 6 of 6
(3,443 Views)