Resource – Giavapps Windows API

api_bitmap_add(FileName) Adds a .BMP file. The function returns the BitmapHandle or false if fails.

FileName: string that indicates a path to a specified file.

 

api_bitmap_delete(BitmapHandle) Deletes a bitmap and frees any memory the bitmap occupied. If the function succeeds, the return value is true, or false otherwise.

BitmapHandle: it must be a BitmapHandle.

 

api_cursor_add(FileName) Adds a .CUR file. The function returns the CursorHandle or false if fails.

FileName: string that indicates a path to a specified file.

 

api_cursor_delete(CursorHandle) Deletes a cursor and frees any memory the cursor occupied. If the function succeeds, the return value is true, or false otherwise.

CursorHandle: it must be a CursorHandle.

 

api_icon_add(FileName) Adds a .ICO file. The function returns the IconHandle or false if fails.

FileName: string that indicates a path to a specified file.

 

api_icon_delete(IconHandle) Deletes an icon and frees any memory the icon occupied. If the function succeeds, the return value is true, or false otherwise.

IconHandle: it must be an IconHandle.

 

api_font_add(Name, Size, Weight, Italic, Underline, StrikeOut) Adds a logical font with the specified characteristics. If the function succeeds, the return value is the FontHandle. If the function fails, the return value is false.

Name: string that specifies the typeface name of the font.
Size: size of the font.
Weight: weight of the font in the range 0 through 1000. If this value is zero, a default weight is used.
Italic: specifies an italic font if set to true.
Underline: specifies an underlined font if set to true.
StrikeOut: specifies a strikeout font if set to true.

The Weight argument can be one of the following values.

FW_DONTCARE 0

FW_THIN 100

FW_EXTRALIGHT 200

FW_ULTRALIGHT 200

FW_LIGHT 300

FW_NORMAL 400

FW_REGULAR 400

FW_MEDIUM 500

FW_SEMIBOLD 600

FW_DEMIBOLD 600

FW_BOLD 700

FW_EXTRABOLD 800

FW_ULTRABOLD 800

FW_HEAVY 900

FW_BLACK 900

 

api_font_delete(FontHandle) Deletes and frees the memory used by a logical font. If the function succeeds, the return value is true, or false otherwise

FontHandle: it must be a FontHandle.

 

api_imagelist_add(W, H, ImagesNumber) Adds a new image list. This function returns the ImageListHandle if successful, or false otherwise.

W: the width, in pixels, of each image.
H: the height, in pixels, of each image.
ImagesNumber: the number of images that the image list can contain.

 

api_imagelist_add_bitmap(ImageListHandle, BitmapHandle) Adds a bitmap image to an image list. This function returns the index of the first new image if successful, or -1 otherwise.

ImageListHandle: it must be an ImageListHandle.
BitmapHandle: it must be a BitmapHandle.

 

api_imagelist_add_icon(ImageListHandle, IconHandle) Adds an icon or cursor to an image list. This function returns the index of the new image if successful, or -1 otherwise.

ImageListHandle: it must be an ImageListHandle.
IconHandle: it must be an IconHandle.

 

api_imagelist_replace_icon(ImageListHandle, ImageIndex, IconHandle) Replaces an image with an icon or cursor. This function returns the index of the image if successful, or -1 otherwise.

ImageListHandle: it must be an ImageListHandle.
ImageIndex: The index of the image to replace. If ImageIndex is -1, the function appends the image to the end of the list and so this will work just like api_imagelist_add_icon() function.
IconHandle: it must be an IconHandle.

 

api_imagelist_get_width(ImageListHandle) Returns the the width, in pixels, of each image.

ImageListHandle: it must be an ImageListHandle.

 

api_imagelist_get_height(ImageListHandle) Returns the the height, in pixels, of each image.

ImageListHandle: it must be an ImageListHandle.

 

api_imagelist_get_count(ImageListHandle) Returns the number of images in an image list.

ImageListHandle: it must be an ImageListHandle.

 

api_imagelist_delete(ImageListHandle) Deletes an image list. This function returns true if successful, or false otherwise.

ImageListHandle: it must be an ImageListHandle.

 

Code Examples

 

Adding Resources

 

bitmap = api_bitmap_add("mybitmap.bmp");
cursor = api_cursor_add("mycursor.cur");
icon = api_icon_add("myicon.ico");
font = api_font_add("Times New Roman",12,0,1,0,0);
imagelist = api_imagelist_add(16,16,2);
api_imagelist_add_bitmap(imagelist,bitmap);
api_imagelist_add_icon(imagelist,icon);

 

Freeing Memory Occupied by Resources

 

api_bitmap_delete(bitmap);
api_cursor_delete(cursor);
api_icon_delete(icon);
api_font_delete(font);
api_imagelist_delete(imagelist);

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*