But usually it may be better to just clear last reference to picture early when you don't need the big picture any more.įirst tests on Windows seem to indicate that on Windows for DirectDraw Xojo also uses a similar system as drawing as memory usage goes up when you draw a picture into another one. Clicking the button to clear the cache space calls the Action event handler of the button, which itself calls the ClearCache method and that works like this: determines the cache folder location (macOS vs. Usually you may never need to do this, but if you load a lot of images, keep them in array and draw them into smaller ones, you may need a lot of memory, so clearing the cache may be good, especially for a 32-bit application, where memory is tight. This frees the memory for the cache and does not draw something as the coordinates are negative. You can clear the cache for example with the following call: On Windows you find the Local/Temp folder with the xojo scratch folder as well as Roaming/Xojo with the version specific cache folders. On Mac you look into the Library folder, also hidden by default. on Windows inside that folder is an invisible AppData folder. In the next dialog, enter QuitMenuItem (case matters. In the new window showing Finders preferences, click the + button at the lower left or press the Return key. But the cache is invalidated and freed, when the graphics of the picture is used. To clear the cache, please locate your user folder. go to the folder /Library/Caches/Realbasic (/Application Support/REALbasic 2006/ for REALbasic 2006) by clicking through the folders or using the Go to. Launch Prefs Editor (if its already running, type cmd+shift+O to open the domains chooser), then type 'finder' into the top-right search field: Select and open it. And the cache stays there after the drawing for the case of another draw command. The CGImage consumes about the same memory size as the normal picture part. ![]() When the picture is drawn or some plugin function requests a CGImage for the picture, Xojo will create one and cache it. If the picture has a mask, there is a second CGBitmapContext for the mask, which doubles the memory usage. So the pixels are hold in a CGBitmapContext for the actual picture. On MacOS the picture class implementation for an editable picture uses both a CGBitmapContext for the pixels and a CGImage for drawing it. Let's check how the implementations have an effect on memory consumption. REALbasic 2007r2 introduced the incremental compiler, but this compiler has a few bugs. Create your Xojo account and download Xojo to get started developing your first app. The Xojo picture class internally has several platform dependent implementations with slightly different behaviors. The problem Fix for Mac OS X Fix for Windows Fix for Linux The problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |