Image Strategies

Moderator: Rathinagiri

Post Reply
melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Image Strategies

Post by melliott42 » Fri Apr 08, 2016 11:21 am

Hello all,

It is good we can use a tool like "Resource Hacker" to change the icon of the .exe. My question is slightly different than this though.

Rather than having all the image files for my buttons and the like in individual .png files, how can I store them all in one file (a resource type file)? Is there an HMG preferred method\example to do this?

Thanks for your advice,

Michael

User avatar
serge_girard
Posts: 2348
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 590 times
Been thanked: 124 times
Contact:

Post by serge_girard » Fri Apr 08, 2016 11:29 am

Michael,

You can edit the RC file and place this on top of it :

Code: Select all

1 VERSIONINFO
FILEVERSION     1,0,0,0
PRODUCTVERSION  1,0,0,0
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "080904E4"
    BEGIN
      VALUE "CompanyName", "YOUR NAME"
      VALUE "FileDescription", "HMG application"
      VALUE "FileVersion", "1.0"
      VALUE "InternalName", "HMG"
      VALUE "LegalCopyright", "YOUR NAME"
      VALUE "OriginalFilename", "HMG.EXE"
      VALUE "ProductName", "HMG"
      VALUE "ProductVersion", "1.0"
    END
  END

  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", 0x809, 1252
  END
END

PROJ			ICON		C:\HMG.3.0.44\***\proj.ico
Is this what you mean?

Serge

melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Post by melliott42 » Fri Apr 08, 2016 11:35 am

I was thinking in terms of distribution to end users. Finding the best method to not have to do it having a bunch of individual image files. Putting them in a one resource type file but still being able to use them.

EDIT: I have been trying to move to use the IDE as my primary method to create HMG apps. Not sure if this is outside its scope.

User avatar
serge_girard
Posts: 2348
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 590 times
Been thanked: 124 times
Contact:

Post by serge_girard » Fri Apr 08, 2016 11:45 am


melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Post by melliott42 » Fri Apr 08, 2016 11:54 am

Serge that looks great.

Thanks!

User avatar
serge_girard
Posts: 2348
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 590 times
Been thanked: 124 times
Contact:

Post by serge_girard » Fri Apr 08, 2016 12:09 pm

Thx to Claudio & Rathi !

Serge

melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Post by melliott42 » Fri Apr 08, 2016 2:56 pm

Can this method be used with the IDE?

Seems each time I press the IDE Play button (to compile and run) it wipes out my .rc file. Also it purges anything from the .hbc file so I cant have it point to a custom .rc file.

What can you recommend?

Thanks.

User avatar
serge_girard
Posts: 2348
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 590 times
Been thanked: 124 times
Contact:

Post by serge_girard » Fri Apr 08, 2016 3:06 pm

Michael,

What I do is:
In IDE close the project and edit RC file with another editor.
Then open project in IDE and check RC file.
S

melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

Post by melliott42 » Fri Apr 08, 2016 4:50 pm

Got it working - perfect! Thank you so much.

HMG is so much better than anything else out there. VB6 in its day was very easy too but that is 32-bit and no longer fully supported. .Net is a monstrosity of complexity and overkill.

Bravo HMG and its great user community!

EduardoLuis
Posts: 653
Joined: Tue Jun 04, 2013 6:33 pm
Location: Argentina
Has thanked: 1 time
Been thanked: 61 times

Post by EduardoLuis » Fri Apr 08, 2016 7:40 pm

Hi Melliot42:

About icon of your appe, you can design yourself an save it on C:\HMG.3.4.2\RESOURCES folder, replacing existing one with the file name "Windows".- When you compile, your EXE will have your defined icon.-

About image files, perhaps i missunderstood what you want.-
If you define those that will be used on you app (EXE), you don't need to attach with your EXE anything.-
If you include each graphic on the RC file that refers (f. ex. "NUM_BOT JPG NUM_BOT.JPG" on each RC file Line) to a graphic you use in your appe (on your appe definition of image must be calle without specifyng the type - "NUM_BOT"), all graphics will be compilled inside your EXE.-

RC file is generated automatically when define your project. You must only go to RC tab and include line by line each reference name, it's type (BITMAP, JPG, PNG, etc.), and the name of graphic file (NUM_BOT JPG NUM_BOT.JPG).-
I use this method and works fine.-

Generally i use JPG and PNG files because they a less weight than BMP.-
I use BMP only for small a less weight graphics.-

Hoping this helps you.
With regards.
Eduardo

Post Reply