Quote:First, there seems to be an undefined limitation on the size of the file. I am trying to figure out how to calculate whether the file would be too large before saving. Any ideas what the exact limitation is?
We don't have any idea. As you can see in the SaveToBitmap help topic, that's a known problem. The CreateCompatibleBitmap function just returns a null value when called with dimensions and color depth that would require more than 10MB of memory, but we haven't found any reliable way to predict if that will happen (sometimes it works even with larger bitmaps).
Quote:You guys need to check for instability issues on save failure with huge pictures.
We do everything possible, which is to check for a NULL value in this case before trying to create a file. Indeed the memory peaks, but we can't call DeleteBitmap on the NULL value we receive from the create function.
Quote:Even when the save doesn't fail and even if I set ScaleFactor to 1, the app still becomes unstable when I use SaveToBitmap on huge pictures.
I don't see this happening in my test. The used memory stays at stable 20MB, and revert to 16MB after the loop completes (on a 1000x1000 bitmap):
For i = 1 To 100
fcx.SaveToBitmap diag.fileName + Str(i), fcx.DocLeft, fcx.DocTop, fcx.DocRight, fcx.DocBottom
Next
As a solution, you might try exporting multiple bitmaps smaller than 10MB and glue them together using some image processing library. Another option is to export to WMF, which works fine even with huge flowcharts.