这篇教程C++ HLock函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中HLock函数的典型用法代码示例。如果您正苦于以下问题:C++ HLock函数的具体用法?C++ HLock怎么用?C++ HLock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了HLock函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: DrawImagevoid DrawImage( void ){ OSErr err = noErr; Handle hOpenTypeList = NewHandle(0); long numTypes = 0; FSSpec theFSSpec; Rect bounds; GraphicsImportComponent importer = 0; BuildGraphicsImporterValidFileTypes( hOpenTypeList, &numTypes ); HLock( hOpenTypeList ); err = GetOneFileWithPreview(numTypes, (OSTypePtr)*hOpenTypeList, &theFSSpec, NULL); DisposeHandle( hOpenTypeList ); if ( err ) return; // locate and open a graphics importer component which can be used to draw the // selected file. If a suitable importer is not found the ComponentInstance // is set to NULL. err = GetGraphicsImporterForFile( &theFSSpec, // specifies the file to be drawn &importer ); // pointer to the returned GraphicsImporterComponent // get the native size of the image associated with the importer err = GraphicsImportGetNaturalBounds( importer, // importer instance &bounds ); // returned bounds OffsetRect( &bounds, 10, 45 ); window = NewCWindow( NULL, &bounds, "/pDraw Image", true, documentProc, (WindowPtr)-1, true, 0); // set the graphics port for drawing err = GraphicsImportSetGWorld( importer, // importer instance GetWindowPort( window ), // destination graphics port or GWorld NULL ); // destination GDevice, set to NULL uses GWorlds device // draw the image err = GraphicsImportDraw( importer ); // close the importer instance CloseComponent( importer );}
开发者ID:fruitsamples,项目名称:ImproveYourImage,代码行数:40,
示例2: P0P0(PUBLIC pascal trap, LONGINT, UnloadScrap){ OSErr retval; INTEGER f; LONGINT l = Cx(ScrapSize); if (Cx(ScrapState) > 0) { retval = cropen(&f); if (retval != noErr)/*-->*/ return(retval); HLock(MR(ScrapHandle)); retval = FSWriteAll(f, &l, STARH(MR(ScrapHandle))); HUnlock(MR(ScrapHandle)); if (retval != noErr)/*-->*/ return(retval); retval = FSClose(f); if (retval != noErr)/*-->*/ return(retval); ScrapState = 0; } return noErr;}
开发者ID:LarBob,项目名称:executor,代码行数:22,
示例3: CurResFile//_______________________________________________________________________________OSErr WriteRsrc (Handle rsrc, ResType type, short ID, short resFile){ OSErr err; Handle h; short saved; saved = CurResFile(); UseResFile( resFile); if ((err= ResError())!=noErr) return err; h= GetResource (type, ID); if (h) RemoveResource (h); HLock (rsrc); AddResource( rsrc, type, ID, "/p"); err= ResError(); if( err== noErr) { UpdateResFile( resFile); err= ResError(); } HUnlock( rsrc); UseResFile( saved); return err;}
开发者ID:AntonLanghoff,项目名称:whitecatlib,代码行数:23,
|