10-23-2009 03:07 PM
10-27-2009 03:53 PM - edited 10-27-2009 03:54 PM
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.
10-27-2009 04:03 PM
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.
10-27-2009 07:13 PM
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
10-27-2009 08:59 PM
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.
10-28-2009 11:58 AM
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