CwGetBitmapInfo

Syntax:

call CwGetBitmapInfo path, stem

        ("stem" is the name of a stem variable in which the results are
         stored.  There are 2 fields of the stem that are set.)

        path            (string) The path to the bitmap file.

        stem.width      (numeric) The actual width (in pixels) of the
                        bitmap as stored in the file.

        stem.height     (numeric) The actual height (in pixels) of the
                        bitmap as stored in the file.

Description:

This function returns information about a bitmap. The bitmap is identified by its filename. However, it must be loaded into memory for this function to work. Thus, the ideal way to obtain a bitmap name is to extract the "Image" property of an existing bitmap object.

Example:

/* Restore a bitmap to its correct aspect ratio.*/
bm = CwGetSelectedObject()
t = CwGetProperty(bm, "tool type")

if t \= "Bitmap" then do
        say "Must select a bitmap."
        exit
        end

bt = CwGetTool(bm)
bmp = CwGetProperty(bt,"image")

call CwGetBitmapInfo bmp, 'bminfo'
r = bminfo.width / bminfo.height

call CwGetPosition bm, bmdim
nheight = bmdim.width/r
call CwSetPosition bm, bmdim.x, bmdim.y, bmdim.width, ,
        nheight, bmdim.rotation, bmdim.xshear


Functions by NAME

Index

Functions by PURPOSE