hi guru.
i am looking for help in the following problem, i have search through the d8xdk doc,
but only to get more confuse. anyone please give me some clue..
question : how to extract the data in the mediainfo structure retrieve by the getmedia
method.
the following is the code extract from the script xtra draccess window project sample
, comes with the d8_xdk.
which is inside the function :
MoaError CDrAccessScript_IMoaMmXScript::XCmm_SaveMedia(PMoaDrCallInfo callPtr)
in director i call this readmedia xtra child function and passing in a castmember name
that is a bitmap member. then i try to get the bitmap data and change it into Window
dib bitmap
format. (packed bitmap), so i can save the bmp or manipulate some pixel within the
image .
however, i don't know how to fill in the right parameter for an mediainfo structure
that is use to get image media, as well as how to extract the data in the return
mediainfo
structure after calling getmedia().
{
.....
.....
err = pObj->pDrCast->GetCastMem(castMemIndex, &pObj->pDrCastMem);
/* Get its media as #image , initial the mediainfo structure.*/
/* this is how the xdk document say if you want to get a bitmap image from
castmember.*/
pObj->pMmValue->StringToSymbol("Image", &mediaInfo.labelSymbol);
pObj->pMmValue->StringToSymbol("winDIB", &mediaInfo.formatSymbol);
/* i am not sure which constants to specify in the MoaDrmediaOpts parameter.
which should i use for getting an image for window ? .*/
(void) pObj->pDrUtils->NewMediaInfo(mediaInfo.labelSymbol, mediaInfo.formatSymbol,
NULL, kMoaDrImgMediaOpts_ImageDepthAndPal, NULL, &mediaInfo);
if (err == kMoaErr_NoErr)
{
err = pObj->pDrCastMem->GetMedia(&mediaInfo);
/* Release the source cast mem */
(void) pObj->pDrCastMem->Release();
pObj->pDrCastMem = NULL;
}
.....
.....
}
after getting the mediainfo , i try to cast it into :
LPBITMAPINFOHEADER lpbmi;
lpbmi = (LPBITMAPINFOHEADER)mediaInfo.mediaData;
but the data member is definitely wrong.
what is actually inside this mediaInfo.mediaData ? how can i extract a dib bitmap out
of it .
there is no explanation or sample in all the stuff come with d8_xdk. just some
confusing statement like
the mediaInfo.mediaData could be some HGLOBAL handler. or a moahandle or a windib data
structure.
some background infomation..
getmedia is a method of IMoaDrCastMem .
the prototype is:
GetMedia(PIMoaDrCastMem This , PMoaDrMediaInfo pMediaInfo )
the structure of PMoaDrMediaInfo is
MoaDrMediaInfo
{
MoaMmsymbol labelsymbol;
MoaMmsymbol formatsymbol;
pMoaVoid mediadata;
MoaDrMediaOpts option;
pMoaVoid aux;
pMoaVoid refcon;
}
Thank you very much.
kafka
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]