Kbase P131800: 4GL/ABL: How to create a Data Techniques ImageMan ActiveX Attributes object?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  23/05/2008 |
|
Status: Unverified
GOAL:
4GL/ABL: How to create a Data Techniques ImageMan ActiveX Attributes object?
GOAL:
How to invoke the ADD() method of the ImageMan ActiveX Attributes object?
GOAL:
How to invoke ImageMan Image Control object SaveAs() method with the Attributes Object optional parameter?
GOAL:
How to use the Attributes object with SaveAs() method of the Image Control object?
FACT(s) (Environment):
Windows
Progress 9.x
OpenEdge 10.x
OpenEdge Category: Language (4GL/ABL)
OpenEdge Language Category: ActiveX
FIX:
The following code sample demonstrates how to create an ImageMan ActiveX Attributes object, add attributes to it and use it to invoke the SaveAs() method of the Image Control object. It further demonstrates how to access the properties of an Attribute object:
DEFINE VARIABLE hAttributes AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE hAttribute AS COM-HANDLE NO-UNDO.
/* Create the Atrributes Collection Objcet */
CREATE "IMActX8.Attributes" hAttributes.
/* Assign the Image Control Picture property and invoke its REFRESH method */
chCtrlFrame:ImageControl:Picture = "c:\wrk91e\horses.bmp".
chCtrlFrame:ImageControl:Refresh ( ).
/* Assign the Image Control Overwrite property */
ASSIGN
chCtrlFrame:ImageControl:Overwrite = 2.
/* Invoke the Add() method of the ActiveX Attributes Collection Objcet */
hAttributes:ADD("EXTENSION", "TIF", 256). /* IMString = 256 */
hAttributes:ADD("COMPRESS", "ON", 256). /* IMString = 256 */
hAttributes:ADD("TIFF_COMPRESS", "GROUP4", 256). /* IMString = 256 */
hAttributes:ADD("TIFF_ROWSPERSTRIP", 10000, 16). /* IMInt32 = 16 */
hAttributes:ADD("TIFF_ARTIST", "AVIP", 256). /* IMString = 256 */
hAttributes:ADD("TIFF_XRES", 200, 16). /* IMInt32 = 16 */
hAttributes:ADD("TIFF_YRES", 200, 16). /* IMInt32 = 16 */
/* Invoke the SaveAs() method passing the Attributes Collection Objcet */
chCtrlFrame:ImageControl:SaveAs("", hAttributes) NO-ERROR.
/* Get a specific Atrribute Objcet */
ASSIGN
hAttribute = hAttributes:Item("EXTENSION").
/* Access the specific Atrribute Objcet properties */
MESSAGE
hAttribute:flags "~n"
hAttribute:isloaded "~n"
hAttribute:NAME "~n"
hAttribute:SIZE "~n"
hAttribute:TYPE "~n"
hAttribute:VALUE
VIEW-AS ALERT-BOX INFO BUTTONS OK.