integrate images inside a .dll - futures io
futures io futures trading



integrate images inside a .dll


Discussion in NinjaTrader

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

integrate images inside a .dll

(login for full post details)
  #1 (permalink)
Belgium
 
Experience: Advanced
Platform: SaxoTrader
Broker: SaxoBank
Trading: ESTX
 
Posts: 292 since Dec 2009
Thanks: 243 given, 110 received

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 futures io?
If ES tracks SPX, why do support/resistance, Level 2, vo …
Emini and Emicro Index
OFA (Order Flow Analytics) Licence
NinjaTrader
Automating strategies on multiple charts with same symbol
TradeStation
ZigZag with Depth and Backstep
EasyLanguage Programming
Work with historical tcks data on MUltichart NET PowerLa …
MultiCharts
 
 
(login for full post details)
  #2 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,779 since Jun 2009
Thanks: 32,306 given, 97,566 received

 
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

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #3 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,779 since Jun 2009
Thanks: 32,306 given, 97,566 received


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

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
(login for full post details)
  #4 (permalink)
Belgium
 
Experience: Advanced
Platform: SaxoTrader
Broker: SaxoBank
Trading: ESTX
 
Posts: 292 since Dec 2009
Thanks: 243 given, 110 received

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
 
(login for full post details)
  #5 (permalink)
Vienna Austria
 
Experience: Advanced
Platform: NinjaTrader
Trading: Forex
 
AlBundy's Avatar
 
Posts: 25 since Jun 2013
Thanks: 10 given, 12 received

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
The following 3 users say Thank You to AlBundy for this post:
 
(login for full post details)
  #6 (permalink)
tenerife/espaņa
 
Experience: Advanced
Platform: NinjaTrader 7
Trading: FUTURES-ES,NQ,FDAX,YM,MES,MYM,MNQ,6E
 
Posts: 2 since Sep 2016
Thanks: 0 given, 0 received

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
 
(login for full post details)
  #7 (permalink)
Vienna Austria
 
Experience: Advanced
Platform: NinjaTrader
Trading: Forex
 
AlBundy's Avatar
 
Posts: 25 since Jun 2013
Thanks: 10 given, 12 received

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


futures io Trading Community Platforms and Indicators NinjaTrader > integrate images inside a .dll


Last Updated on January 24, 2017


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts