Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Is there someway to include pictures in the exefile?
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
IRC channel
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
How to share an .apk with...
by
rsu333
[
Today
at 03:30:16 pm]
[LAMW] How to send a What...
by
pasquale
[
Today
at 02:08:46 pm]
[Solved] SigSeg in TQtWid...
by
cdbc
[
Today
at 01:49:49 pm]
Passing parameters by nam...
by
MarkMLl
[
Today
at 01:35:14 pm]
Database change
by
Zvoni
[
Today
at 01:31:26 pm]
Problem with scrolling im...
by
ITomi
[
Today
at 01:27:50 pm]
TRichMemo - idiot questio...
by
lucamar
[
Today
at 12:57:37 pm]
websockets
by
MarkMLl
[
Today
at 12:35:00 pm]
Questionnaire for FLOSS r...
by
MarkMLl
[
Today
at 12:28:52 pm]
Lazarus Release 2.0.10
by
wp
[
Today
at 12:13:37 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Is there someway to include pictures in the exefile? (Read 1335 times)
Robert William Blennerhed
Sr. Member
Posts: 304
Love my Wife, My Kids and Lazarus/Freepascal.
Is there someway to include pictures in the exefile?
«
on:
August 06, 2018, 03:09:43 am »
In Android java, my Pictures for my Aura Migraine app is included in the apk file.
Is there a way to include Pictures in the Lazarus/Freepascal exefile?
Or do i have to send them in a mapp with the aura migraine exefile?
Sincerely
Bob
«
Last Edit: August 06, 2018, 03:13:31 am by R.Blennerhed
»
Logged
%
Handoko
Hero Member
Posts: 4009
My goal: build my own game engine using Lazarus
Re: Is there someway to include pictures in the exefile?
«
Reply #1 on:
August 06, 2018, 04:23:53 am »
Yes, you can include images into the exe file.
Try this:
01. Lazarus main menu > Project > Project Options
02. Project Options > Resources > Add
Then this is the the example code to load the image:
Code: Pascal
[Select]
[+]
[-]
unit
Unit1
;
{$mode objfpc}{$H+}
interface
uses
Classes
,
Forms
,
Controls
,
Graphics
,
ExtCtrls
;
type
{ TForm1 }
TForm1
=
class
(
TForm
)
Image1
:
TImage
;
procedure
FormCreate
(
Sender
:
TObject
)
;
end
;
var
Form1
:
TForm1
;
implementation
{$R *.lfm}
{ TForm1 }
procedure
TForm1
.
FormCreate
(
Sender
:
TObject
)
;
var
Stream
:
TResourceStream
;
begin
// Get the background image
Stream
:
=
TResourceStream
.
Create
(
HInstance
,
'IMG'
,
RT_RCDATA
)
;
Image1
.
Picture
.
LoadFromStream
(
Stream
)
;
Stream
.
Free
;
end
;
end
.
You can download the zip file for testing.
The documentation about Lazarus Resources:
http://wiki.freepascal.org/Lazarus_Resources
«
Last Edit: August 06, 2018, 08:31:53 am by Handoko
»
Logged
Robert William Blennerhed
Sr. Member
Posts: 304
Love my Wife, My Kids and Lazarus/Freepascal.
Re: Is there someway to include pictures in the exefile?
«
Reply #2 on:
August 10, 2018, 01:54:27 am »
Great
Thanks Handoko.
Logged
%
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Is there someway to include pictures in the exefile?
TinyPortal
© 2005-2018