EXTERNAL MEDIA LIBRARY

Grafische Primitive, XbaseParts und Darstellungsfragen allgemein.

Moderator: Moderatoren

Antworten
simofranz
Rookie
Rookie
Beiträge: 15
Registriert: Mo, 26. Sep 2016 17:11

EXTERNAL MEDIA LIBRARY

Beitrag von simofranz »

is it possible to group all the images (background of my prg or other media elements) outside the EXE program and perhaps take advantage of the creation of a DLL to load these media and display them?
I would like to reduce the size of the EXE file but i wouldn't want to upload a JPG on the fly every time I need to set up a background

currently I use a classic structure ARC / RES , which creates a big single EXE

thanks
Benutzeravatar
Tom
Der Entwickler von "Deep Thought"
Der Entwickler von "Deep Thought"
Beiträge: 9515
Registriert: Do, 22. Sep 2005 23:11
Wohnort: Berlin
Hat sich bedankt: 113 Mal
Danksagung erhalten: 388 Mal
Kontaktdaten:

Re: EXTERNAL MEDIA LIBRARY

Beitrag von Tom »

You may create a ressource file (RES) for the DLL separately (which is standard) and publish a function/method in this DLL which returns the picture by number or ID. If you create this library as a dynamical library, you would be able to load it only if needed. But if you do so, you lose the benefit of the lower memory size of your EXE. This would happen anyway if the DLL was static.
I don't know how big your background images are, but even if they take 4 MB each and you have ten of them - this is only 40 MB.

We publish a library of thousands of icons coming with our application, and those icons are hosted by a dynamic DLL which is created with an application which came with the icons. If those icons are needed, the are loaded from the DLL (by number - we have a table with the numbers). This is slightly slower than having those icons in a ressource file, so if an icon from there is needed, it is assigned to a static variable and kept there for reuse while the app runs.
Herzlich,
Tom
simofranz
Rookie
Rookie
Beiträge: 15
Registriert: Mo, 26. Sep 2016 17:11

Re: EXTERNAL MEDIA LIBRARY

Beitrag von simofranz »

If you have the opportunity to publish some small examples I would be grateful

thanks
georg
Der Entwickler von "Deep Thought"
Der Entwickler von "Deep Thought"
Beiträge: 2845
Registriert: Fr, 08. Feb 2008 21:29
Hat sich bedankt: 113 Mal
Danksagung erhalten: 16 Mal

Re: EXTERNAL MEDIA LIBRARY

Beitrag von georg »

Hello, simofranz -

take a look at the documentation. Use the index and search for "Resource".

The result list has (on my PC) the following entries:

- Resource
- Recource compiler
- defining options ...
- directive <=== double click

This shows how to define such items via a .CH file (so you can refer to it from your program) and .arc file.

Next, have a look at the documentation for the XbpBitMap() class. The method :load() shows how to make use of the resource file, using the second parameter, a numeric resource ID.
Liebe Grüsse aus der Eifel,

Georg S. Lorrig
Redakteur der Wiki des Deutschprachigen Xbase-Entwickler e.V.
Benutzeravatar
Jan
Marvin
Marvin
Beiträge: 14726
Registriert: Fr, 23. Sep 2005 18:23
Wohnort: 49328 Melle
Hat sich bedankt: 24 Mal
Danksagung erhalten: 95 Mal
Kontaktdaten:

Re: EXTERNAL MEDIA LIBRARY

Beitrag von Jan »

The help that comes with the latest Xbase++ build 2276 shows the item "directive" under the search string "Resource compiler".

Jan
Mitglied der XUG Osnabrück
Mitglied der XUG Berlin/Brandenburg
Mitglied des Deutschsprachige Xbase-Entwickler e. V.
Antworten