CRM64Pro GDK v0.13.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches

Description

Image Manager and Image objects for handling surfaces and textures [v25.12.0].

Overview

The Image module provides unified management for images and textures used by all graphic modules in the GDK. It supports BMP and PNG external files as well as SDL_Surface sources. Images can be saved to and loaded from CDC archives (using CDC v1.x specification).

Key features

  • Unified handling: Single interface for all graphic modules' image needs
  • Multiple formats: Support for BMP, PNG external files and SDL_Surface
  • Multi-screen textures: Automatic texture creation per screen
  • Image filters: Built-in visual effects (noise, blur, negative, etc.)
  • CDC storage: Load and save images using CDC v1.x specification
  • Cloning support: Efficient resource sharing through parent-child relationships

Image elements

Source surfaceStandard SDL_Surface where the imported BMP, PNG or SDL_Surface is stored
TexturesOne texture per screen. Created "offline" via optimize() or "online" automatically on first render. Always created with SDL_TEXTUREACCESS_TARGET flag
AttributesColor key (transparency), alpha value (surface transparency), color modulation and blending mode (SDL_BlendMode)

Image filters

The following filters can be applied to images (affects source surface and all textures):

NoiseAdds random noise effect
BlurApplies blur/smoothing effect
NegativeInverts color values
GreyConverts to greyscale
Black/WhiteConverts to two-tone black and white
WiggleApplies wave distortion effect
PixelateReduces resolution for pixelated effect

Image types

UninitializedCreated with ImageMgr::create() but lacks source surface (set via Image::assignSurface()). Not usable
Stand-aloneFully usable image with no children. No restrictions
ParentStand-alone image with one or more children. Restrictions: ColorKey cannot be modified, cannot be closed while children are live, name cannot be changed
ChildUses parent's source surface, textures and name. Restrictions: ColorKey cannot be modified, save() calls parent's method, name cannot be changed

Rendering methods

Images can be rendered to any valid screen or another image:

Image::render()Plain rendering with optional stretch or shrink
Image::renderEx()Extended rendering with rotation around a given point and vertical/horizontal flip effects

Manager type

This is an advanced "cloning" manager: when loading an image from a CDC file that is already loaded or created (using the name as the key), it will create a new "clone" (child) for the image. Child images share the source surface and textures with their parent for memory efficiency.

Best practices

  • Use optimize() to pre-create textures offline when loading screens to avoid runtime hitches
  • Leverage cloning to efficiently share image resources across multiple game objects
  • Be aware of parent-child restrictions when designing your image management strategy
  • Use PNG format for images requiring transparency; use BMP for simpler opaque images
  • Apply filters sparingly as they affect both source surface and all textures
  • Use render() for simple cases and renderEx() only when rotation or flipping is needed
  • Remember that child images cannot modify ColorKey, set it on the parent before creating children
  • Access the manager exclusively through Main::IImageMgr()
Note
The Image Manager is a singleton, automatically created once Main is instantiated. You can get a reference to this manager using Main::IImageMgr() method.
The Image Manager is automatically released when Main::Terminate() is called. At this time, any resource still loaded will be released, avoiding resource leaks.

Classes

class  CRM64Pro::Image
 Image Object class. More...
class  CRM64Pro::ImageMgr
 Image Manager class. More...

Enumerations

enum  CRM64Pro::eImageFilter {
  CRM64Pro::IF_NOISE = 1 , CRM64Pro::IF_BLUR = 2 , CRM64Pro::IF_NEGATIVE = 3 , CRM64Pro::IF_GREY = 4 ,
  CRM64Pro::IF_BW = 5 , CRM64Pro::IF_WIGGLE = 6 , CRM64Pro::IF_PIXELATE = 7
}
 Image filters. More...

Functions

Sint32 CRM64Pro::Image::info (Sint32 iMode=0)
 Request Image object information.
Sint32 CRM64Pro::Image::getName (string &sName)
 Get the name.
Uint32 CRM64Pro::Image::getID ()
 Get the ID.
Sint32 CRM64Pro::Image::assignSurface (SDL_Surface *pSurf, Sint32 iOwnership=0)
 Assign a SDL_Surface to this image.
Sint32 CRM64Pro::Image::setOwner (Sint32 iOwner)
 Set the owner of this image.
Sint32 CRM64Pro::Image::getOwner ()
 Get the owner of this image.
Sint32 CRM64Pro::Image::optimize (Sint32 idScreen=0)
 Optimize the image for rendering on screens in the most efficient way.
Sint32 CRM64Pro::Image::rebuild ()
 Rebuild the current textures.
Sint32 CRM64Pro::Image::render (Sint32 idRes=0, SDL_FRect *rSrc=nullptr, SDL_FRect *rDst=nullptr)
 Render the image.
Sint32 CRM64Pro::Image::renderEx (const double dAngle, const SDL_FPoint *poCenter=nullptr, const SDL_FlipMode rf=SDL_FLIP_NONE, Sint32 idRes=0, SDL_FRect *rSrc=nullptr, SDL_FRect *rDst=nullptr)
 Render the image with extended attributes: can rotate and flip the image.
Sint32 CRM64Pro::Image::applyFilter (eImageFilter eFilter, Sint32 iValue=0)
 Apply a filter to this image.
Sint32 CRM64Pro::Image::setBlendMode (SDL_BlendMode bmValue)
 Set blend mode used for rendering this image.
SDL_BlendMode CRM64Pro::Image::getBlendMode ()
 Get blend mode used for rendering this image.
Sint32 CRM64Pro::Image::setAlphaMod (Sint32 iAlpha)
 Set alpha modulation used for rendering this image.
Sint32 CRM64Pro::Image::getAlphaMod ()
 Get alpha modulation used for rendering this image.
Sint32 CRM64Pro::Image::setColorMod (Uint8 iR, Uint8 iG, Uint8 iB)
 Set color modulation used for rendering this image.
Sint32 CRM64Pro::Image::getColorMod (Uint8 &iR, Uint8 &iG, Uint8 &iB)
 Get color modulation used for rendering this image.
Sint32 CRM64Pro::Image::setColorKey (Sint16 iR=-1, Sint16 iG=-1, Sint16 iB=-1)
 Set colorkey used for rendering this image.
Sint32 CRM64Pro::Image::getColorKey (Sint16 &iR, Sint16 &iG, Sint16 &iB)
 Get colorkey used for rendering this image.
SDL_Surface * CRM64Pro::Image::getSurface ()
 Get the source surface of this image.
Sint32 CRM64Pro::Image::findTex (Sint32 &iIndex, SDL_Texture *&pTex, Sint32 &idScreen)
 Get the texture for each screen of this image.
Sint32 CRM64Pro::Image::saveToBMP (const string &sFile="")
 Export the image to a BMP file.
Sint32 CRM64Pro::Image::saveToPNG (const string &sFile="")
 Save the image to an external PNG file.
Sint32 CRM64Pro::Image::save (const string &sFileCDC)
 Save the image to a CDC file.
Sint32 CRM64Pro::Image::save (Sint32 idCDC)
 Save the image to a CDC file.
Sint32 CRM64Pro::ImageMgr::info (Sint32 iMode=0)
 Request Image Manager information.
Sint32 CRM64Pro::ImageMgr::create (const string &sName, Uint32 iVersion=10)
 Creates a new image.
Sint32 CRM64Pro::ImageMgr::close (Sint32 idImg)
 Close and destroy an image.
Sint32 CRM64Pro::ImageMgr::getNum () const
 Get number of loaded objects.
Sint32 CRM64Pro::ImageMgr::setName (Sint32 idImg, const string &sName)
 Change the object name.
Sint32 CRM64Pro::ImageMgr::closeEx (Sint32 idImg, Uint32 iOwner)
 Close and destroy an image.
ImageCRM64Pro::ImageMgr::get (Sint32 idImg)
 Get a pointer to the image using its handler.
Sint32 CRM64Pro::ImageMgr::duplicate (Sint32 idImg, const string &sName)
 Duplicate an image creating a new, identical and independent one.
Sint32 CRM64Pro::ImageMgr::child (Sint32 idImg)
 Create a child image dependent on the provided one (the parent).
Sint32 CRM64Pro::ImageMgr::isBMP (const string &sFile)
 Check if the file is a BMP.
Sint32 CRM64Pro::ImageMgr::isPNG (const string &sFile)
 Check if the file is a PNG.
Sint32 CRM64Pro::ImageMgr::loadFromFile (const string &sFile, const string &sName="")
 Load an image (BMP or PNG formats).
Sint32 CRM64Pro::ImageMgr::load (const string &sFileCDC, const string &sName)
 Load an image stored in a CDC file.
Sint32 CRM64Pro::ImageMgr::load (const Sint32 idCDC, const string &sName)
 Load an image stored in a CDC file.
Sint32 CRM64Pro::ImageMgr::load (void *pBuffer, Sint32 iSize, const string &sName)
 Load an image (BMP or PNG formats) stored on a memory buffer.
Sint32 CRM64Pro::ImageMgr::remove (Sint32 idCDC, const string &sName)
 Remove an image stored in a CDC file.
Sint32 CRM64Pro::ImageMgr::exist (Sint32 idCDC, const string &sName)
 Check if an image is stored in a CDC file.

Enumeration Type Documentation

◆ eImageFilter

Image filters.

Enumerator
IF_NOISE 

'eFilter' parameter in Image::applyFilter. Apply a noise effect with a specific iValue (from 0 to 100).

IF_BLUR 

'eFilter' parameter in Image::applyFilter. Apply a blur effect with a specific iValue (from 0 to 100).

IF_NEGATIVE 

'eFilter' parameter in Image::applyFilter. Apply a negative effect.

IF_GREY 

'eFilter' parameter in Image::applyFilter. Apply a grey effect.

IF_BW 

'eFilter' parameter in Image::applyFilter. Apply a black/white effect.

IF_WIGGLE 

'eFilter' parameter in Image::applyFilter. Apply a wiggle effect that can be animated using variable iValue.

IF_PIXELATE 

'eFilter' parameter in Image::applyFilter. Apply a pixelate effect that can be animated using variable iValue.

Function Documentation

◆ info() [1/2]

Sint32 CRM64Pro::Image::info ( Sint32 iMode = 0)

Request Image object information.

Writes information to the default log.

Parameters
iModeunused for the time being.
Returns
0 on success, or a negative error code on failure.

◆ getName()

Sint32 CRM64Pro::Image::getName ( string & sName)

Get the name.

Parameters
sNamea string pointer to be filled in with the image name.
Returns
0 on success, or a negative error code on failure.

◆ getID()

Uint32 CRM64Pro::Image::getID ( )

Get the ID.

Returns
Object ID.

◆ assignSurface()

Sint32 CRM64Pro::Image::assignSurface ( SDL_Surface * pSurf,
Sint32 iOwnership = 0 )

Assign a SDL_Surface to this image.

Used for loading the source surface to images created with ImageMgr::create().

Parameters
pSurfSDL_Surface pointer.
iOwnership0 (default) creates an internal copy (original can be freed), any other value takes ownership (do not free if call succeeds).
Returns
0 on success, or a negative error code on failure.
Note
Once the image has a source surface, it cannot be replaced so this method will fail.

◆ setOwner()

Sint32 CRM64Pro::Image::setOwner ( Sint32 iOwner)

Set the owner of this image.

Parameters
iOwnerOwner of the image.
Returns
0 on success, or a negative error code on failure.
Note
Only images belonging to ImageMgr can modify their owner.

◆ getOwner()

Sint32 CRM64Pro::Image::getOwner ( )

Get the owner of this image.

Returns
The owner or this image.

◆ optimize()

Sint32 CRM64Pro::Image::optimize ( Sint32 idScreen = 0)

Optimize the image for rendering on screens in the most efficient way.

Parameters
idScreena valid screen handle used to convert the image to the same format as the screen. The screen must be initialized.
Returns
0 on success, or a negative error code on failure.

◆ rebuild()

Sint32 CRM64Pro::Image::rebuild ( )

Rebuild the current textures.

This method will rebuild any existing texture and it is used when the source surface is modified and the textures have to be "in-sync".

Returns
0 on success, or a negative error code on failure.

◆ render()

Sint32 CRM64Pro::Image::render ( Sint32 idRes = 0,
SDL_FRect * rSrc = nullptr,
SDL_FRect * rDst = nullptr )

Render the image.

Parameters
idResa valid screen or image handle. Default uses the default screen.
rSrcthe source SDL_FRect structure or nullptr for the entire image. Default nullptr.
rDstthe destination SDL_FRect structure or nullptr to match rSrc. Can stretch or shrink the image. Default nullptr.
Returns
0 on success, or a negative error code on failure.
Note
With multiple screens, it is more optimal to render all images on one screen, then pass to the next screen and so on.

◆ renderEx()

Sint32 CRM64Pro::Image::renderEx ( const double dAngle,
const SDL_FPoint * poCenter = nullptr,
const SDL_FlipMode rf = SDL_FLIP_NONE,
Sint32 idRes = 0,
SDL_FRect * rSrc = nullptr,
SDL_FRect * rDst = nullptr )

Render the image with extended attributes: can rotate and flip the image.

Parameters
dAngleangle in degrees for the rotation.
poCenterSDL_FPoint pointer indicating the rotation center. Default nullptr rotates around rDst.w/2 and rDst.h/2.
rf"SDL_FlipMode" value for flipping actions.
idResa valid screen or image handle. Default uses the default screen.
rSrcthe source SDL_FRect structure or nullptr for the entire image. Default nullptr.
rDstthe destination SDL_FRect structure or nullptr to match rSrc. Can stretch or shrink. Default nullptr.
Returns
0 on success, or a negative error code on failure.
Note
With multiple screens, it is more optimal to render all images on one screen, then pass to the next screen and so on.
Rendering to another image only supports flip modes, rotation will not be applied.

◆ applyFilter()

Sint32 CRM64Pro::Image::applyFilter ( eImageFilter eFilter,
Sint32 iValue = 0 )

Apply a filter to this image.

Works on stand-alone and parent images; children cannot apply a filter. As the image is shared between parent and children, applying a filter to a parent affects all children.

Parameters
eFilterCheck ::eImageFilter enum for details.
iValueadjustable value for some filters.
Returns
0 on success, or a negative error code on failure.
Note
Applying a filter after a texture is created for a screen forces a slow rebuilding process.

◆ setBlendMode()

Sint32 CRM64Pro::Image::setBlendMode ( SDL_BlendMode bmValue)

Set blend mode used for rendering this image.

Parameters
bmValueSDL_BlendMode.
Returns
0 on success, or a negative error code on failure.
Note
Alpha modulation and ColorKey require a blending mode. This method enables or disables blending independently of alpha modulation and/or colorkey usage.

◆ getBlendMode()

SDL_BlendMode CRM64Pro::Image::getBlendMode ( )

Get blend mode used for rendering this image.

Returns
SDL_BlendMode.

◆ setAlphaMod()

Sint32 CRM64Pro::Image::setAlphaMod ( Sint32 iAlpha)

Set alpha modulation used for rendering this image.

Parameters
iAlphaIt ranges from 255 (opaque) to 0 (fully transparent).
Returns
0 on success, or a negative error code on failure.
Note
Alpha modulation needs a blending mode, if it is already set, will not be modified, otherwise, SDL_BLENDMODE_BLEND is set.

◆ getAlphaMod()

Sint32 CRM64Pro::Image::getAlphaMod ( )

Get alpha modulation used for rendering this image.

Returns
It ranges from 255 (opaque) to 0 (fully transparent).

◆ setColorMod()

Sint32 CRM64Pro::Image::setColorMod ( Uint8 iR,
Uint8 iG,
Uint8 iB )

Set color modulation used for rendering this image.

By default, all components are set to 255.

Parameters
iRred color component value from 0 to 255.
iGgreen color component value from 0 to 255.
iBblue color component value from 0 to 255.
Returns
0 on success, or a negative error code on failure.

◆ getColorMod()

Sint32 CRM64Pro::Image::getColorMod ( Uint8 & iR,
Uint8 & iG,
Uint8 & iB )

Get color modulation used for rendering this image.

Parameters
iRred color component value from 0 to 255.
iGgreen color component value from 0 to 255.
iBblue color component value from 0 to 255.
Returns
0 on success, or a negative error code on failure.

◆ setColorKey()

Sint32 CRM64Pro::Image::setColorKey ( Sint16 iR = -1,
Sint16 iG = -1,
Sint16 iB = -1 )

Set colorkey used for rendering this image.

Colorkey can only be modified on stand-alone images. Internally emulated using blending modes; if already set, it is not modified, otherwise SDL_BLENDMODE_BLEND is set.

Parameters
iRred color component (0-255). Negative value disables colorkey.
iGgreen color component (0-255). Negative value disables colorkey.
iBblue color component (0-255). Negative value disables colorkey.
Returns
0 on success, or a negative error code on failure.
Note
Modifying colorkey after texture creation automatically calls rebuild() which is slow.

◆ getColorKey()

Sint32 CRM64Pro::Image::getColorKey ( Sint16 & iR,
Sint16 & iG,
Sint16 & iB )

Get colorkey used for rendering this image.

Parameters
iRred color component (0-255). Negative means colorkey is disabled.
iGgreen color component (0-255). Negative means colorkey is disabled.
iBblue color component (0-255). Negative means colorkey is disabled.
Returns
0 on success, or a negative error code on failure.

◆ getSurface()

SDL_Surface * CRM64Pro::Image::getSurface ( )

Get the source surface of this image.

Returns
SDL_Surface pointer on success or nullptr on failure.
Note
Modifying the surface when there is any texture for a screen created, requires to call to rebuild() method for updating the texture(s).
Warning
Removing this surface will probably cause an application crash.

◆ findTex()

Sint32 CRM64Pro::Image::findTex ( Sint32 & iIndex,
SDL_Texture *& pTex,
Sint32 & idScreen )

Get the texture for each screen of this image.

Parameters
iIndexpointer to an integer containing 0 for find the first texture or the iIndex value of previous calls to this method.
pTexpointer to a SDL_Texture, nullptr when no texture is present.
idScreenpointer to the screen handle for which the texture is, when no texture is present it is set to -1.
Returns
0 on success(a texture is returned) or a negative error code on failure.

◆ saveToBMP()

Sint32 CRM64Pro::Image::saveToBMP ( const string & sFile = "")

Export the image to a BMP file.

If the BMP file already exists, it will be overwritten.

Parameters
sFilestring containing [directory]+filename+[extension]. Ideally should have .bmp extension. Directory separators '\' and '/' are supported.
Returns
0 on success, or a negative error code on failure.

◆ saveToPNG()

Sint32 CRM64Pro::Image::saveToPNG ( const string & sFile = "")

Save the image to an external PNG file.

If the PNG file already exists, it will be overwritten.

Parameters
sFilestring containing [directory]+filename+[extension]. Ideally should have .png extension. Directory separators '\' and '/' are supported.
Returns
0 on success, or a negative error code on failure.

◆ save() [1/2]

Sint32 CRM64Pro::Image::save ( const string & sFileCDC)

Save the image to a CDC file.

Parameters
sFileCDCstring containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported.
Returns
0 on success, or a negative error code on failure.
Note
If the image already exists, it will be overwritten. Cannot save child images.

◆ save() [2/2]

Sint32 CRM64Pro::Image::save ( Sint32 idCDC)

Save the image to a CDC file.

Parameters
idCDCCDC id.
Returns
0 on success, or a negative error code on failure.
Note
If the image already exists, it will be overwritten. If the image is a child, it calls the save method of its parent.

◆ info() [2/2]

Sint32 CRM64Pro::ImageMgr::info ( Sint32 iMode = 0)

Request Image Manager information.

Writes information to the default log.

Parameters
iMode-1 for Manager info only. 0 (default) for Manager and all Objects. A positive Image id for Manager and that specific Image.
Returns
0 on success, or a negative error code on failure.

◆ create()

Sint32 CRM64Pro::ImageMgr::create ( const string & sName,
Uint32 iVersion = 10 )

Creates a new image.

Creates an empty image (no source surface). Use Image::assignSurface() to assign the source surface.

Parameters
sNameThe image name (e.g. 'myImage'). Must be unique, max 64 characters (truncated if longer). Cannot start with '#'.
iVersionImage version. 10 means v1.0 (only version supported). Default v1.0.
Returns
greater than 0 on success (the Image id) or a negative error code on failure.
Note
Returns error if name already exists.

◆ close()

Sint32 CRM64Pro::ImageMgr::close ( Sint32 idImg)

Close and destroy an image.

This method can only close images belonging to the default owner (ImageMgr).

Parameters
idImg0 for closing all images, or specific Image id. Stand-alone and child images can be closed; parent images cannot while they have children.
Returns
0 on success, or a negative error code on failure.
Note
Unclosed images are automatically closed when the GDK terminates.

◆ getNum()

Sint32 CRM64Pro::ImageMgr::getNum ( ) const

Get number of loaded objects.

Returns
the number of images.

◆ setName()

Sint32 CRM64Pro::ImageMgr::setName ( Sint32 idImg,
const string & sName )

Change the object name.

Parameters
idImgImage id.
sNameThe image name (e.g. 'myImage'). Must be unique, max 64 characters (truncated if longer). Cannot start with '#'.
Returns
0 on success, or a negative error code on failure.

◆ closeEx()

Sint32 CRM64Pro::ImageMgr::closeEx ( Sint32 idImg,
Uint32 iOwner )

Close and destroy an image.

Can close images belonging to any owner, but owner must be provided as a security check.

Parameters
idImg0 for closing all images, or specific Image id. Stand-alone and child images can be closed; parent images cannot while they have children.
iOwnerOwner of the image.
Returns
0 on success, or a negative error code on failure.
Note
Unclosed images are automatically closed when the GDK terminates.

◆ get()

Image * CRM64Pro::ImageMgr::get ( Sint32 idImg)

Get a pointer to the image using its handler.

Parameters
idImgImage id.
Returns
nullptr the image was not found.
A pointer to the image object.

◆ duplicate()

Sint32 CRM64Pro::ImageMgr::duplicate ( Sint32 idImg,
const string & sName )

Duplicate an image creating a new, identical and independent one.

Parameters
idImgImage id to be duplicated.
sNameThe image name (e.g. 'myImage'). Must be unique, max 64 characters (truncated if longer). Cannot start with '#'.
Returns
greater than 0 on success (the Image id) or a negative error code on failure.
Note
Returns error if name already exists. New image is not optimized; call Image::optimize() if needed.

◆ child()

Sint32 CRM64Pro::ImageMgr::child ( Sint32 idImg)

Create a child image dependent on the provided one (the parent).

A child image uses the parent's source surface and textures but can have different attributes. Useful for saving memory.

Parameters
idImgparent Image id. If the provided image is a child, the request is redirected to its parent.
Returns
greater than 0 on success (the Image id) or a negative error code on failure.
Note
The child uses the parent's name.

◆ isBMP()

Sint32 CRM64Pro::ImageMgr::isBMP ( const string & sFile)

Check if the file is a BMP.

Parameters
sFilestring containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported.
Returns
0 on success (it is a BMP) or a negative error code on failure.

◆ isPNG()

Sint32 CRM64Pro::ImageMgr::isPNG ( const string & sFile)

Check if the file is a PNG.

Parameters
sFilestring containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported.
Returns
0 on success (it is a PNG) or a negative error code on failure.

◆ loadFromFile()

Sint32 CRM64Pro::ImageMgr::loadFromFile ( const string & sFile,
const string & sName = "" )

Load an image (BMP or PNG formats).

Parameters
sFilestring containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported.
sNamethe image object name. If empty (default), uses filename without extension. Must be unique, max 64 characters.
Returns
greater than 0 on success (the Image id) or a negative error code on failure.

◆ load() [1/3]

Sint32 CRM64Pro::ImageMgr::load ( const string & sFileCDC,
const string & sName )

Load an image stored in a CDC file.

Parameters
sFileCDCstring containing [directory]+filename+[extension]. Directory separators '\' and '/' are supported.
sNamestring with the image name (max 64 characters). If already exists, creates a child instead.
Returns
greater than 0 on success (the Image id) or a negative error code on failure.

◆ load() [2/3]

Sint32 CRM64Pro::ImageMgr::load ( const Sint32 idCDC,
const string & sName )

Load an image stored in a CDC file.

Parameters
idCDCCDC id.
sNamestring with the image name (max 64 characters). If already exists, creates a child instead.
Returns
greater than 0 on success (the Image id) or a negative error code on failure.

◆ load() [3/3]

Sint32 CRM64Pro::ImageMgr::load ( void * pBuffer,
Sint32 iSize,
const string & sName )

Load an image (BMP or PNG formats) stored on a memory buffer.

Parameters
pBufferbuffer pointer containing the BMP or PNG raw data.
iSizesize in bytes of the buffer.
sNamethe image object name. Must be unique, max 64 characters.
Returns
greater than 0 on success (the Image id) or a negative error code on failure.

◆ remove()

Sint32 CRM64Pro::ImageMgr::remove ( Sint32 idCDC,
const string & sName )

Remove an image stored in a CDC file.

Parameters
idCDCCDC id.
sNamestring with the image name (maximum size of 64 characters).
Returns
greater than 0 on success, or a negative error code on failure.
Note
The image must be closed before trying to remove it from the CDC.

◆ exist()

Sint32 CRM64Pro::ImageMgr::exist ( Sint32 idCDC,
const string & sName )

Check if an image is stored in a CDC file.

Parameters
idCDCCDC id.
sNamestring with the image name (maximum size of 64 characters).
Returns
0 on success(it exists) or a negative error code on failure (it does not exist).
Note
It is normally used for checking if an image is present without throwing any error.