2005-12-21, 06:56 AM
the thing is that for most composite images i use "@Filename" etc (even the background has "@CurrentLocation", "@PageNumbers" which makes skinning easier), so each time the file is drawn i have getnoncached... (whatever its called), since the normal method cant take hash params. so im forced to use
which, in theory, will stop the memory problem but will take a little longer to draw since the composite image has to be reloaded.
i have started experimenting with a custom skinHelper that at first just loads the composite images with all drawText"@whatever" passed as "" (so they dont show up) and in the render method calls a custom method "DrawTextAttributes(ref image foreground, string imagename, hashtable params)"
if you know of an easier/better way of doing all this, please let me know .
Code:
using(Image temp = skinHelper.getImageNonCached("Button",imageParams)){
g.DrawImage(temp,x,y,width,height);
}
i have started experimenting with a custom skinHelper that at first just loads the composite images with all drawText"@whatever" passed as "" (so they dont show up) and in the render method calls a custom method "DrawTextAttributes(ref image foreground, string imagename, hashtable params)"
Quote:Dont call GC.collect to force garbage collection. Its not recommended, and can really hurt performance.the only time i have ever needed to force a call to gc.collect is when im ripping mp3 off of a cd since the cpu is running at 100% and the gc wont run otherwise. since a popupbox composite image "@Message" attribute has to be redrawn to display the status, once again using the "using" method.
if you know of an easier/better way of doing all this, please let me know .