Including (embedding) files such as graphics within the EXE

Just starting out? Need help? Post your questions and find answers here.
tkruk
User
User
Posts: 24
Joined: Sat Jun 07, 2003 1:29 am
Location: New York, USA

Including (embedding) files such as graphics within the EXE

Post by tkruk »

Hi.

Sorry for my newbie question. But I can't seem to find the answer in
the forums (past postings).

Could someone provide an example how to embed or include
items such as graphics within the executable and then use it
in the program

OR

A way to have it in an external file like a PAK file (perhaps even encrypted) ala Blitz Basic.... and how to access it...

Thanks.

I've been using blitz3d and love PureBasic for apps because of the
small exe sites.. THANKS!!!

Tom
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Re: Including (embedding) files such as graphics within the

Post by tinman »

Use the IncludeBinary() and CatchImage()/CatchMovie()/etc commands. Or if you want to use the external PAK file approach, take a look at the Pack library.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Searhin
User
User
Posts: 41
Joined: Mon May 26, 2003 10:53 am
Location: Germany

Post by Searhin »

Hi tkruk,

try this:

Code: Select all

If CatchImage(ImageNo,?pic): EndIf

If OpenWindow(0,50,50,520,520,#PB_Window_SystemMenu,""): EndIf
  CreateGadgetList(WindowID(0))
  ImageGadget(0,0,0,520,520,UseImage(pic))

  Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow
End

pic: IncludeBinary "C:\pic.bmp"
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

tkruk:
Joined: 07 Jun 2003
Posts: 2
Location: Brooklyn , NY
a location beside east-africa (NY = NYGERIA) ?
SPAMINATOR NR.1
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> a location beside east-africa (NY = NYGERIA) ?

New York, dude. :)
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

is new york not in the 'United States' ?
he should write :
Location: U.S.
and not a small town in africa :)
SPAMINATOR NR.1
tkruk
User
User
Posts: 24
Joined: Sat Jun 07, 2003 1:29 am
Location: New York, USA

Post by tkruk »

Rings wrote:is new york not in the 'United States' ?
he should write :
Location: U.S.
and not a small town in africa :)

I'm sorry, when I write NY, I assume people will recognise
that it is New York. Not NYGERIA (or is it NIGERIA).

And Doesn't everyone know that Brooklyn is in New York,
which is in The USA.

I guess I am just silly. Sorry.

Tom.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

tkruk wrote:And Doesn't everyone know that Brooklyn is in New York,
which is in The USA.
Tom.
everyone knows that cologne is in germany !

just a joke tkruk, nothing else , so do'nt take it serious :) :)
SPAMINATOR NR.1
Post Reply