GetImageByID

Alex Tweedly alex at tweedly.net
Thu Jun 30 21:16:45 EDT 2005


Derek Bump wrote:

> Having a little trouble with external writing.  For some odd reason I 
> can't get the imageData of an image by it's ID, the compiler always 
> fails.
>
>   GetVariableEx(args[0], emp, &image, &retvalue);
>   // This one works because it's getting the imageData from a variable
>
>   image = GetImageByID("", args[0], &retvalue);
>   // Results in an error.  "Incompatable Types in Assignment"
>
Is "image" properly declared ?  i.e as
MCString *image

(I know the example says that it should be a char * - but I don't 
believe that !!  Since the image can contain binary data and hence can 
contain null bytes, I reckon it must be a MCstring* - but I don't 
currently have access to a complete directory of the externals package, 
so I can't check.)

Might be better to send the whole file of your external code, rather 
than just such small fragments.

>
> I'm also trying to get the image's width and Height, and have the 
> following results...
>
>   width = atoi(args[1]);
>   // Works because the image width is Argument #2
>
>   width = EvalExpr("the width of img 1", &retValue);
>   // Gives a bunch of errors regarding "&retValue"
>
Ummmm  - again bigger fragment ....
What errors ?   (btw - note that  this &retValue is an int* - unlike the 
retval for your functions, which are char * )



-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.2/29 - Release Date: 27/06/2005




More information about the use-livecode mailing list