alec100_94 Posted September 12, 2018 Share Posted September 12, 2018 (edited) Hi Guys, I have been working on the latest version of my PCSX2 Configurator plugin as some of you will know, and the good news is, it is looking pretty good and close to feature complete. Now I am trying to add images to my plugin, I am using WPF and this is my first time using WPF. I've managed to get it mostly up and running but there is one thing that is really stumping me and that is loading in external images and how that works with LaunchBox's Directory structure. I've done my research and found I want something like this <ImageBrush ImageSource="pack://siteoforigin:,,,/Assets/Images/PCSX2 Configurator Window.png"/> But that doesn't do what it looks like it should, as "siteoforigin" in this case point to the main LaunchBox Directory and not the plugins directory. There are of course other options, I could embed the images, but don't really want to inflate my dll size by several hundred KB, or I could assume the dll is in "/Plugins/PCSX2 Configurator Next", and hard code that before my path. I understand it's probably also possible to set it through c#, and not be able to visualise it in the editor. None of those alternatives seem great to me, and I really feel like there should be a simple way of making the path relative to the executing assembly but I cannot seem to figure that out. I was hoping there was a standard that is generally used to work around this for LaunchBox Plugins, or maybe just something dumb I'm missing. Edited September 12, 2018 by alec100_94 Quote Link to comment Share on other sites More sharing options...
alec100_94 Posted September 12, 2018 Author Share Posted September 12, 2018 (edited) A quick look in the xaml tip and tricks thread, basically says it is standard practice (for LaunchBox) just to hardcode it, which is guess it fine, kind of wish I'd seen that before posting the thread. I just wasn't sure as it seemed kind of dumb and this is my first WPF project and i wanted to make sure I was doing it right. Edited September 12, 2018 by alec100_94 1 Quote Link to comment Share on other sites More sharing options...
alec100_94 Posted September 19, 2018 Author Share Posted September 19, 2018 (edited) Sorry to dig this back up, but how on earth do you do a similar thing with a .ttf font (with hard coded directory, or otherwise)? I have tried basically everything I can think of and looked around online but cannot get it to work at all, unless I embed the font (which I don't really want to do). The WPF aspect of developing this plugin has really been the least enjoyable part for me, I'm finding it horrendous to work with and really not seeing the appeal of it at all, and almost wishing I'd used Windows Forms instead. Edited September 19, 2018 by alec100_94 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.