當前位置: 首頁>>代碼示例>>C++>>正文


C++ Dispose函數代碼示例

本文整理匯總了C++中Dispose函數的典型用法代碼示例。如果您正苦於以下問題:C++ Dispose函數的具體用法?C++ Dispose怎麽用?C++ Dispose使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Dispose函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: Dispose

		TextureCollection::~TextureCollection()
		{
			Dispose(false);
		}
開發者ID:respu,項目名稱:XFXFramework,代碼行數:4,代碼來源:TextureCollection.cpp

示例2: Dispose

CDVDOverlayCodecFFmpeg::~CDVDOverlayCodecFFmpeg()
{
  Dispose();
}
開發者ID:A600,項目名稱:xbmc,代碼行數:4,代碼來源:DVDOverlayCodecFFmpeg.cpp

示例3: Dispose

CDVDVideoCodecOpenMax::~CDVDVideoCodecOpenMax()
{
  Dispose();
}
開發者ID:Anankin,項目名稱:xbmc,代碼行數:4,代碼來源:DVDVideoCodecOpenMax.cpp

示例4: Dispose

CDVDDemuxPVRClient::~CDVDDemuxPVRClient()
{
  Dispose();
}
開發者ID:margro,項目名稱:xbmc-antiquated,代碼行數:4,代碼來源:DVDDemuxPVRClient.cpp

示例5: Dispose

void Game_Map::Quit() {
	Dispose();
	interpreter.reset();
}
開發者ID:cheerjo,項目名稱:Player,代碼行數:4,代碼來源:game_map.cpp

示例6: Dispose

KinectThread::~KinectThread() {
  Dispose();
}
開發者ID:otaviog,項目名稱:UdToolkit,代碼行數:3,代碼來源:kinectthread.cpp

示例7: Dispose

Mover_c::~Mover_c()
{
	Dispose ();
}
開發者ID:JamesMakela-NOAA,項目名稱:PyGnome,代碼行數:4,代碼來源:Mover_c.cpp

示例8: Dispose

UserTable::~UserTable()
{
  Dispose();
}
開發者ID:danfruehauf,項目名稱:incron,代碼行數:4,代碼來源:usertable.cpp

示例9: HDumpGraf

/* EXPORT->HDumpGraf: dump a BMP image of current display into fname */
void HDumpGraf(char *fname)
{
   BITMAPFILEHEADER FileHeader;
   BITMAPINFOHEADER BitmapHeader;
   BITMAPINFO *Info;
   int ColorTableSize;
   int ImageSize;
   FILE *fp;
   char *img;
   HDC dc = GetDC(theWindow);
   HBITMAP temp = CreateCompatibleBitmap(memDC,1,1);
     
   SelectObject(memDC,temp);
     
   /* retrieve information about the bitmap */
   BitmapHeader.biSize = sizeof(BITMAPINFOHEADER);
   BitmapHeader.biBitCount = 0;
   GetDIBits(memDC,theBitmap,0,0,NULL,&BitmapHeader,BI_RGB);
     
   switch (BitmapHeader.biCompression) {
   case BI_RGB:
      if (BitmapHeader.biBitCount > 8) {
         ColorTableSize = 0;
      }
      else {
         ColorTableSize = BitmapHeader.biClrUsed*sizeof(RGBQUAD);
      }
      break;
   case BI_RLE8:
   case BI_RLE4:
      ColorTableSize = BitmapHeader.biClrUsed*sizeof(RGBQUAD); 
      break;
   case BI_BITFIELDS:
      ColorTableSize = 3*sizeof(DWORD);
   }
     
   Info = (BITMAPINFO *) New(&gcheap,sizeof(BITMAPINFOHEADER) + ColorTableSize);
   memcpy(Info,&BitmapHeader,sizeof(BITMAPINFOHEADER));
     
   ImageSize = BitmapHeader.biSizeImage;
   img = New(&gcheap,ImageSize);
     
   GetDIBits(memDC,theBitmap,0,ClientRect.bottom,img,Info,BI_RGB);
     
   FileHeader.bfType = 0x4d42;  /* 'BM' */
   FileHeader.bfSize = sizeof(BITMAPINFOHEADER) + sizeof(BITMAPFILEHEADER) + 
      ImageSize + ColorTableSize;
   FileHeader.bfReserved1 = FileHeader.bfReserved2 = 0;
   FileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + ColorTableSize; 
     
   fp = fopen(fname,"wb");
   fwrite(&FileHeader,1,sizeof(BITMAPFILEHEADER),fp);
   fwrite(Info,1,sizeof(BITMAPINFOHEADER) + ColorTableSize,fp);
   fwrite(img,1,ImageSize,fp);
   fclose(fp);

   SelectObject(memDC,theBitmap);
   DeleteObject(temp);
   Dispose(&gcheap,Info);
   Dispose(&gcheap,img);
}
開發者ID:botonchou,項目名稱:AlgoFinal,代碼行數:62,代碼來源:HGraf_WIN32.c

示例10: HDrawImage

/* EXPORT->HDrawImage: draw grey scale image stored in p */
void HDrawImage(unsigned char *p, int x, int y, int width, int height)
{
   HDC tdc = GetDC(theWindow);
   HDC dc = CreateCompatibleDC(memDC);
   HBITMAP bm = CreateCompatibleBitmap(tdc,width,height);
   HGDIOBJ OldObject;

   char *data = New(&gcheap,sizeof(BITMAPINFOHEADER) + 
                    sizeof(RGBQUAD)*MAX_GREYS);
   BITMAPINFOHEADER *BitmapHeader = (BITMAPINFOHEADER *) data;
   RGBQUAD *ColorTable = (RGBQUAD *) (data + sizeof(BITMAPINFOHEADER));
   BITMAPINFO *Info = (BITMAPINFO *) data;

   int i,j;

   /* if the length of the scan line is not a */
   /* multiple of four, the bitmap must be reshaped. */
   /* SetDIBits() expects scan lines to start on word boundaries. */

   int ScanLineLen = 4*(1+(width-1)/4);  
   unsigned char *reshaped = NULL;       

   BitmapHeader->biSize = sizeof(BITMAPINFOHEADER);
   BitmapHeader->biWidth = width;
   BitmapHeader->biHeight = -height;
   BitmapHeader->biPlanes = 1;
   BitmapHeader->biBitCount = 8;
   BitmapHeader->biCompression = 0;
   BitmapHeader->biSizeImage = 0;
   BitmapHeader->biXPelsPerMeter = 0;
   BitmapHeader->biYPelsPerMeter = 0;
   BitmapHeader->biClrUsed = MAX_GREYS;
   BitmapHeader->biClrImportant = MAX_GREYS;
   for (i=0;i<MAX_GREYS;i++) {
      ColorTable[i].rgbRed =
         ColorTable[i].rgbBlue =
         ColorTable[i].rgbGreen = greys[i];
      ColorTable[i].rgbReserved = 0;
   }

   if (ScanLineLen != width) {
      reshaped = (unsigned char *) New(&gcheap,height*ScanLineLen);
      for (i=0;i<height;i++) {
         for (j=0;j<width;j++) {
            reshaped[i*ScanLineLen+j] = p[i*width+j];
         }
      }
      SetDIBits(memDC,bm,0,height,reshaped,Info,DIB_RGB_COLORS);
      Dispose(&gcheap,reshaped);
   }
   else {
      SetDIBits(memDC,bm,0,height,p,Info,DIB_RGB_COLORS);
   }

   OldObject = SelectObject(dc,bm);
   BitBlt(memDC,x,y,width,height,dc,0,0,SRCCOPY);
   if (WritingToMeta) { /* bitmap source location differs */
      BitBlt(tdc,x,y,width,height,dc,x,y,SRCCOPY);
   }
   else {
      BitBlt(tdc,x,y,width,height,dc,0,0,SRCCOPY);
   }

   DeleteDC(dc);
   DeleteObject(bm);
   ReleaseDC(theWindow,tdc);
   Dispose(&gcheap,data);
}
開發者ID:botonchou,項目名稱:AlgoFinal,代碼行數:69,代碼來源:HGraf_WIN32.c

示例11: Dispose

CDVDVideoCodecMFC::~CDVDVideoCodecMFC() {

  Dispose();

}
開發者ID:bkrepo,項目名稱:xbmc,代碼行數:5,代碼來源:DVDVideoCodecMFC.cpp

示例12: Dispose

void CDVDDemuxShoutcast::Reset()
{
    CDVDInputStream* pInputStream = m_pInput;
    Dispose();
    Open(pInputStream);
}
開發者ID:nikkpap,項目名稱:SPMC,代碼行數:6,代碼來源:DVDDemuxShoutcast.cpp

示例13: Dispose

CDVDDemuxFFmpeg::~CDVDDemuxFFmpeg()
{
  Dispose();
  DeleteCriticalSection(&m_critSection);
}
開發者ID:Avoidnf8,項目名稱:xbmc-fork,代碼行數:5,代碼來源:DVDDemuxFFmpeg.cpp

示例14: if

bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput)
{
  AVInputFormat* iformat = NULL;
  std::string strFile;
  m_iCurrentPts = DVD_NOPTS_VALUE;
  m_speed = DVD_PLAYSPEED_NORMAL;

  if (!pInput) return false;

  if (!m_dllAvUtil.Load() || !m_dllAvCodec.Load() || !m_dllAvFormat.Load())  {
    CLog::Log(LOGERROR,"CDVDDemuxFFmpeg::Open - failed to load ffmpeg libraries");
    return false;
  }

  // register codecs
  m_dllAvFormat.av_register_all();
  m_dllAvFormat.url_set_interrupt_cb(interrupt_cb);

  // could be used for interupting ffmpeg while opening a file (eg internet streams)
  // url_set_interrupt_cb(NULL);

  m_pInput = pInput;
  strFile = m_pInput->GetFileName();

  bool streaminfo = true; /* set to true if we want to look for streams before playback*/

  if( m_pInput->GetContent().length() > 0 )
  {
    std::string content = m_pInput->GetContent();

    /* check if we can get a hint from content */
    if( content.compare("audio/aacp") == 0 )
      iformat = m_dllAvFormat.av_find_input_format("aac");
    else if( content.compare("audio/aac") == 0 )
      iformat = m_dllAvFormat.av_find_input_format("aac");
    else if( content.compare("audio/mpeg") == 0  )  
      iformat = m_dllAvFormat.av_find_input_format("mp3");
    else if( content.compare("video/mpeg") == 0 )
      iformat = m_dllAvFormat.av_find_input_format("mpeg");
    else if( content.compare("video/flv") == 0 )
      iformat = m_dllAvFormat.av_find_input_format("flv");
    else if( content.compare("video/x-flv") == 0 )
      iformat = m_dllAvFormat.av_find_input_format("flv");

    /* these are likely pure streams, and as such we don't */
    /* want to try to look for streaminfo before playback */
    if( iformat )
      streaminfo = false;
  }

  if( m_pInput->IsStreamType(DVDSTREAM_TYPE_FFMPEG) )
  {
    g_urltimeout = GetTickCount() + 10000;

    // special stream type that makes avformat handle file opening
    // allows internal ffmpeg protocols to be used
    if( m_dllAvFormat.av_open_input_file(&m_pFormatContext, strFile.c_str(), iformat, FFMPEG_FILE_BUFFER_SIZE, NULL) < 0 )
    {
      CLog::Log(LOGDEBUG, "Error, could not open file %s", strFile.c_str());
      Dispose();
      return false;
    }
  }
  else
  {
    g_urltimeout = 0;

    // initialize url context to be used as filedevice
    URLContext* context = (URLContext*)m_dllAvUtil.av_mallocz(sizeof(struct URLContext) + strFile.length() + 1);
    context->prot = &dvd_file_protocol;
    context->priv_data = (void*)m_pInput;
    context->max_packet_size = FFMPEG_FILE_BUFFER_SIZE;

    if (m_pInput->IsStreamType(DVDSTREAM_TYPE_DVD))
    {
      context->max_packet_size = FFMPEG_DVDNAV_BUFFER_SIZE;
      context->is_streamed = 1;
    }
    if (m_pInput->IsStreamType(DVDSTREAM_TYPE_TV))
    {
      if(m_pInput->Seek(0, SEEK_POSSIBLE) == 0)
        context->is_streamed = 1;

      // this actually speeds up channel changes by almost a second
      // however, it alsa makes player not buffer anything, this
      // leads to buffer underruns in audio renderer
      //if(context->is_streamed)
      //  streaminfo = false;
    }
    else
    {
      if(m_pInput->Seek(0, SEEK_POSSIBLE) == 0)
        context->is_streamed = 1;
    }

#if LIBAVFORMAT_VERSION_INT >= (52<<16)
    context->filename = (char *) &context[1];
#endif

    strcpy(context->filename, strFile.c_str());  
//.........這裏部分代碼省略.........
開發者ID:Avoidnf8,項目名稱:xbmc-fork,代碼行數:101,代碼來源:DVDDemuxFFmpeg.cpp

示例15: Dispose

CanvasGDIP::~CanvasGDIP()
{
	Dispose();
}
開發者ID:AlfiyaZi,項目名稱:rainmeter,代碼行數:4,代碼來源:CanvasGDIP.cpp


注:本文中的Dispose函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。