Main Page | Class Hierarchy | Alphabetical List | Compound List | Compound Members

# IRdBitmapDisp Struct Reference

Inherits IDispatch.

List of all members.

## Public Member Functions
HRESULT | Clear (void)
HRESULT | Create ([in] RtDWORD nWidth,[in] RtDWORD nHeight,[in] RtPixelFormat PixelFormat)
HRESULT | CreateEx ([in] RtDWORD nWidth,[in] RtDWORD nHeight,[in] BSTR bsFormat)
HRESULT | ConvertFormat ([in] RtPixelFormat pFormat)
HRESULT | GetHeader ([out] RtDWORD *pdwWidth,[out] RtDWORD *pdwHeight,[out] RtPixelFormat *pFormat)
HRESULT | GetFormatDesc ([out] RtPixelFormatDesc *pDesc)
HRESULT | GetSizeX ([out, retval] RtDWORD *pOut)
HRESULT | GetSizeY ([out, retval] RtDWORD *pOut)
HRESULT | GetFormatString ([out, retval] BSTR *pOut)
HRESULT | GetFormat ([out, retval] RtPixelFormat *pOut)
HRESULT | GetFormatNumberFromString ([in] BSTR bsFormat,[out, retval] RtPixelFormat *pOut)
HRESULT | GetFormatStringFromNumber ([in] RtPixelFormat Format,[out, retval] BSTR *pOut)
HRESULT | GetPixel ([in] RtDWORD dwPositionX,[in] RtDWORD dwPositionY,[in] IRdColor *pOutValue)
HRESULT | SetPixel ([in] RtDWORD dwPositionX,[in] RtDWORD dwPositionY,[in] IRdColor *pInValue)
HRESULT | GetPixelCOLORREF ([in] RtDWORD dwPositionX,[in] RtDWORD dwPositionY,[in] COLORREF *pOutValue)
HRESULT | GetPixelBuffer ([in] RtFlags dwFlags,[out] void **pBuffer)
HRESULT | CommitPixelBuffer ([in] void *pBuffer)
HRESULT | LockBitmap ()
HRESULT | UnlockBitmap ()
HRESULT | CreateDDBitmap ([in] HDC hDC,[out, retval] HBITMAP *pHBitmap)
HRESULT | CreateDDBitmapResized ([in] HDC hDC,[in] int sizeX,[in] int sizeY,[out, retval] HBITMAP *pHBitmap)
HRESULT | LoadFromFile ([in] BSTR FileName)
HRESULT | GetFileName ([out, retval] BSTR *pFileName)
HRESULT | SetIsFromFile ([in] RtBool bIsFromFile,[in] BSTR bstrFileName)
HRESULT | SetHBitmap ([in] HBITMAP hBitmap)
HRESULT | SaveToFile ([in] RtBitmapFileFormat Format,[in] BSTR FileName)
HRESULT | Resize ([in] RtDWORD dwWidth,[in] RtDWORD dwHeight)
HRESULT | SetAdvancedFeature ([in] GUID FeatureID,[in] DWORD FeatureModifier,[in] VARIANT FeatureData)
HRESULT | GetAdvancedFeature ([in] GUID FeatureID,[out] DWORD *FeatureModifier,[out] VARIANT *FeatureData)
HRESULT | IsAdvancedFeatureSupported ([in] GUID FeatureID)
HRESULT | GetSupportedFormatCount ([out, retval] DWORD *dwFormatCount)
HRESULT | GetSupportedFormat ([in] DWORD dwFormat,[out] BSTR *bsMasks,[out] BSTR *bsFormatName)
HRESULT | IsEqual ([in] IRdBitmap *pBitmap,[out, retval] BOOL *bEqualityResult)
HRESULT | ImageSizeFromFile ([in]BSTR FileName,[out] DWORD *width,[out] DWORD *height)
HRESULT | GetDownsampledFlag ([out, retval] RtBool *pVal)
HRESULT | SetDownsampledFlag ([in] RtBool newVal)

## Detailed Description

Specifies dispatch (scriptable) version of the IRdBitmap interface.

Warning:
  this bitmap has to be exact mirror of IRbBitmap interface.

## Member Function Documentation

HRESULT IRdBitmapDisp::Clear | ( | void |  | ) |

| Clear all data in the bitmap. Create has to be called to use the bitmap

HRESULT IRdBitmapDisp::Create | ( | [in] RtDWORD | nWidth,
|  | [in] RtDWORD | nHeight,
|  | [in] RtPixelFormat | PixelFormat
| ) |

  | Creates the internal buffers of the bitmap and prepares the bitmap for the use. Parameters:
  nWidth | specifies desired width of the bitmap.
  nHeight | specifies height of the bitmap.
  PixelFormat | specifies the pixel format of the bitmap.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_INVALIDARG | for invalid dimensions or format
  E_OUTOFMEMORY | if bitmap does not fit into the memory

HRESULT IRdBitmapDisp::CreateEx | ( | [in] RtDWORD | nWidth,
|  | [in] RtDWORD | nHeight,
|  | [in] BSTR | bsFormat
| ) |

  | Creates the internal buffers of the bitmap and prepares the bitmap for the use. Parameters:
  nWidth | specifies desired width of the bitmap.
  nHeight | specifies height of the bitmap.
  bsFormat | specifies the pixel format of the bitmap in string form.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_INVALIDARG | for invalid dimensions or format
  E_OUTOFMEMORY | if bitmap does not fit into the memory

HRESULT IRdBitmapDisp::ConvertFormat | ( | [in] RtPixelFormat | pFormat | ) |

  | Convert bitmap from one format to another. Parameters:
  pFormat | specifies the new format of the bitmap.
  Return values:
  E_FAIL | is returned if bitmap is empty
  E_INVALIDARG | is returned if new format type is not valid
  E_OUTOFMEMORY | is returned if new bitmap does not fit into the memory
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::GetHeader | ( | [out] RtDWORD * | pdwWidth,
|  | [out] RtDWORD * | pdwHeight,
|  | [out] RtPixelFormat * | pFormat
| ) |

  | Return the header information of the bitmap. Parameters:
  pdwWidth | is filled with the width of the bitmap. Specify NULL if you do not require this information.
  pdwHeight | is filled with the height of the bitmap. Specify NULL if you do not require this information.
  pFormat | is filled with the format of the bitmap. Specify NULL if you do not require this information.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::GetFormatDesc | ( | [out] RtPixelFormatDesc * | pDesc | ) |

  | Return the pixel format description. Parameters:
  pDesc | is filled with the format description of the bitmap.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::GetSizeX | ( | [out, retval] RtDWORD * | pOut | ) |

  | Get the horizontal size. Parameters:
  pOut | is filled with the horizontal size of the bitmap.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::GetSizeY | ( | [out, retval] RtDWORD * | pOut | ) |

  | Get the vertical size Parameters:
  pOut | is filled with the vertical size of the bitmap.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::GetFormatString | ( | [out, retval] BSTR * | pOut | ) |

  | Get the pixel format in a string Parameters:
  pOut | is filled with the format of the bitmap in a string descriptor for usage in scripts.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::GetFormat | ( | [out, retval] RtPixelFormat * | pOut | ) |

  | Get the pixel format Parameters:
  pOut | is filled with the format of the bitmap.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::GetFormatNumberFromString | ( | [in] BSTR | bsFormat,
|  | [out, retval] RtPixelFormat * | pOut
| ) |

  | Convert string format to the enumeration number Parameters:
  bsFormat | specifies the pixel format in the string.
  pOut | is filled with the format of the bitmap that can be used in Create method.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_INVALIDARG | is returned for invalid format.

HRESULT IRdBitmapDisp::GetFormatStringFromNumber | ( | [in] RtPixelFormat | Format,
|  | [out, retval] BSTR * | pOut
| ) |

  | Get the pixel format string from a number. Parameters:
  Format | specifies the pixel format in a number form.
  pOut | is filled with the format of the bitmap in the string form.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_INVALIDARG | is returned for invalid format.

HRESULT IRdBitmapDisp::GetPixel | ( | [in] RtDWORD | dwPositionX,
|  | [in] RtDWORD | dwPositionY,
|  | [in] IRdColor * | pOutValue
| ) |

  | Return pixel color at given position. Parameters:
  dwPositionX | specifies the horizontal position of a pixel
  dwPositionY | specifies the vertical position of a pixel
  pOutValue | passed Color object is filled with color.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_INVALIDARG | is returned for position out of bounds.
  E_FAIL | is returned also for unknown format and when lock failed.

HRESULT IRdBitmapDisp::SetPixel | ( | [in] RtDWORD | dwPositionX,
|  | [in] RtDWORD | dwPositionY,
|  | [in] IRdColor * | pInValue
| ) |

  | Set pixel color at given position Parameters:
  dwPositionX | specifies the horizontal position of a pixel
  dwPositionY | specifies the vertical position of a pixel
  pInValue | specifies new color of the pixel.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_INVALIDARG | is returned for position out of bounds.
  E_FAIL | is returned also for unknown format and when lock failed.

HRESULT IRdBitmapDisp::GetPixelCOLORREF | ( | [in] RtDWORD | dwPositionX,
|  | [in] RtDWORD | dwPositionY,
|  | [in] COLORREF * | pOutValue
| ) |

  | Return pixel at given position in the COLORREF format. Parameters:
  dwPositionX | specifies the horizontal position of a pixel
  dwPositionY | specifies the vertical position of a pixel
  pOutValue | passed Color object is filled with color.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_INVALIDARG | is returned for position out of bounds.
  E_FAIL | is returned also for unknown format and when lock failed.

HRESULT IRdBitmapDisp::GetPixelBuffer | ( | [in] RtFlags | dwFlags,
|  | [out] void ** | pBuffer
| ) |

  | This method returns pointer to the pixel buffer of the bitmap. Caller cannot modify contents of the buffer if he does not specify BFLG_WILLOVERWRITE in a flag. Caller has to return the buffer to the bitmap using CommitPixelBuffer. Buffer alignment is top-left to bottom - this means that top-left pixel is considered to be [0][0] and therefore is at the buffer start Use CRsBitmapBufLock for safe pairing of locks and unlocks. Parameters:
  dwFlags | specifies the flags of the lock - can be any combination of RtBitmapBufferFlags members.
  pBuffer | is filled with the pointer to the data buffer.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_FAIL | is returned for uninitialized bitmap or when lock is not possible.

HRESULT IRdBitmapDisp::CommitPixelBuffer | ( | [in] void * | pBuffer | ) |

  | This method returns the locked buffer back to bitmap. Buffer pointer becomes invalid. Use CRsBitmapBufLock for safe pairing of locks and unlocks. Parameters:
  pBuffer | specifies the buffer returned by GetPixelBuffer.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_FAIL | is returned for uninitialized/unlocked bitmap or when unlock is not possible.

HRESULT IRdBitmapDisp::LockBitmap | ( |  | ) |

| Lock the bitmap - access to methods from other threads will not be possible until UnlockBitmap is called. Warning: Use CRsBitmapLock from Utils for safe lock and unlock Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::UnlockBitmap | ( |  | ) |

| Unlock the bitmap after previous call to LockBitmap. Warning: Use CRsBitmapLock from Utils for safe lock and unlock Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::CreateDDBitmap | ( | [in] HDC | hDC,
|  | [out, retval] HBITMAP * | pHBitmap
| ) |

  | This method creates device depended bitmap (DDB) and fills it with color data. Parameters:
  hDC | specifies the device context
  pHBitmap | is filled with new DDB.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::CreateDDBitmapResized | ( | [in] HDC | hDC,
|  | [in] int | sizeX,
|  | [in] int | sizeY,
|  | [out, retval] HBITMAP * | pHBitmap
| ) |

  | This method creates device depended bitmap (DDB) of given size and fills it with color data. Parameters:
  hDC | specifies the device context
  sizeX | specifies desired width of the bitmap
  sizeY | specifies desired height of the bitmap
  pHBitmap | is filled with new DDB.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::LoadFromFile | ( | [in] BSTR | FileName | ) |

  | This method is used to load image from a file. Previous bitmap contents are discarded. Parameters:
  FileName | specifies the file name (including optional path) for load.
Returns: Standard HRESULT processing can be applied to the result. E_INVALIDARG for unsupported format.

HRESULT IRdBitmapDisp::GetFileName | ( | [out, retval] BSTR * | pFileName | ) |

  | Get filename of the bitmap if it was loaded from file. Parameters:
  pFileName | is filled with the name of the file.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  S_OK | if file was loaded from file
  S_FALSE | if file was not loaded from file.

HRESULT IRdBitmapDisp::SetIsFromFile | ( | [in] RtBool | bIsFromFile,
|  | [in] BSTR | bstrFileName
| ) |

  | Set IsFromFile flag and filename of the bitmap (usefull when you modified the bitmap but still want to keep track of origin filename) Parameters:
  bIsFromFile | specifies if bitmap was loaded from file (TRUE) or not (FALSE)
  bstrFileName | specifies the filename of the bitmap.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::SetHBitmap | ( | [in] HBITMAP | hBitmap | ) |

  | This method is used to load image from a HBITMAP handle. Previous bitmap contents are discarded. Parameters:
  hBitmap | specifies the valid bitmap handle used as a source for data.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::SaveToFile | ( | [in] RtBitmapFileFormat | Format,
|  | [in] BSTR | FileName
| ) |

  | This method is used to save image to a file. Parameters:
  Format | specifies the format of a bitmap.
  FileName | specifies the target filename of a bitmap.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::Resize | ( | [in] RtDWORD | dwWidth,
|  | [in] RtDWORD | dwHeight
| ) |

  | This method is used to resize the bitmap. Parameters:
  dwWidth | specifies new width of the bitmap.
  dwHeight | specifies new height of the bitmap.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::SetAdvancedFeature | ( | [in] GUID | FeatureID,
|  | [in] DWORD | FeatureModifier,
|  | [in] VARIANT | FeatureData
| ) |

  | This method sets properties of extensible advanced features of the bitmap This provides extensible mechanism for features. Implementation should return E_NOTIMPL for unsupported feature. FeatureID specifies the ID of the feature. FeatureModifier specifies feature specific modifier to use. FeatureData specifies feature specific data to use. Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_NOTIMPL | is returned for unsupported FeatureID.

HRESULT IRdBitmapDisp::GetAdvancedFeature | ( | [in] GUID | FeatureID,
|  | [out] DWORD * | FeatureModifier,
|  | [out] VARIANT * | FeatureData
| ) |

  | This method gets properties of extensible advanced features of the bitmap. This provides extensible mechanism for features. Implementation should return E_NOTIMPL for unsupported feature FeatureID specifies the ID of the feature. FeatureModifier is filled with feature specific modifier. FeatureData is filled with feature specific data. Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_NOTIMPL | is returned for unsupported FeatureID.

HRESULT IRdBitmapDisp::IsAdvancedFeatureSupported | ( | [in] GUID | FeatureID | ) |

  | This method can be used to determine if advanced feature is supported for bitmap S_OK is returned for supported feature, S_FALSE for unsupported feature, No other success codes are allowed and error codes are reserved for method failure. FeatureID specifies the ID of the feature. Returns: Standard HRESULT processing can be applied to the result. Return values:
  S_OK | is returned for supported feature.
  S_FALSE | is returned for unsupported feature.

HRESULT IRdBitmapDisp::GetSupportedFormatCount | ( | [out, retval] DWORD * | dwFormatCount | ) |

  | Return the number of supported loadable formats for enumeration through GetSupportedFormat Parameters:
  dwFormatCount | is filled with number of loadable formats.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::GetSupportedFormat | ( | [in] DWORD | dwFormat,
|  | [out] BSTR * | bsMasks,
|  | [out] BSTR * | bsFormatName
| ) |

  | Return the information about supported format Parameters:
  dwFormat | specifies the format index.
  bsMasks | is filled with the possible file masks separated by ; (i.e. *.gif or *.jpg;*.jpeg)
  bsFormatName | is filled with the name of the format
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  E_INVALIDARG | is returned for invalid index.

HRESULT IRdBitmapDisp::IsEqual | ( | [in] IRdBitmap * | pBitmap,
|  | [out, retval] BOOL * | bEqualityResult
| ) |

  | Checks bitmap for equality with other bitmap. Return S_OK if bitmaps are equal and return S_FALSE if they are not equal. Parameters:
  pBitmap | specifies the other bitmap in the test.
  bEqualityResult | Optional BOOL parameter is provided for script usage - if not NULL it is filled with TRUE for equal bitmaps and FALSE for unequal.
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  S_OK | for equal bitmaps.
  S_FALSE | for non equal bitmaps.
  E_XXX | error code should be also considered as non-equality result.

HRESULT IRdBitmapDisp::ImageSizeFromFile | ( | [in] BSTR | FileName,
|  | [out] DWORD * | width,
|  | [out] DWORD * | height
| ) |

  | Return Width and Height of the file on disk (if supported) Parameters:
  FileName | specifies the name (and path) of a file to return size
  width | is filled with the width of the bitmap in file
  height | is filled with the height of the bitmap in file
  Returns: Standard HRESULT processing can be applied to the result. Return values:
  S_OK | if image file was found and size was returned.

HRESULT IRdBitmapDisp::GetDownsampledFlag | ( | [out, retval] RtBool * | pVal | ) |

  | Get downsampled flag Parameters:
  pVal | is filled with true if texture has been downsampled after load from file.
Returns: Standard HRESULT processing can be applied to the result.

HRESULT IRdBitmapDisp::SetDownsampledFlag | ( | [in] RtBool | newVal | ) |

  | Set downsampled flag. Parameters:
  newVal | specifies the value of downsampling.
Returns: Standard HRESULT processing can be applied to the result.