src/swipl-devel/packages/xpce/man/refmanual/md/resource.md

class resource {#class-resource}

Class resource forms and interface to access data needed to get a running application that is not easily expressed in the programs source-code. Examples are graphics file, help-files, etc.

The following example declares and uses a resource object to access the bitmap 'pce.bm' from the standard bitmap library:

resource(pce, image, image('pce.bm')).

    ...
    new(I, image(resource(pce, image))),
    ...

The resource/3 clause is used by the runtime-generation system to attach the image to the runtime executable. Class resource is used by image ->load to access the resource-data, forming the proper image object.

Instance variables {#class-resource-instvars}

Send methods {#class-resource-send}

Get methods {#class-resource-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.