I have a fairly simple form on which I want to drop the company logo as .PNG file. The problem is that when I compile the program and give the .EXE to the customer it references the original location of the image and so it appears as a blank image on the form.
Is there some way I could encapsulate an image file within the form so that it travels with the .EXE. I can covert the image to any other format.
Here's the code:
Code: Select all
;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;
Global Window_0
Global Image_0, Text_0, Start_Button, Status_Window, Text_1, Text_2
Global Img_Window_0_0
UsePNGImageDecoder()
Img_Window_0_0 = LoadImage(#PB_Any,"C:\Users\CA039461\Documents\PB\PFP\ba_logo.png")
Enumeration FormFont
#Font_Window_0_0
#Font_Window_0_1
EndEnumeration
LoadFont(#Font_Window_0_0,"Arial", 18, #PB_Font_Bold)
LoadFont(#Font_Window_0_1,"Arial", 12, #PB_Font_Bold)
Procedure OpenWindow_0(x = 0, y = 0, width = 590, height = 770)
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "Prepare for Print", #PB_Window_SystemMenu)
SetWindowColor(Window_0, RGB(255,255,255))
Image_0 = ImageGadget(#PB_Any, 60, 10, 470, 120, ImageID(Img_Window_0_0))
Text_0 = TextGadget(#PB_Any, 70, 140, 450, 40, "Prepare for Print", #PB_Text_Center)
SetGadgetColor(Text_0, #PB_Gadget_FrontColor,RGB(17,98,165))
SetGadgetColor(Text_0, #PB_Gadget_BackColor,RGB(255,255,255))
SetGadgetFont(Text_0, FontID(#Font_Window_0_0))
Start_Button = ButtonGadget(#PB_Any, 230, 190, 100, 40, "Start")
Status_Window = EditorGadget(#PB_Any, 20, 270, 550, 430)
SetGadgetColor(Status_Window, #PB_Gadget_BackColor,RGB(255,255,255))
Text_1 = TextGadget(#PB_Any, 20, 250, 550, 20, "Processing Status", #PB_Text_Center)
SetGadgetColor(Text_1, #PB_Gadget_FrontColor,RGB(17,98,165))
SetGadgetColor(Text_1, #PB_Gadget_BackColor,RGB(255,255,255))
SetGadgetFont(Text_1, FontID(#Font_Window_0_1))
Text_2 = TextGadget(#PB_Any, 20, 730, 550, 25, "", #PB_Text_Center)
SetGadgetColor(Text_2, #PB_Gadget_FrontColor,RGB(0,0,0))
SetGadgetColor(Text_2, #PB_Gadget_BackColor,RGB(255,255,255))
EndProcedure
/Dave