I am revisiting this question again because I never really got it to work. I have to load a graphic from the application directory to a Canvas. I have two extra folders to sort out the large number of graphics.The last folder is selected dynamically by code for a specific related graphic group. From what I understand with Microsoft if you exceed over a thousand folder item you have to start grouping the folder items into directories as I did.
My Windows installer creates session variables to install directories like this
%AppFolder% > %ProgramFilesFolder%\%ProductName%
Destination in the installer looks like this
%AppFolder%\Graphics\oteGraphics\SpecifiicGraphicFolder
This is the Path for 32 Bit
C:\Program Files (x86)\Guitar Analyzer\Graphics\oteGraphics\SpecifiicGraphicFolder
This is the Path for64 Bit
"C:\Program Files\Guitar Analyzer\Graphics\oteGraphics\SpecifiicGraphicFolder
This means that this part of the graphics directory is created by the installer
C:\Program Files (x86)\Guitar Analyzer\
C:\Program Files\Guitar Analyzer\
The remaining path has to be created by code to the final graphic folders
\Graphics\oteGraphics\
This is the Code Tim Hare helped me with
strImgFolder = “OvlBluLgNote” // no slashes needed
strImgFile = “OvlBluLg_1.bmp”
Dim f as FolderItem // no need for New FolderItem, as we’re just going to throw it away anyway
f = GetFolderItem(“Graphics”).Child(strImgFolder).Child(strImgFile) // no OpenAsPicture
This is the code I tried that I thought would work but didn’t.
f = GetFolderItem(“Note Graphics”).Child(strImgFolder).Child(strImgFile)
There is great wise proverb by Buck Minister Fuller:
Never change things by fighting the existing reality… To change something build a new model that makes the existing model obsolete.
Paul Lefebvre and Mark Zeeder at the last XDC2014 hinted to me that there is a far better way to do this. By creating a canvas object class. That takes far less code and I don’t have to overload GUI with so many canvas objects (like 144) they are drawn right in the Canvas as an object all you have to do is supply the X, Y coordinates to where to place them.
I didn’t quite get my mind around it but I keep chipping away at this mental block of fighting my existing reality. I’m trying to find this new model that makes the existing model obsolete.