Recent

Author Topic: Application icon  (Read 40523 times)

Anonymous

  • Guest
Application icon
« on: June 17, 2005, 12:26:34 pm »
How do I change the icon for my Lazarus application? I have tried using the Icon property of the form but it doesn't work - it still shows the generic Windows application icon.

Forest

  • New Member
  • *
  • Posts: 16
Application icon
« Reply #1 on: June 18, 2005, 08:52:22 am »
must be as first resource in EXE. try create RC file with
ICON "icon.ico" (if icon.ico is in project directory) however i don't know yet how it will be compiled under Lazarus (this is how must be done in delphi, sorry i'm newbie in Lazarus)

Anonymous

  • Guest
Application icon
« Reply #2 on: August 21, 2005, 01:58:33 pm »
I also have problems with changing the icon with Lazarus. Here is what I made so far to solve this problem even thought I didn't solve it fully:
 1) First I drew an icon. To do it you can use alot of applications like IconCoolStudio. More about this software you can see at the web site: http://www.iconcool.com/
 2) After that I created a shortcut to the aplication. To do it in Windows rightclick over the compiled aplication and from the menu choose "Create Shortcut". You can rename the shortcut by rightclicking the shortcut and choose "Rename".
 3) I changed the icon of the shortcut. To do it rightclick over the shortcut and choose properties. On the form that appears there is a button named "Change Icon". Press it and after that browse the directories, find your new icon and select it for a new icon. After thet the shortcut will turn in the new icon. Then to start the aplication doubleclick over the shortcut.
 It would be perfect if I knew the normal way to change the icon with Lazarus but until then this can be an alternative.

thebigdax

  • New Member
  • *
  • Posts: 13
Application icon
« Reply #3 on: November 19, 2005, 07:00:34 pm »
i have this problem too

thebigdax

  • New Member
  • *
  • Posts: 13
Application icon
« Reply #4 on: November 19, 2005, 09:26:07 pm »
you can download something about the windows xp style there is thread in this forum

ciana

  • Guest
Application icon
« Reply #5 on: December 02, 2005, 11:22:55 pm »
Quote from: "Forest"
must be as first resource in EXE. try create RC file with
ICON "icon.ico" (if icon.ico is in project directory) however i don't know yet how it will be compiled under Lazarus (this is how must be done in delphi, sorry i'm newbie in Lazarus)


hm...  :roll: Lazarus IDE have an Icon and XP style implented in the exe file... But how should we do for do so in our applications to...

if someone could make an component smiliar to "Xp Manifest" to lazarus, so XP style where implented when the component was implented, it should be very good. And the icon problem MUST be fixed in some future version, because an main icon for all applications made with lazarus will make all applications made with lazarus orginal!

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2671
Application icon
« Reply #6 on: December 05, 2005, 12:05:50 pm »
The XP manifest component isn't needed in the future since lazarus will be using it by default
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

jixiany

  • Newbie
  • Posts: 2
Application icon
« Reply #7 on: March 01, 2007, 03:43:23 am »
{$R Project.Res}

The Project.Res is the same as Delphi projects' which include MainIcon.

davesimplewear

  • Sr. Member
  • ****
  • Posts: 321
    • Davids Freeware
Application Icon
« Reply #8 on: May 13, 2007, 07:48:09 am »
Hi, You need to create a .res file (with the same name as your program executable) and then include in the program code after uses and before program begins.

Quote
program master;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms
  { add your units here }, uMain, DBFLaz, uentry, usales, rxnew, uStock;
{$R *.RES}
begin
  Application.Initialize;
  Application.CreateForm(TfMain, fMain);
  Application.CreateForm(TfEntry, fEntry);
  Application.CreateForm(TfSales, fSales);
  Application.CreateForm(TfStock, fStock);
  Application.Run;
end.    
All things considered insanity seems the best option

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
RE: Application Icon
« Reply #9 on: May 16, 2007, 11:45:18 am »
I have made a program where you can change the icon of your applications, and where you can apply the XP or Vista style to your applications.

Tha program is Wi(n)XtaP, it now is FREEWARE, it may become open source in the future. THe actual version is 0.4.0, so it does not work perfectly. You can download the program at the following address:

http://files-upload.com/231253/WinXtaP0.4.0.rar.html

PS. The program is in multi language, but you have to selecte the right language, it actually does not get it automatically

This is  a preview of version 0.5.0

(http://freewebs.com/bpsoftware/Wi(n)XtaP/Wi(n)XtaP_0_5_0/wi(n)xtap_0_5_0-1.png)
(http://freewebs.com/bpsoftware/Wi(n)XtaP/Wi(n)XtaP_0_5_0/wi(n)xtap_0_5_0-2.png)

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
RE: Application Icon
« Reply #10 on: June 06, 2007, 02:18:44 pm »
Version 0.5.0 is uploaded, minor changes where apported

http://freewebs.com/bpsoftware/Wi(n)XtaP/Wi(n)XtaP_0_5_0/wi(n)xtap_0_5_0.RAR

antonio

  • Hero Member
  • *****
  • Posts: 605
RE: Application Icon
« Reply #11 on: June 11, 2007, 09:49:10 pm »
Or you can try our tool, LazVisual, http://br.geocities.com/antoniog123456/

beli0135

  • New Member
  • *
  • Posts: 47
RE: Application Icon
« Reply #12 on: June 12, 2007, 02:08:40 am »
How it is done in linux?
Regards,
Emil Beli

antonio

  • Hero Member
  • *****
  • Posts: 605
RE: Application Icon
« Reply #13 on: June 12, 2007, 02:19:22 am »
It's not done. You can -- eventually should -- put IFDEF's around your code. Like this:
Code: [Select]
{$IFDEF WINDOWS}
{$R WINRES.RES}
{$ENDIF}

banhof

  • Newbie
  • Posts: 2
Use standard *.res format
« Reply #14 on: July 26, 2007, 11:59:13 am »
I have it solved this way:
1.) Download resource editor, I have used XNResourceEditor (http://www.wilsonc.demon.co.uk/d10resourceeditor.htm).
2.) In XNResourceEditor create new file.
3.) In menu choose Resource > Import Image Resource
4.) Choose *.ico file which you want to use as main icon of your application
Rename group with your icon (it's name is 1) to MAINICON  by clicking on it and pressing F2
5.) Save file as resource file with name same as *.lpi file of your application is (name should be somethink like yourapplicationname.res) and place it to your application directory
6.) Open lazarus, in menu click on Project > Project Inspector and open lpr file of your project. It should be somethink like this:
Code: [Select]

program master;

{$mode objfpc}{$H+}

uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ add your units here }, uMain, DBFLaz, uentry, usales, rxnew, uStock;  
begin
Application.Initialize;
Application.CreateForm(TfMain, fMain);
Application.CreateForm(TfEntry, fEntry);
Application.CreateForm(TfSales, fSales);
Application.CreateForm(TfStock, fStock);
Application.Run;
end.

You have to add {$R *.RES} directive:
Code: [Select]

program master;

{$mode objfpc}{$H+}

uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ add your units here }, uMain, DBFLaz, uentry, usales, rxnew, uStock;

//Add this:
{$IFDEF Win32}
{$R *.RES}
{$ENDIF}

begin
Application.Initialize;
Application.CreateForm(TfMain, fMain);
Application.CreateForm(TfEntry, fEntry);
Application.CreateForm(TfSales, fSales);
Application.CreateForm(TfStock, fStock);
Application.Run;
end.

7.) Recompile your application and enjoy  :D

 

TinyPortal © 2005-2018