Code
;Based on code by Bluid-fyte.
text$ = "NO IMAGE DEFINED!"
If OpenWindow(0, 0, 0, 600, 600, "",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
;Create an EMF to house the text.
hdc = CreateEnhMetaFile_(0, 0, 0, 0)
If hdc
oldBrush = SelectObject_(hdc, GetStockObject_(#NULL_BRUSH))
oldPen = SelectObject_(hdc, GetStockObject_(#WHITE_PEN))
SetBkMode_(hdc, #TRANSPARENT)
hFont = CreateFont_(100,55,450,0.0,0,0,0,0,0,0,0,0,0,"ARIAL")
oldFont = SelectObject_(hdc, hFont)
SetTextAlign_(hdc, #TA_LEFT|#TA_BOTTOM)
BeginPath_(hdc)
TextOut_(hdc, 70, 510,text$, Len(text$))
EndPath_(hdc)
SelectObject_(hdc, oldFont)
DeleteObject_(hFont)
StrokeAndFillPath_(hdc)
SelectObject_(hdc, oldPen)
SelectObject_(hdc, oldBrush)
hEMF = CloseEnhMetaFile_(hdc)
EndIf
width = WindowWidth(0)
height = WindowHeight(0)
;Now an image gadget etc.
If CreateImage(1, width, height, 24)
hdc = StartDrawing(ImageOutput(1))
If hdc
SetRect_(rc.RECT, 0, 0, width,height)
PlayEnhMetaFile_(hdc, hEMF, rc)
StopDrawing()
ImageGadget(1, 0,0,0,0,ImageID(1))
EndIf
EndIf
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_Event_CloseWindow
DeleteEnhMetaFile_(hEMF)
EndIf