|
|||
|
Hi,
You can use an ActiveX object to convert the other graphic than jpg to jpg. Here is one, http://www.sourceforge.net/projects/freeimage The new version of SWFKit that will come out in several days supports image conversion as well. But it's not as powful as the FreeImage object, it can only convert other graphic to jpg and doesn't support so many graphic formats. |
|
|||
|
It's very easy to invoke an ActiveX object in SWFKit.
Firstly, you should register the ActiveX object before you can use it, Code:
ActiveXObject.register('myObj.dll')
In the initialize script Code:
var fr = new ActiveXObject("frObj.frReportObj");
if (fr == undefined || fr.version == undefined || fr.version < 1.1)
{
var fr_file = getAdditionalFile('frObj.dll');
var f = new File(fr_file);
var sys_path = Shell.getSpecialFolder("system") + '\\' + f.name;
f.copy(sys_path);
ActiveXObject.register(sys_path);
fr = new ActiveXObject("frObj.frReportObj");
}
|
|
|||
|
Secondly, construct a new instance of the object.
For an Automation object, Code:
var obj = new ActiveXObject('obj.myobj');
Code:
var control = createControl('obj.myObj', 0, 0, 200, 200);
var obj = control.activex;
|
|
|||
|
You can also handle the events of the ActiveX Object
Code:
obj.onMyEvent = function (arg0, arg1, ..., argn)
{
//do something
}
Eg. The Microsoft WebBrowser object has an event, BeforeNavigate2(obj, url, flags, TargetFrameName, PostData, Headers, Cancel) 'Occurs when the WebBrowser control is about to navigate to a different URL, which may happen as a result of external automation, internal automation from a script, or the user clicking a link or typing in the address bar. The container has an opportunity to cancel the pending navigation. ' The last argument 'Cancel' is a boolean value, you can set it to TRUE to cancel the navigation operation, or to FALSE to allow it to proceed. But FFish script cannot transfer data back to the object by set the value of the argument directly. To make it work, SWFKit converts the argument to an object value automatically. |
|
|||
|
The converted object has a property 'value', contains the real value of the argument, you can set the value of the argument by change the property,
Code:
webb.BeforeNavigate2 = function (obj, url, flags, TargetFrameName, PostData, Headers, Cancel)
{
trace('go to the url ' + url);
//cancel the operation
Cancel.value = true;
}
|
|
|||
|
SWFKit converts the data types automatically for you. *
ActiveX Object FFish Script int, byte, float, double * * * * * * * * * * * * * * number string string date number, you can use 'new Date(num)' to get the datetime binary data StringStream IDispatch ActiveXObject object |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|