Code: Select all
Procedure savehybridfile()
Filename$=SaveFileRequester("Please choose file to save","","Database|*.dr2",0)
files$=GetExtensionPart(Filename$)
If files$="dr2"
mainfile$=Filename$
Else
mainfile$=Filename$ + ".dr2"
EndIf
If mainfile$=""
MessageRequester("Error","File Name Is Needed Or User Canceled", #PB_MessageRequester_Ok)
endif
width=10*270
height=6*300
CreateImage(0,width,height)
StartDrawing(ImageOutput())
;Here we get all the images of the program in different image gadgets
For d=#Image_9 To #Image_98
;These are my image gadget constants,whose image# is the same as
;the gadget constant
If d=#Image_9
xloc=0
yloc=0
hght=180
ElseIf d=#Image_10
xloc=271
yloc=0
ElseIf d=#Image_19
xloc=0
yloc=181
ElseIf d=#Image_20
xloc=271
yloc=181
ElseIf d=#Image_29
xloc=0
yloc=391
ElseIf d=#Image_30
xloc=271
yloc=391
ElseIf d=#Image_39
xloc=0
yloc=601
ElseIf d=#Image_40
xloc=271
yloc=601
ElseIf d=#Image_49
xloc=0
yloc=811
ElseIf d=#Image_50
xloc=271
hght=180
ElseIf d=#Image_59
xloc=0
yloc=1021
ElseIf d=#Image_60
xloc=271
yloc=1021
ElseIf d=#Image_69
xloc=0
yloc=1231
ElseIf d=#Image_70
xloc=271
yloc=1231
ElseIf d=#Image_79
xloc=0
yloc=1411
ElseIf d=#Image_80
xloc=271
yloc=1411
ElseIf d=#Image_89
xloc=0
yloc=1591
ElseIf d=#Image_90
xloc=271
yloc=1591
EndIf
DrawImage(UseImage(d),xloc,yloc,270,180)
xloc=xloc+270
Next
StopDrawing()
SaveImage(0, mainfile$,#PB_ImagePlugin_JPEG,10)
;Now we write gadget states and text to the same JPEG file
Repeat
gad=gad+1
If GetGadgetState(gad)=1 ;GADGET STATES,is it checked or no?
writeINI(tabname$,Str(gad),"yes",[b]mainfile$[/b])
ElseIf GetGadgetState(gad)=0
writeINI(tabname$,Str(gad),"no",mainfile$)
EndIf
Until gad=43
Repeat
gad=gad+1
Text$=GetGadgetText(gad) ;GADGET TEXT
writeINI(tabname$,Str(gad),Text$,[b]mainfile$[/b])
Until gad=55
endprocedure

