Sign in Join
FPDoc Onlineexperiment

XPMToPPChar function

In unit Graphics

Converts an XPM image file into an array of PChar values.

Declaration

pascal
function XPMToPPChar(const XPM: string): PPChar

Description

Converts an XPM image file into an array of PChar values. The memory is allocated as one block, so freeing can simply be done using FreeMem. The data is just behind the array.

An XPM file can be included in a C source file, because it has a C syntax. In the compiled program it is simply an array of PChar. This function converts an XPM source file to the same array, by removing the comments and the string constant symbols.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.