Page 1 of 1

Including (embedding) files such as graphics within the EXE

Posted: Sat Jun 07, 2003 4:27 pm
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

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

Posted: Sat Jun 07, 2003 4:34 pm
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.

Posted: Sat Jun 07, 2003 5:12 pm
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"

Posted: Sun Jun 08, 2003 8:32 am
by Rings
tkruk:
Joined: 07 Jun 2003
Posts: 2
Location: Brooklyn , NY
a location beside east-africa (NY = NYGERIA) ?

Posted: Sun Jun 08, 2003 9:03 am
by PB
> a location beside east-africa (NY = NYGERIA) ?

New York, dude. :)

Posted: Sun Jun 08, 2003 9:41 am
by Rings
is new york not in the 'United States' ?
he should write :
Location: U.S.
and not a small town in africa :)

Posted: Sun Jun 08, 2003 9:49 am
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.

Posted: Sun Jun 08, 2003 5:46 pm
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 :) :)