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
How to embed an Image in the executable?
-
- User
- Posts: 71
- Joined: Thu May 02, 2019 3:57 am
- Location: USA
- Contact:
- RSBasic
- Moderator
- Posts: 1218
- Joined: Thu Dec 31, 2009 11:05 pm
- Location: Gernsbach (Germany)
- Contact:
Re: How to embed an Image in the executable?
Example:
Code: Select all
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
Re: How to embed an Image in the executable?
Use:
DataSection
Image1: IncludeBinary File
EndDataSection
and
img_n = CatchImage(#PB_Any, ?Image_1) ; , img1_Size)
DOH! too late.
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
-
- User
- Posts: 71
- Joined: Thu May 02, 2019 3:57 am
- Location: USA
- Contact:
Re: How to embed an Image in the executable?
Thank you all for your replies.
Robert
Robert