There has been some discussion about enclosing graphics items (Pictures) within the application rather than storing the PNG files in the Resources folder.
I like the concept of creating a picture on the fly by using
dim p as Picture = Picture.FromData(DecodeBase64(TEXT))
where TEXT is a Constant or Text item.
I have created a MakeGraphicsModule application that will create an XML based module that you can just drag into your project and then reference the Constants as shown above. Run the application, select the folder of graphics objects that you want to include and then select the place where you want the module stored on disk. This will create the module.
Once created just drag the module in to your project and all the graphics files that are in the source folder are now available in Constant form that you can create pictures from on the fly and not bother with placing them in your project as pictures and not having to remember to add them to your CopyFiles routine.
You can download from here:
https://www.dropbox.com/s/2wzgn24jo06gns1/MakeGraphicsModule.pkg?dl=0
Given as a minor contribution to this great community.
Simon.
Thank You!
There’s just one little problem. ‘k as string’ is duplicated.
![](https://dl.dropbox.com/s/kbeeftmitpoiyuw/Screenshot%202015-05-13%2013.32.34.png??)
can not edit my own post…
![](https://dl.dropboxusercontent.com/s/kbeeftmitpoiyuw/Screenshot%202015-05-13%2013.32.34.png)
Works great Simon. Thanks for sharing.
Could you put it in a zip file please, without using the pkg file that needs my password to install it?
great idea, thanks for this
[quote=186858:@Axel Schneider]can not edit my own post…
[/quote]
The only time I have seen this is if there is a file in the folder that the program cannot assess. In this instance it places the leading ‘k’ only in the module.
I will look at this tomorrow and post a new app.
Simon.
I have now expanded this to allow you to capture the string for a single picture. Upon dropping the picture on to the canvas it will display the string representation and copy that string to the clipboard so it can be pasted directly in to a constant ion your project.
Download here:
https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/MakePictures.zip
Simon.
Simon you’re a genius.
Thank You for sharing that.
Thank you all for your comments.
[quote=187659:@Simon Berridge]Windows version available here:
https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/MakePicturesWIN.zip
Simon.[/quote]
Hi Simon
On my win7 PC there are 2 buttons ( I think ) on the left to select the ‘drop here’ screen or the ‘choose a folder’.
Both have very little height and the text is not viewable.
![](http://www.imagedisk.co.za/xojo/simon1.png)
Also any possibility of the app saving the Source and Destination selections in a file for next time the software is used, or maybe a button to take the folder selector to the current folder of the exe ?
Regards
Hmmm.
I don’t have a windows machine but will run it up in VMware.
Give me a little time, please.
Simon.
Dave
Please tell me what Windows version you are using.
I cannot get the same result when I use Windows 7 in VMWare.
This is what I get in Windows7.
![](https://dl.dropboxusercontent.com/u/10747116/RealStudioClasses/mp.png)
Using Windows 7 Ultimate, service pack 1
Could it be the font you have on the buttons is not standard to windows ?
Want to try changing it to the same as the “Make Pictures” below the dragon, as that is visible ?
It could be the font.
On VMWare it looks OK, but the font could be coming from my Mac.
I’ll change it and post again.
Simon.