NexusFi: Find Your Edge


Home Menu

 





integrate images inside a .dll


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one SARdynamite with 2 posts (0 thanks)
    2. looks_two Big Mike with 2 posts (2 thanks)
    3. looks_3 AlBundy with 2 posts (3 thanks)
    4. looks_4 jairo with 1 posts (0 thanks)
    1. trending_up 2,269 views
    2. thumb_up 5 thanks given
    3. group 4 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

integrate images inside a .dll

  #1 (permalink)
 SARdynamite 
Belgium
 
Experience: Advanced
Platform: SaxoTrader
Broker: SaxoBank
Trading: ESTX
Posts: 289 since Dec 2009
Thanks Given: 243
Thanks Received: 110

Hello,

I have scripts that I would like to pass to friends and relatives but protected as .dll

Those strategies include custom buttons with images I created for the purpose.
Those images are now stored on a folder within C:\ and I call them within the script to use for the buttons.

I'd like to know if there is a way to include the images natively inside my .dll ? I've tried a few things but can't make it work.
The goal is that the script can be imported just like a regular indicator and install itself the images on a misc. folder.

If that's not possible, I'll have to use and provide an installer aside. I'd prefer to avoid that.

Merry christmas

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
32 thanks
Just another trading journal: PA, Wyckoff & Trends
26 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
19 thanks
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,444 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608

 
Thread Moved


Moved from: NinjaTrader
Moved to: NinjaTrader Programming



When creating a new thread, note which subforum you are in. Here is a short list of suggestions:

- Topic: Anything to do with an Elite indicator -> Subforum: The Elite Circle
- Topic: Looking for an existing indicator, or how-to use an indicator -> Subforum: (the platform)
- Topic: Programmer needing help with non-Elite indicator -> Subforum: (the platform) - Programming
- Topic: Want an indicator created/modified -> Reply to "Want indicator created free" in Elite Circle
- Topic: Vendors (trading rooms, commercial indicators) -> Subforum: Vendors/Product Reviews
- Topic: Discussion of Forex or Currency trading -> Subforum: Forex and Currency Trading
- Topic: Journals of your trading -> Subforum: Trading Journals or Elite Trading Journals
- Topic: General trading related discussions -> Subforum: Traders Hideout
- Topic: Discussion of a trading method -> Subforum: Traders Hideout
- Topic: Automated Trading -> Subforum: Elite Automated Trading

Last, any Elite Member may create more or less any of these topics in The Elite Circle at your own discretion (your support is appreciated).

This is just a short general list and doesn't cover everything. If you are unsure where to create your new thread, just create it in Traders Hideout and a moderator will move it if necessary.

-- Big Mike Trading


We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,444 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608


You can call them from a website easily enough, not sure about actually encoding them and embedding them inside a DLL.

How to embed resources in ASP.NET 2.0 assemblies

You might try googling for MIME or base 64 encode and c# .net and see if that gets you anywhere, as I imagine you would need to basically hard code the encoded string for the image, then decode it and display it.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 SARdynamite 
Belgium
 
Experience: Advanced
Platform: SaxoTrader
Broker: SaxoBank
Trading: ESTX
Posts: 289 since Dec 2009
Thanks Given: 243
Thanks Received: 110

Thanks Mike.

I had thought about reading them online but I will try to code their conditional download on startup and see if that can be acceptable.

Started this thread Reply With Quote
  #5 (permalink)
 
AlBundy's Avatar
 AlBundy 
Vienna Austria
 
Experience: Advanced
Platform: NinjaTrader
Trading: Forex
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 12

Hi Mike,

thank you for the perfect hint regarding base64!
This is the code which works:

 
Code
        using System.IO;
        public Bitmap base64ToImage( string base64String )
        {
            // Decode the string and create a memory stream on the decoded string data.
            MemoryStream stream = new MemoryStream(Convert.FromBase64String(base64String));

            // Create a new bitmap from the stream.
            return new Bitmap(stream);
        }
Here you can convert any picture to a base64 c# string:
Base64 Image Encoder

Best Regars!

Reply With Quote
Thanked by:
  #6 (permalink)
 jairo 
tenerife/espaņa
 
Experience: Advanced
Platform: NinjaTrader 7
Trading: FUTURES-ES,NQ,FDAX,YM,MES,MYM,MNQ,6E
Posts: 2 since Sep 2016
Thanks Given: 0
Thanks Received: 0

Goodnight.
Could someone write an example code please?
I have converted the image to Base64 and it gives me a very long code that I do not know what to do with it.
I would like to assemble the dll with an image that I have in my computer so that when another person uses it on another pc it looks like the image.
Regards and many thanks to all.

Reply With Quote
  #7 (permalink)
 
AlBundy's Avatar
 AlBundy 
Vienna Austria
 
Experience: Advanced
Platform: NinjaTrader
Trading: Forex
Posts: 25 since Jun 2013
Thanks Given: 10
Thanks Received: 12

Yes, it is a very long code because each byte of the image is converted to a character. So a 1 KB image will produce a string of around 1'300 bytes.

Reply With Quote




Last Updated on January 24, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts