GSDP:GAM100/CProcessing/CP Image GetHeight()

From Inside
Jump to: navigation, search

CP_Image_GetHeight()

Description

Get the height in pixels of a given CP_Image

Function Definition

int CP_Image_GetHeight(CP_Image image);

Parameters

  • image- (CP_Image) The image that you want to know the height of

Return

  • int- The height of the image in pixels

Example

CP_Image justinFace = NULL;

void init()
{
  justinFace = CP_Image_Load("./Assets/Justins_face.png");
}

void update()
{
  CP_Settings_Background(CP_Color_Create(255, 255, 255, 255));

  int height = CP_Image_GetHeight(justinFace);

  int windowWidth = CP_System_GetWindowWidth();
  int windowHeight = CP_System_GetWindowHeight();

  CP_Image_Draw(justinFace, windowWidth / 2, windowHeight / 2, windowWidth / 2, windowHeight / 2, 255);
}

void shutdown()
{
  CP_Image_Free(justinFace);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>