It is currently Sun Aug 18, 2019 4:24 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to embed an Image in the executable?
PostPosted: Mon Jun 17, 2019 9:40 pm 
Offline
User
User

Joined: Thu May 02, 2019 3:57 am
Posts: 35
Location: USA
I have questions but I cannot find answers in the PB documentation.

How do I embed an image into the executable file? In other words, how do I put an image into a resource file in PB? And how do I get that image into an image button?

Thanks,
Robert


Top
 Profile  
Reply with quote  
 Post subject: Re: How to embed an Image in the executable?
PostPosted: Mon Jun 17, 2019 9:50 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1078
Location: Germany::Berlin()
Example:
Code:
EnableExplicit

CatchImage(1, ?Logo)

If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ButtonImageGadget(1, 10, 10, 50, 50, ImageID(1), 0)
 
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        End
    EndSelect
  ForEver
EndIf

DataSection
  Logo:
  IncludeBinary "D:\...\YourIcon.ico" ;-change the path
EndDataSection

_________________
ImageImageImageImage(Update: 17.08.2019 (+196 files, +1392 MB)) Image


Top
 Profile  
Reply with quote  
 Post subject: Re: How to embed an Image in the executable?
PostPosted: Mon Jun 17, 2019 9:52 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3013
Location: Boston, MA
Use:
DataSection
Image1: IncludeBinary File
EndDataSection
and
img_n = CatchImage(#PB_Any, ?Image_1) ; , img1_Size)

DOH! too late.

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: How to embed an Image in the executable?
PostPosted: Tue Jun 18, 2019 6:08 pm 
Offline
User
User

Joined: Thu May 02, 2019 3:57 am
Posts: 35
Location: USA
Thank you all for your replies.
Robert


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye