利用Visual C++实现AVI文件的图像截取
|
|
- 词慈 项
- 5 years ago
- Views:
Transcription
1 Visual C++ AVI AVI AVI RIFF AVI AVI MIDI AVI AVI BMP AVI AVI AVI BMP AVI Windows API CAvi AVI API AVI AVIFileInit() AVI AVIFileExit() AVI API AVI Cavi CaviCreate() AVI Cavi AVI AviRead(int mframe) AVI mframe //Cavi class CAvi file://avi AVI public: int cy;// int cx;// file://long m_maxframe; BYTE *pdata;// BITMAPINFO *m_pbmi;// PAVISTREAM pavi;//avi PAVIFILE pfile;//avi AVIFILEINFO * pfi; file://avi BOOL AviRead(int mframe);// AVI mframe CAvi();// CAviCreate(CString &string);// AVI virtual ~CAvi(); ; //Cavi CAvi::CAvi() AVIFileInit();// AVI cx=0;// cy=0; m_pbmi=null; pdata=null;
2 file://m_maxframe=0; pfi=null; CAvi::~CAvi()// // AVIFileClose(pfile); AVIFileExit(); if(pdata!=null) delete pdata; pdata=null; if(m_pbmi!=null) delete m_pbmi; m_pbmi=null; if(pfi!=null) delete pfi; pfi=null; CAvi::CAviCreate(CString &string)// HRESULT hr; pfi=new AVIFILEINFO; hr = AVIFileOpen(&pfile, // returned file pointer string, // file name OF_READ, // mode to open file with NULL); hr= AVIFileInfo(pfile, file:// AVI pfi pfi, sizeof(avifileinfo) ); cx=pfi->dwwidth;// cy=pfi->dwheight; hr=avifilegetstream(// AVI pfile, &pavi, streamtypevideo, 0//LONG lparam ); m_pbmi=new BITMAPINFO;// BMP m_pbmi->bmiheader.bibitcount=24; m_pbmi->bmiheader.biclrimportant=0; m_pbmi->bmiheader.biclrused=0; m_pbmi->bmiheader.bicompression=bi_rgb; m_pbmi->bmiheader.biheight=cy;
3 m_pbmi->bmiheader.biwidth=cx; m_pbmi->bmiheader.biplanes=1; m_pbmi->bmiheader.bisize=sizeof(bitmapinfoheader); m_pbmi->bmiheader.bixpelspermeter=0; m_pbmi->bmiheader.biypelspermeter=0; m_pbmi->bmiheader.bisizeimage=cx*cy*3; pdata=(byte*)new char[cx*cy*3];// AVI BMP BOOL CAvi::AviRead(int mframe)// AVI M PData HRESULT hr; hr= AVIStreamRead( pavi, mframe, 1, pdata, cx*cy*3, NULL, NULL ); if(hr==0) return TRUE; else return FALSE; Cavi API MSDN Cavi pdata AVI Cavi m_pbmi BMP BMP BMP "Visual C++6.0 " BMP Windows2000 Visual C++6.0 Visual C++ VC OLE VC ACESS VC
4
5
6 Visual C++ [ ] 80% CCD VC VC
7 BENTECH INDUSTRIAL CV-155L 752x582 PCI CA-MPE 1000 VxD.vxd Windows SYSTEM VC mpew32.dll mpew32.lib CTestView::CTestView() W32_Init_MPE1000();// W32_Modify_Contrast(50);// W32_Modify_Brightness(45);// W32_Set_HP_value(945);// wcurrent_frame = 1;// 1 // MPE1000 W32_Set_Input_Source(1); W32_CACardParam(AD_SETHPFREQ,hpGrabFreq); W32_Set_PAL_Range(1250, 1024);// W32_Set_VGA_Mode ( 1 ); wgrabwinx1 = 0; // wgrabwiny1 = 0; firsttime=true; bgrabmode = FRAME; bzipmode = ZIPPLE; / lpdib=null;// CTestView::~CTestView() W32_Close_MPE1000();// //// void CTestView::OnGraboneframe()
8 // TODO: Add your command handler code here wcurrent_frame = 1; // W32_CACardParam (AD_SETGRABDEST, CA_GRABMEM); // if (lpdib!= NULL) GlobalUnlock( hglbdib ); GlobalFree( hglbdib ); // hglbdib=globalalloc(ghnd, (DWORD)wImgWidth*(DWORD)wImgHeight ); lpdib = (BYTE *)GlobalLock( hglbdib ); hdc = GetDC()->GetSafeHdc( ) ; if(lpdib!= NULL) cxdib = wimgwidth; cydib = wimgheight; SetLogicPal( hdc, cxdib, cydib, 8 ); SetStretchBltMode (hdc, COLORONCOLOR) ; bgrabmark = TRUE; while (bgrabmark == TRUE) if(msg.message==wm_lbuttondblclk) bgrabmark = FALSE; W32_ReadXMS2Buf (wcurrent_frame,lpdib) ; SetDIBitsToDevice (hdc, 0, 0, cxdib, cydib, 0, 0, 0, cydib, () lpdib, bmi, DIB_RGB_COLORS) ; // W32_CAStopCapture(); ::ReleaseDC( GetSafeHwnd(), hdc ); return ; //// CTestView::OnSize void WINAPI InitLogicPal( HDC hdc, short width, short height, WORD bitcount )
9 int j, i; short cxdib, cydib; LOGPALETTE * plogpal; j=256 ; if ((plogpal=(logpalette *)malloc(sizeof(logpalette) + (j*sizeof(paletteentry)))) == NULL) return ; plogpal->palversion=0x300; plogpal->palnumentries=j; for (i=0;i plogpal->palpalentry[i].pered = i ; plogpal->palpalentry[i].pegreen = i ; plogpal->palpalentry[i].peblue = i ; plogpal->palpalentry[i].peflags = 0; hpal = ::CreatePalette(pLogPal); delete plogpal; ::SelectPalette(hdc,hPal,0); ::RealizePalette(hdc); cxdib = width; cydib = height; if ( (bmi = (BITMAPINFO *)malloc(sizeof(bitmapinfoheader) + j*sizeof(rgbquad))) == NULL ) return ; //bmi bmi->bmiheader.bisize = 40; bmi->bmiheader.biwidth = cxdib; bmi->bmiheader.biheight = cydib; bmi->bmiheader.biplanes = 1 ; bmi->bmiheader.bibitcount = bitcount ; bmi->bmiheader.bicompression = 0 ; bmi->bmiheader.bisizeimage = 0 ; bmi->bmiheader.bixpelspermeter = 0; bmi->bmiheader.biypelspermeter = 0;
10 bmi->bmiheader.biclrused = 0; bmi->bmiheader.biclrimportant = 0; for (i=0;i bmi->bmicolors[i].rgbblue = i ; bmi->bmicolors[i].rgbgreen = i ; bmi->bmicolors[i].rgbred = i ; bmi->bmicolors[i].rgbreserved = 0 ; " " " "" " 1/4 1/9 VC void pictureinpicture( ).. CBitmap bitmap,*oldmap; pdata1=(byte*)new char[biwidth*biheight *3];//biWidth biheight // Read(pData1,bih.biWidth*bih.biHeight *3);// CClientDC dc(this); m_pbmi1= new BITMAPINFO;// BMP m_pbmi1->bmiheader.bibitcount=24; m_pbmi1->bmiheader.biclrimportant=0; m_pbmi1->bmiheader.biclrused=0; m_pbmi1->bmiheader.bicompression=0; m_pbmi1->bmiheader.biheight=biheight; m_pbmi1->bmiheader.biplanes=1; m_pbmi1->bmiheader.bisize=40; m_pbmi1->bmiheader.bisizeimage=widthbytes(biwidth*8)*biheight*3; m_pbmi1->bmiheader.biwidth=biwidth;
11 m_pbmi1->bmiheader.bixpelspermeter=0; m_pbmi1->bmiheader.biypelspermeter=0; //////////////////////////////////////////////////////////////////////// pdata2=(byte*)new char[biwidth1*biheight1 *3];// Read(pData2,biWidth1*biHeight1 *3);//// m_pbmi2= new BITMAPINFO; m_pbmi2->bmiheader.bibitcount=24; m_pbmi2->bmiheader.biclrimportant=0; m_pbmi2->bmiheader.biclrused=0; m_pbmi2->bmiheader.bicompression=0; m_pbmi2->bmiheader.biheight=biheight1; m_pbmi2->bmiheader.biplanes=1; m_pbmi2->bmiheader.bisize=40; m_pbmi2->bmiheader.bisizeimage=widthbytes(biwidth1*8)*biheight1*3; m_pbmi2->bmiheader.biwidth=biwidth1; m_pbmi2->bmiheader.bixpelspermeter=0; m_pbmi2->bmiheader.biypelspermeter=0; // CDC MemDc; MemDc.CreateCompatibleDC(&dc); bitmap.createcompatiblebitmap(&dc,biwidth,biheight); oldmap=memdc.selectobject(&bitmap); ::StretchDIBits(MemDc.m_hDC,0,0,biWidth,biHeight,0,0, biwidth,biheight,pdata1,m_pbmi1,dib_rgb_colors,srccopy);// ::StretchDIBits(MemDc.m_hDC,20,20,biWidth1,biHeight1,_ 0,0,biWidth1,biHeight1,pData2,m_pBMI2,DIB_RGB_COLORS,SRCCOPY);// ::StretchBlt(dc.m_hDC,0,0,bih.biWidth,bih.biHeight,_ MemDc.m_hDC,0,0,bih.biWidth,bih.biHeight,SRCCOPY);// MemDc.SelectObject(oldmap); delete pdata1; delete m_pbmi1; delete pdata2; delete m_pbmi2;
12 VC VC VC ACESS97 ODBC Photo Photo images image m_image m_hdata m_dwdatalength m_dwdatalength m_hdata MSND CdbImages : CdbImages::CdbImages(CDatabase* pdb) : CRecordset(pdb) //AFX_FIELD_INIT(CdbImages) m_nfields = 2;// //AFX_FIELD_INIT m_ndefaulttype = snapshot;// CString CdbImages::GetDefaultConnect() return _T("ODBC;DSN=MS Access Database");// ODBC CString CdbImages::GetDefaultSQL() return _T("[Images]");// Images void CdbImages::DoFieldExchange(CFieldExchange* pfx) //AFX_FIELD_MAP(CdbImages) pfx->setfieldtype(cfieldexchange::outputcolumn); RFX_LongBinary(pFX, _T("[Image]"), m_image);// OLE //AFX_FIELD_MAP /////////////////////////////////////////////////////////// // CDatabase m_db;// CBitmap Bitmap;// void CImageView::OnOpenDateBase()
13 m_db.open(null, // ODBC FALSE, FALSE, "ODBC;DRIVER= Microsof Access Driver (*.mdb);dbq=photo.mdb"); CdbImages dbimages(m_db); CString strfilename ;// i=1;//i StrFileName.Format("%s",i) dbimages.open(); if (dbimages.iseof()) AfxMessageBox("Unable to get image from db"); else char tmppath[_max_path+1]; GetTempPath(_MAX_PATH,tmpPath);// strfilename.insert(0,tmppath);// CFile outfile(strfilename,cfile::modecreate Cfile::modeWrite); // m_image dwdatalength buffer = ()GlobalLock(dbImages.m_Image.m_hData); outfile.writehuge(buffer,dbimages.m_image.m_dwdatalength); GlobalUnlock(dbImages.m_Image.m_hData); outfile.close(); // HBITMAP hbm = (HBITMAP)::LoadImage(NULL, strfilename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); if (Bitmap.Attach(hbm))// Cbitmap BITMAP bm; Bitmap.GetBitmap(&bm);// Bitmap.SetBitmapDimension(bm.bmWidth,bm.bmHeight); return; Invalidate // ///////////////////////////////////////////// void CImageView::OnDraw(CDC* pdc)//
14 CDC memdc; memdc.createcompatibledc(pdc); CBitmap* pimage = memdc.selectobject(bitmap); CSize imagesize = Bitmap.GetBitmapDimension(); pdc->bitblt(0,0,imagesize.cx,imagesize.cy,&memdc,0,0,srccopy); memdc.selectobject(pimage); ////////////////////////////////////////////////////// // void CImageView::OnSaveDateBase() // static char BASED_CODE szfilter[] = "Bitmap Files (*.bmp) *.bmp "; CdbImages dbimages(m_db); CFileDialog fd(true,null,null,0,szfilter,this); if (IDOK!= fd.domodal()) return; dbimages.open();// dbimages.addnew();// CFile fileimage; CFileStatus filestatus; fileimage.open(fd.getpathname(), Cfile::modeRead); fileimage.getstatus(filestatus);// dbimages.m_image.m_dwdatalength = filestatus.m_size; HGLOBAL hglobal= GlobalAlloc(GPTR,fileStatus.m_size);// dbimages.m_image.m_hdata = GlobalLock(hGlobal);// m_hdata // fileimage.readhuge(dbimages.m_image.m_hdata,filestatus.m_size);// m_image dbimages.setfielddirty(&dbimages.m_image);// dbimages.setfieldnull(&dbimages.m_image,false);// NULL dbimages.update();// GlobalUnlock(hGlobal); dbimages.close(); VC6.0 windows98
15 Visual C++ "ZFT" 2001 VC ////////////////////////////////// ZFT::ZFT(CWnd* pparent /*=NULL*/) : CDialog(ZFT::IDD, pparent)//zft Width=Height=0;// "0" //////////////////////// void ZFT::OnPaint() CRect rect;// CWnd *pwnd;// pwnd=getdlgitem(idc_graphic);// ZFT "Frame" file:// IDC_Graphic "Picture" "Frame" pwnd->getclientrect(&rect);// "Frame" " " int i;
16 CPaintDC dc(pwnd);// "Frame" file:// x y dc.moveto(0,rect.height()); dc.lineto(rect.width(),rect.height()); dc.moveto(0,rect.height()); dc.lineto(0,0); file:// num[] "ZFT" for(i=0;i<256;i++)// dc.moveto(i+1,rect.height()); dc.lineto (i+1,(rect.height()-rect.height()*num[i]*30)); file:// num "30" //////////////////////////////////////////////////////// void ZFT::onMouseMove(UINT nflags, CPoint point) //onmousemove CWnd *pwnd,*pwndtext;// CPoint point1;// point1=point;// CRect rect;// CString string ;// pwnd=getdlgitem(idc_graphic);// pwndtext=getdlgitem(idc_num);// IDC_NUM pwnd->getwindowrect(&rect);// pwnd file:// ScreenToClient(&rect); file:// if(rect.ptinrect (point)) int x=point1.x-rect.left; file:// string.format("%d",x); file:// pwndtext->setwindowtext((lpctstr)string); CDialog::onMouseMove(nFlags, point); //////////////////////////////////////// void CDibView::OnImagehorgm() file:// " "
17 CDibDoc *pdoc=getdocument(); HDIB hdib; hdib=pdoc->gethdib(); BITMAPINFOHEADER *lpdibhdr;// BYTE *lpdibbits;// lpdibhdr=( BITMAPINFOHEADER *)GlobalLock(hdib);// lpdibbits=(byte*)lpdibhdr+sizeof(bitmapinfoheader)+256*sizeof(rgbquad); file:// ZFT dialog;// int i,j; int wimgwidth=lpdibhdr->biwidth; int wimgheight=lpdibhdr->biheight; file://a[] float a[256]; for(i=0;i<256;i++)// a[i]=0; file:// for(i=0;i for(j=0;j a[*(lpdibbits+widthbytes(wimgwidth*8)*i+j)]++; file:// for(i=0;i<256;i++) a[i]=a[i]/(wimgheight*wimgwidth);// memcpy(dialog.num,a,256*sizeof(float)); dialog.domodal();// return; (a)lena b LENA b LENA
18 Visual C++6.0 TIF JEMP BMP 256 BMP BMP Windows BMP BMP BMP BITMAPFILEHEADER BITMAPINFOHEADER RGBQUAD 256 8bit BMP 0 CdibDoc.h #define WIDTHBYTES(bits) (((bits) + 31) / 32 * 4)// HANDLE m_hdib;// CPalette* m_paldib;// Cpalette CSize m_sizedoc; file:// 1 BMP BMP BMP OnOpenDocument BOOL CDibDoc::OnOpenDocument(LPCTSTR lpszpathname) CFile file; CFileException fe; if (!file.open(lpszpathname, Cfile::modeRead Cfile::shareDenyWrite, &fe)) AfxMessageBox(" "); return FALSE; // DeleteContents();// BeginWaitCursor();
19 BITMAPFILEHEADER bmfheader;// DWORD dwbitssize; HANDLE hdib; pdib; BITMAPINFOHEADER *bmhdr;// dwbitssize = file.getlength();// if (file.read(()&bmfheader, sizeof(bmfheader))!= sizeof(bmfheader)) return FALSE; if (bmfheader.bftype!= 0x4d42) file:// BMP return FALSE; hdib=(handle) ::GlobalAlloc(GMEM_MOVEABLE GMEM_ZEROINIT, dwbitssize); file:// if (hdib == 0) return FALSE; pdib = () ::GlobalLock((HGLOBAL)hDIB); file:// if (file.readhuge(pdib, dwbitssize - sizeof(bitmapfileheader))!= dwbitssize - sizeof(bitmapfileheader) ) ::GlobalUnlock((HGLOBAL)hDIB); hdib=null; return FALSE; // bmhdr=(bitmapinfoheader*)pdib;// ::GlobalUnlock((HGLOBAL)hDIB); if ((*bmhdr).bibitcount!=8) file:// 8bit return FALSE; m_hdib=hdib; InitDIBData(); file:// file:// EndWaitCursor(); SetPathName(lpszPathName);// SetModifiedFlag(FALSE); // FALSE return TRUE; 2 OnSaveDocument
20 BOOL CDibDoc::OnSaveDocument(LPCTSTR lpszpathname) CFile file; CFileException fe; BITMAPFILEHEADER bmfhdr; // LPBITMAPINFOHEADER lpbi; file:// DWORD dwdibsize; if (!file.open(lpszpathname, Cfile::modeCreate Cfile::modeReadWrite Cfile::shareExclusive, &fe)) AfxMessageBox(" "); // BOOL bsuccess = FALSE; BeginWaitCursor(); lpbi = (LPBITMAPINFOHEADER) ::GlobalLock((HGLOBAL) m_hdib); if (lpbi == NULL) return FALSE; dwdibsize = *(LPDWORD)lpBI + 256*sizeof(RGBQUAD); // Partial Calculation DWORD dwbmbitssize;//bmp dwbmbitssize=widthbytes((lpbi->biwidth)*((dword)lpbi->bibitcount)) *lpbi->biheight;// dwdibsize += dwbmbitssize; lpbi->bisizeimage = dwbmbitssize; // file:// bmfhdr.bftype =0x4d42; // "BMP" bmfhdr.bfsize = dwdibsize + sizeof(bitmapfileheader);// bmfhdr.bfreserved1 = 0; bmfhdr.bfreserved2 = 0; bmfhdr.bfoffbits = (DWORD)sizeof(BITMAPFILEHEADER) + lpbi->bisize + 256*sizeof(RGBQUAD); file:// file.write(()&bmfhdr, sizeof(bitmapfileheader));// file.writehuge(lpbi, dwdibsize); file:// ::GlobalUnlock((HGLOBAL) m_hdib); EndWaitCursor(); SetModifiedFlag(FALSE); // back to unmodified return TRUE;
21 Windows WM_QUERYNEWPALETTE WM_PALETTECHANGED WM_DOREALIZE #define WM_REALIZEPAL (WM_USER+100) void CMainFrame::OnPaletteChanged(CWnd* pfocuswnd) file:// CMDIFrameWnd::OnPaletteChanged(pFocusWnd); CMDIChildWnd* pmdichildwnd = MDIGetActive(); if (pmdichildwnd == NULL) return CView* pview = pmdichildwnd->getactiveview(); ASSERT(pView!= NULL); SendMessageToDescendants(WM_DOREALIZE, (WPARAM)pView->m_hWnd); file:// BOOL CMainFrame::OnQueryNewPalette()// // CMDIChildWnd* pmdichildwnd = MDIGetActive(); if (pmdichildwnd == NULL) return FALSE; // no active MDI child frame (no new palette) CView* pview = pmdichildwnd->getactiveview(); ASSERT(pView!= NULL); file:// pview->sendmessage(wm_dorealize, (WPARAM)pView->m_hWnd); return TRUE; LRESULT CDibView::OnDoRealize(WPARAM wparam, LPARAM)// ASSERT(wParam!= NULL); CDibDoc* pdoc = GetDocument(); if (pdoc->m_hdib == NULL) return 0L; // must be a new document CPalette* ppal = pdoc->m_paldib; file:// InitDIBData() if (ppal!= NULL) CMainFrame* pappframe = (CMainFrame*) AfxGetApp()->m_pMainWnd; ASSERT_KINDOF(CMainFrame, pappframe); CClientDC appdc(pappframe); CPalette* oldpalette = appdc.selectpalette(ppal, ((HWND)wParam)!= m_hwnd);
22 file:// "FALSE" // " " if (oldpalette!= NULL) UINT ncolorschanged = appdc.realizepalette();// if (ncolorschanged > 0) pdoc->updateallviews(null);// appdc.selectpalette(oldpalette, TRUE); file:// else TRACE0("\tSelectPalette failed in CDibView::OnPaletteChanged\n"); API " " void CDibView::OnMENUHighPass() HANDLE data1handle; LPBITMAPINFOHEADER lpbi; CDibDoc *pdoc=getdocument(); HDIB hdib; unsigned char *hdata; unsigned char *data; hdib=pdoc->gethdib(); BeginWaitCursor(); lpbi=(lpbitmapinfoheader)globallock((hglobal)hdib); hdata=(unsigned char*)finddibbits(()lpbi); pdoc->setmodifiedflag(true); data1handle=globalalloc(gmem_share,widthbytes(lpbi->biwidth*8)*lpbi->biheight); data=(unsigned char*)globallock((hglobal)data1handle); AfxGetApp()->BeginWaitCursor(); int i,j,s,t,ms=1; int sum=0,sumw=0; int mask[3][3]=-1,-1,-1,-1,9,-1,-1,-1,-1; for(i=0; ibiheight; i++)
23 for(j=0; jbiwidth; j++) sumw=0; sum=0; for(s=(-ms); s<=ms; s++) for(t=(-ms); t<=ms; t++) if(((i+s)>=0) && ((j+t)>=0) && ((i+s)biheight) && ((j+t)biwidth)) sumw += mask[1+s][1+t]; sum+=*(hdata+(i+s)*widthbytes(lpbi->biwidth*8)+(j+t))*mask[1+s][1+t]; if(sumw==0) sumw=1; sum/=sumw; if(sum>255)sum=255; if(sum<0)sum=0; *(data+i*widthbytes(lpbi->biwidth*8)+j)=sum; for( j=0; jbiheight; j++) for( i=0; ibiwidth; i++) *(hdata+i*widthbytes(lpbi->biwidth*8)+j)=*(data+i*widthbytes(lpbi->biwidth*8)+j) ; AfxGetApp()->EndWaitCursor(); GlobalUnlock((HGLOBAL)hdib); GlobalUnlock(data1handle); EndWaitCursor(); Invalidate(TRUE); 1 (x0, y0) (x1, y1) x y dx dy (x0+dx, y0+dy) (x1+dx, y1+dy) x1 = x + dx y1 = y + dy
24 API StretchDIBits() XOR 2 n n 1 (1) (2) height width (3) 2 n 1 (x y) x1=x y1=height-1-y (x1 y1) (4) 3 x, y x1, y1 x1 = width-x-1 y1 = y (x1 y1) 4
25 left, top, right, bottom x, y xcenter, ycenter angle x1, y1 xcenter = (width+1)/2+left; ycenter = (height+1)/2+top; x1 = (x-xcenter) cos - (y - ycenter) sin +xcenter; y1 = (x-xcenter) sin + (y- ycenter) cos + ycenter; (x1 y1) Windows98 8bit VC++ BOOL B (1 1. 1) B <br> BOOL Erosion(HWND hwnd,bool Hori) DWORD BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf; LONG x,y; unsigned char num;
26 int i; // if( NumColors!=256) MessageBox(hWnd,"Must be a mono bitmap with grayscale palette!","error Message", MB_OK MB_ICONEXCLAMATION); return FALSE; //BufSize BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); // memcpy(lptempimgdata,lpimgdata,bufsize); if(hori) // for(y=0;y<bi.biheight;y++) //lpptr lptempptr lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes)+1; lptempptr=(char *)lptempimgdata+(bufsize-linebytes-y*linebytes)+1; for(x=1;x<bi.biwidth-1;x++) // x 1-2 num=(unsigned char)*lpptr; if (num==0) // *lptempptr=(unsigned char)0; // for(i=0;i<3;i++) num=(unsigned char)*(lpptr+i-1); if(num==255) //, // *lptempptr=(unsigned char)255; break; //
27 else *lptempptr=(unsigned char)255; // lpptr++; lptempptr++; else // for(y=1;y<bi.biheight-1;y++) // y 1-2 //lpptr lptempptr lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes); lptempptr=(char *)lptempimgdata+(bufsize-linebytes-y*linebytes); for(x=0;x<bi.biwidth;x++) num=(unsigned char)*lpptr; if (num==0) // *lptempptr=(unsigned char)0; // for(i=0;i<3;i++) num=(unsigned char)*(lpptr+(i-1)*linebytes); if(num==255) //, // *lptempptr=(unsigned char)255; break; // else *lptempptr=(unsigned char)255; // lpptr++; lptempptr++; if(hbitmap!=null) DeleteObject(hBitmap); hdc=getdc(hwnd); // hbitmap=createdibitmap(hdc, (LPBITMAPINFOHEADER)lpTempImgData, (LONG)CBM_INIT,()lpTempImgData+sizeof(BITMAPINFOHEADER) + NumColors*sizeof(RGBQUAD),(LPBITMAPINFO)lpTempImgData, DIB_RGB_COLORS); // if(hori)
28 hf=_lcreat("c:\\herosion.bmp",0); else hf=_lcreat("c:\\verosion.bmp",0); _lwrite(hf,()&bf,sizeof(bitmapfileheader)); _lwrite(hf,()lptempimgdata,bufsize); _lclose(hf); // ReleaseDC(hWnd,hDc); LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return TRUE; VC++ BOOL B (1 1. 1) B BOOL Dilation(HWND hwnd,bool Hori) DWORD BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf; LONG x,y; unsigned char num; int i; // if( NumColors!=256) MessageBox(hWnd,"Must be a mono bitmap with grayscale palette!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; //BufSize BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); //
29 if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); // memcpy(lptempimgdata,lpimgdata,bufsize); if(hori) // for(y=0;y<bi.biheight;y++) //lpptr lptempptr lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes)+1; lptempptr=(char *)lptempimgdata+(bufsize-linebytes-y*linebytes)+1; for(x=1;x<bi.biwidth-1;x++) // x 1-2 num=(unsigned char)*lpptr; // // if (num==255) *lptempptr=(unsigned char)255; // for(i=0;i<3;i++) num=(unsigned char)*(lpptr+i-1); // if(num==0) *lptempptr=(unsigned char)0; break; // else *lptempptr=(unsigned char)0; // lpptr++; lptempptr++; else // for(y=1;y<bi.biheight-1;y++) // y 1-2 lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes);
30 lptempptr=(char *)lptempimgdata+(bufsize-linebytes-y*linebytes); for(x=0;x<bi.biwidth;x++) num=(unsigned char)*lpptr; if (num==255) *lptempptr=(unsigned char)255; for(i=0;i<3;i++) num=(unsigned char)*(lpptr+(i-1)*linebytes); // if(num==0) *lptempptr=(unsigned char)0; break; else *lptempptr=(unsigned char)0; lpptr++; lptempptr++; if(hbitmap!=null) DeleteObject(hBitmap); hdc=getdc(hwnd); // hbitmap=createdibitmap(hdc, (LPBITMAPINFOHEADER)lpTempImgData, (LONG)CBM_INIT,()lpTempImgData+sizeof(BITMAPINFOHEADER) + NumColors*sizeof(RGBQUAD),(LPBITMAPINFO)lpTempImgData, DIB_RGB_COLORS); // if(hori) hf=_lcreat("c:\\hdilation.bmp",0); else hf=_lcreat("c:\\vdilation.bmp",0); _lwrite(hf,()&bf,sizeof(bitmapfileheader)); _lwrite(hf,()lptempimgdata,bufsize); _lclose(hf); // ReleaseDC(hWnd,hDc); LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return TRUE;
31 VC BOOL Thinning(HWND hwnd) DWORD BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf; LONG x,y; int num; BOOL Finished; int nw,n,ne,w,e,sw,s,se; // 256? 255 if( NumColors!=256) MessageBox(hWnd,"Must be a mono bitmap with grayscale palette!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; //BufSize BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); // memcpy(lptempimgdata,lpimgdata,bufsize); // Finished=FALSE; while(!finished) // // Finished=TRUE; // for (y=1;y<bi.biheight-1;y++) // y 1-2 //lpptr lptempptr lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes);
32 lptempptr=(char *)lptempimgdata+(bufsize-linebytes-y*linebytes); x=1; // x 1-2 while(x<bi.biwidth-1) if(*(lpptr+x)==0) // w=(unsigned char)*(lpptr+x-1); // e=(unsigned char)*(lpptr+x+1); // if( (w==255) (e==255)) // nw=(unsigned char)*(lpptr+x+linebytes-1); // n=(unsigned char)*(lpptr+x+linebytes); // ne=(unsigned char)*(lpptr+x+linebytes+1); // sw=(unsigned char)*(lpptr+x-linebytes-1); // s=(unsigned char)*(lpptr+x-linebytes); // se=(unsigned char)*(lpptr+x-linebytes+1); // // num=nw/255+n/255*2+ne/255*4+w/255*8+e/255*16+sw/255*32+s/255*64+se/ 255*128; if(erasetable[num]==1) // *(lpptr+x)=(byte)255; // *(lptempptr+x)=(byte)255; // Finished=FALSE; // x++; // x++; // // for (x=1;x<bi.biwidth-1;x++) // x 1-2 y=1; // y 1-2 while(y<bi.biheight-1) lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes); lptempptr=(char *)lptempimgdata+(bufsize-linebytes-y*linebytes); if(*(lpptr+x)==0) // n=(unsigned char)*(lpptr+x+linebytes); s=(unsigned char)*(lpptr+x-linebytes); if( (n==255) (s==255)) // nw=(unsigned char)*(lpptr+x+linebytes-1); ne=(unsigned char)*(lpptr+x+linebytes+1); w=(unsigned char)*(lpptr+x-1);
33 e=(unsigned char)*(lpptr+x+1); sw=(unsigned char)*(lpptr+x-linebytes-1); se=(unsigned char)*(lpptr+x-linebytes+1); // num=nw/255+n/255*2+ne/255*4+w/255*8+e/255*16+sw/255*32+s/255*64+se/255*128; if(erasetable[num]==1) // *(lpptr+x)=(byte)255; // *(lptempptr+x)=(byte)255; // Finished=FALSE; // y++;// y++; // if(hbitmap!=null) DeleteObject(hBitmap); hdc=getdc(hwnd); // hbitmap=createdibitmap(hdc, (LPBITMAPINFOHEADER)lpTempImgData, (LONG)CBM_INIT,()lpTempImgData+sizeof(BITMAPINFOHEADER) +NumColors*sizeof(RGBQUAD),(LPBITMAPINFO)lpTempImgData, DIB_RGB_COLORS); hf=_lcreat("c:\\thinning.bmp",0); _lwrite(hf,()&bf,sizeof(bitmapfileheader)); _lwrite(hf,()lptempimgdata,bufsize); _lclose(hf); // ReleaseDC(hWnd,hDc); LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return TRUE; VC Hough BOOL Hough(HWND hwnd) // typedef struct
34 int topx; // x int topy; // y int botx; // x int boty; // y MYLINE; DWORD BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HDC hdc; LONG x,y; long i,maxd; int k; int Dist,Alpha; HGLOBAL hdistalpha,hmyline; int *lpdistalpha; MYLINE *lpmyline,*templine,maxdline; static LOGPEN rlp=ps_solid,1,1,rgb(255,0,0); HPEN rhp; // if( NumColors!=256) MessageBox(hWnd,"Must be a mono bitmap with grayscale palette!", "Error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // Dist=(int)(sqrt( (double)bi.biwidth*bi.biwidth+ (double)bi.biheight*bi.biheight)+0.5) ; Alpha=180 /2 ; //0 to // if((hdistalpha=globalalloc(ghnd,(dword)dist* Alpha * sizeof(int)))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // if((hmyline=globalalloc(ghnd,(dword)dist*alpha*sizeof(myline)))==null) GlobalFree(hDistAlpha); return FALSE; // BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); lpimgdata=(lpbitmapinfoheader)globallock(himgdata);
35 lpdistalpha=(int *)GlobalLock(hDistAlpha); lpmyline=(myline *)GlobalLock(hMyLine); for (i=0;i<(long)dist*alpha;i++) TempLine=(MYLINE*)(lpMyLine+i); (*TempLine).boty=32767; // y for (y=0;y<bi.biheight;y++) //lpptr lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes); for (x=0;x<bi.biwidth;x++) if(*(lpptr++)==0) // for (k=0;k<180;k+=2) // i )); i=(long)fabs((x*cos(k*pi/180.0)+y*sin(k*pi/180.0) // 1 *(lpdistalpha+i*alpha+k/2)=*(lpdistalpha+i*alpha+k/2)+1; TempLine=(MYLINE*)(lpMyLine+i*Alpha+k/2); if(y> (*TempLine).topy) // x,y (*TempLine).topx=x; (*TempLine).topy=y; if(y< (*TempLine).boty) // x,y (*TempLine).botx=x; (*TempLine).boty=y; maxd=0; for (i=0;i<(long)dist*alpha;i++) TempLine=(MYLINE*)(lpMyLine+i); k=*(lpdistalpha+i); if( k > maxd) // maxd=k; MaxdLine.topx=(*TempLine).topx;
36 MaxdLine.topy=(*TempLine).topy; MaxdLine.botx=(*TempLine).botx; MaxdLine.boty=(*TempLine).boty; hdc = GetDC(hWnd); rhp = CreatePenIndirect(&rlp); SelectObject(hDc,rhp); MoveToEx(hDc,MaxdLine.botx,MaxdLine.boty,NULL); // LineTo(hDc,MaxdLine.topx,MaxdLine.topy); DeleteObject(rhp); ReleaseDC(hWnd,hDc); // GlobalUnlock(hImgData); GlobalUnlock(hDistAlpha); GlobalFree(hDistAlpha); GlobalUnlock(hMyLine); GlobalFree(hMyLine); return TRUE; Hough VC++ BOOL Outline(HWND hwnd) DWORD BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf; LONG x,y; int num; int nw,n,ne,w,e,sw,s,se; // if( NumColors!=256) MessageBox(hWnd,"Must be a mono bitmap with grayscale palette!",
37 "Error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); // memcpy(lptempimgdata,lpimgdata,bufsize); for (y=1;y<bi.biheight-1;y++) // y 1-2 //lpptr lptempptr lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes); lptempptr=(char *)lptempimgdata+(bufsize-linebytes-y*linebytes); for (x=1;x<bi.biwidth-1;x++) if(*(lpptr+x)==0) // // nw=(unsigned char)*(lpptr+x+linebytes-1); n=(unsigned char)*(lpptr+x+linebytes); ne=(unsigned char)*(lpptr+x+linebytes+1); w=(unsigned char)*(lpptr+x-1); e=(unsigned char)*(lpptr+x+1); sw=(unsigned char)*(lpptr+x-linebytes-1); s=(unsigned char)*(lpptr+x-linebytes); se=(unsigned char)*(lpptr+x-linebytes+1); num=nw+n+ne+w+e+sw+s+se; if(num==0) // *(lptempptr+x)=(unsigned char)255; // if(hbitmap!=null) DeleteObject(hBitmap); hdc=getdc(hwnd); // hbitmap=createdibitmap(hdc, (LPBITMAPINFOHEADER)lpTempImgData, (LONG)CBM_INIT,()lpTempImgData+sizeof(BITMAPINFOHEADER) + NumColors*sizeof(RGBQUAD),(LPBITMAPINFO)lpTempImgData, DIB_RGB_COLORS);
38 hf=_lcreat("c:\\outline.bmp",0); _lwrite(hf,()&bf,sizeof(bitmapfileheader)); _lwrite(hf,()lptempimgdata,bufsize); _lclose(hf); // ReleaseDC(hWnd,hDc); LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return TRUE; // typedef struct HGLOBAL hmem; // POINT *lpmystack; // LONG ElementsNum; // LONG ptr; // MYSTACK; // BOOL InitStack(HWND hwnd,long StackLen) SeedFillStack.ElementsNum=StackLen; // if((seedfillstack.hmem=globalalloc(ghnd,seedfillstack. ElementsNum*sizeof(POINT)))==NULL) // FALSE; MessageBox(hWnd,"Error alloc memory!","errormessage",mb_ok MB_ICONEXCLAMATION); return FALSE; SeedFillStack.lpMyStack=(POINT *)GlobalLock(SeedFillStack.hMem); // memset(seedfillstack.lpmystack,0,seedfillstack.elementsnum*sizeof(point)); // SeedFillStack.ptr=0; // TRUE return TRUE;
39 // void DeInitStack() // GlobalUnlock(SeedFillStack.hMem); GlobalFree(SeedFillStack.hMem); SeedFillStack.ElementsNum=0; SeedFillStack.ptr=0; //push BOOL MyPush(POINT p) POINT *TempPtr; if(seedfillstack.ptr>=seedfillstack.elementsnum) return FALSE; // FALSE // 1 TempPtr=(POINT *)(SeedFillStack.lpMyStack+SeedFillStack.ptr++); (*TempPtr).x=p.x; (*TempPtr).y=p.y; return TRUE; //pop POINT MyPop() POINT InvalidP; InvalidP.x=-1; InvalidP.y=-1; if(seedfillstack.ptr<=0) return InvalidP; // SeedFillStack.ptr--; // 1 // return *(SeedFillStack.lpMyStack+SeedFillStack.ptr); // BOOL IsStackEmpty() return (SeedFillStack.ptr==0)?TRUE:FALSE; WM_LBUTTONDOWN MYSTACK SeedFillStack;
40 BOOL SeedFill(HWND hwnd) DWORD BufSize; LPBITMAPINFOHEADER lpimgdata; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr,lptempptr1; HDC hdc; HFILE hf; POINT CurP,NeighborP; // if( NumColors!=256) MessageBox(hWnd,"Must be a mono bitmap with grayscale palette!", "Error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); // memcpy(lptempimgdata,lpimgdata,bufsize); if(!initstack(hwnd,(long)bi.biheight*bi.biwidth)) // // LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return FALSE; lptempptr=(char *)lptempimgdata+(bufsize-linebytes- SeedPoint.y*LineBytes)+SeedPoint.x; if(*lptempptr==0) // FALSE MessageBox(hWnd,"The point you select is a contour point!","error Message",MB_OK MB_ICONEXCLAMATION); LocalUnlock(hTempImgData);
41 LocalFree(hTempImgData); GlobalUnlock(hImgData); DeInitStack(); return FALSE; //push WM_LBUTTONDOWN MyPush(SeedPoint); while(!isstackempty()) // CurP=MyPop(); //pop lptempptr=(char *)lptempimgdata+(bufsize- LineBytes-CurP.y*LineBytes)+CurP.x; // *lptempptr=(unsigned char)0; // if(curp.x>0) // NeighborP.x=CurP.x-1; NeighborP.y=CurP.y; lptempptr1=lptempptr-1; if(*lptempptr1!=0) // MyPush(NeighborP); // if(curp.y>0) // NeighborP.x=CurP.x; NeighborP.y=CurP.y-1; lptempptr1=lptempptr+linebytes; if(*lptempptr1!=0) // MyPush(NeighborP); // if(curp.x<bi.biwidth-1) // NeighborP.x=CurP.x+1; NeighborP.y=CurP.y; lptempptr1=lptempptr+1; if(*lptempptr1!=0) // MyPush(NeighborP); // if(curp.y<bi.biheight-1) //
42 NeighborP.x=CurP.x; NeighborP.y=CurP.y+1; lptempptr1=lptempptr-linebytes; if(*lptempptr1!=0) // MyPush(NeighborP); // DeInitStack(); if(hbitmap!=null) DeleteObject(hBitmap); hdc=getdc(hwnd); // hbitmap=createdibitmap(hdc,(lpbitmapinfoheader)lptempimgdata, (LONG)CBM_INIT,()lpTempImgData+sizeof(BITMAPINFOHEADER) + NumColors*sizeof(RGBQUAD), (LPBITMAPINFO)lpTempImgData, DIB_RGB_COLORS); hf=_lcreat("c:\\seed.bmp",0); _lwrite(hf,()&bf,sizeof(bitmapfileheader)); _lwrite(hf,()lptempimgdata,bufsize); _lclose(hf); // ReleaseDC(hWnd,hDc); LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return TRUE; VC++ IsContourP BOOL Contour(HWND hwnd) DWORD OffBits BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf;
43 LONG x,y; POINT StartP,CurP; BOOL found; int i; int direct[8][2]=1,0,1,-1,0,-1,-1,-1,-1,0, -1,1,0,1,1,1; // if( NumColors!=256) MessageBox(hWnd,"Must be a mono bitmap with grayscale palette!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); // BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); // 255 memset(lptempimgdata,(byte)255,bufsize); // memcpy(lptempimgdata,lpimgdata,offbits); // found=false; for (y=0;y<bi.biheight &&!found; y++) lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes); for (x=0;x<bi.biwidth &&!found; x++) if (*(lpptr++) ==0) found=true; // if(found) // // x y 1 1 // StartP StartP.x=x-1; StartP.y=y-1; lptempptr=(char *)lptempimgdata+(bufsize- LineBytes-StartP.y*LineBytes)+StartP.x;
44 *lptempptr=(unsigned char)0; // // CurP.x=StartP.x+1; CurP.y=StartP.y; lpptr=(char *)lpimgdata+(bufsize-linebytes-curp.y*linebytes)+curp.x; if(*lpptr!=0) // CurP.x=StartP.x+1; CurP.y=StartP.y+1; lpptr=(char *)lpimgdata+(bufsize-linebytes-curp.y*linebytes)+curp.x; if(*lpptr!=0) // CurP.x=StartP.x; CurP.y=StartP.y+1; else // CurP.x=StartP.x-1; CurP.y=StartP.y+1; while (! ( (CurP.x==StartP.x) &&(CurP.y==StartP.y))) // lptempptr=(char *)lptempimgdata+(bufsize-linebytes -CurP.y*LineBytes)+CurP.x; *lptempptr=(unsigned char)0; for(i=0;i<8;i++) // //direct[i] x,y x=curp.x+direct[i][0]; y=curp.y+direct[i][1]; //lpptr lptempptr lptempptr=(char *)lptempimgdata +(BufSize-LineBytes-y*LineBytes)+x; lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes)+x; if( ( (*lpptr==0)&&(*lptempptr!=0) ) ( (x==startp.x) &&(y==startp.y))) // // if(iscontourp(x,y,lpptr)) // // CurP.x=x; CurP.y=y; break;
45 if(hbitmap!=null) DeleteObject(hBitmap); hdc=getdc(hwnd); // hbitmap=createdibitmap(hdc,(lpbitmapinfoheader)lptempimgdata, (LONG)CBM_INIT,()lpTempImgData+sizeof(BITMAPINFOHEADER) + NumColors*sizeof(RGBQUAD),(LPBITMAPINFO)lpTempImgData, DIB_RGB_COLORS); hf=_lcreat("c:\\contour.bmp",0); _lwrite(hf,()&bf,sizeof(bitmapfileheader)); _lwrite(hf,()lptempimgdata,bufsize); _lclose(hf); // ReleaseDC(hWnd,hDc); LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return TRUE; // x,y lpptr BOOL IsContourP(LONG x,long y, char *lpptr) int num,n,w,e,s; n=(unsigned char)*(lpptr+linebytes); // w=(unsigned char)*(lpptr-1); // e=(unsigned char)*(lpptr+1); // s=(unsigned char)*(lpptr-linebytes); // num=n+w+e+s; if(num==0) // return FALSE; return TRUE; VC++ c:\test.bmp c:\backgnd.bmp BOOL Subtraction(HWND hwnd) DWORD OffBits,BufSize;
46 LPBITMAPINFOHEADER lpimgdata; lpptr; HGLOBAL hsecond; LPBITMAPINFOHEADER lpsecondimgdata; lpsecondptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf; LONG x,y; int num,pos; // if( NumColors!=256) MessageBox(hWnd,"Must be a mono bitmap with grayscale palette!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; if((hf=_lopen("c:\\backgnd.bmp",of_read))==hfile_error) // MessageBox(hWnd,"File c:\\backgnd.bmp not found!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); // BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // if((hsecond=globalalloc(ghnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); _lclose(hf); return FALSE; // lpsecondimgdata=(lpbitmapinfoheader)globallock(hsecond); // BITMAPINFOHEADER _llseek(hf,sizeof(bitmapfileheader),file_begin); // _lread(hf,()lpsecondimgdata,bufsize); _lclose(hf); // if((htempimgdata=localalloc(lhnd,bufsize))==null)
47 MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); GlobalUnlock(hSecond); GlobalFree(hSecond); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); // 255 memset(lptempimgdata,(byte)255,bufsize); // memcpy(lptempimgdata,lpimgdata,offbits); for(y=0;y<bi.biheight;y++) pos=(bufsize-linebytes-y*linebytes); //lpptr lpsecondptr lptempptr lpptr=(char *)lpimgdata+pos; lpsecondptr=(char *)lpsecondimgdata+pos; lptempptr=(char *)lptempimgdata+pos; for(x=0;x<bi.biwidth;x++) num=(unsigned char)*(lpptr++); num-=(unsigned char)*(lpsecondptr++); *(lptempptr++)=(unsigned char)fabs(num); //// if(hbitmap!=null) DeleteObject(hBitmap); hdc=getdc(hwnd); // hbitmap=createdibitmap(hdc,(lpbitmapinfoheader)lptempimgdata, (LONG)CBM_INIT,()lpTempImgData+sizeof(BITMAPINFOHEADER) +NumColors*sizeof(RGBQUAD),(LPBITMAPINFO)lpTempImgData, DIB_RGB_COLORS); hf=_lcreat("c:\\subtract.bmp",0); _lwrite(hf,()&bf,sizeof(bitmapfileheader)); _lwrite(hf,()lptempimgdata,bufsize); _lclose(hf); // ReleaseDC(hWnd,hDc); GlobalUnlock(hSecond); GlobalFree(hSecond); LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return TRUE;
48 VC++ BOOL BOOL Projection(HWND hwnd,bool Hori) DWORD OffBits,BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf; LONG x,y; int num; // if( NumColors!=256) MessageBox(hWnd,"Must be a mono bitmap with grayscale palette!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); // BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); // 255 memset(lptempimgdata,(byte)255,bufsize); //
49 memcpy(lptempimgdata,lpimgdata,offbits); if(hori) // for(y=0;y<bi.biheight;y++) lpptr=(char *)lpimgdata+(bufsize-linebytes-y*linebytes); num=0; // 0 for(x=0;x<bi.biwidth;x++) if(*(lpptr++)!=0) // num++; // 1 lptempptr=(char *)lptempimgdata+(bufsize-linebytes-y*linebytes); for(x=0;x<num;x++) *(lptempptr++)=0; // num else // for(x=0;x<bi.biwidth;x++) num=0; // 0 lpptr=(char *)lpimgdata+(bufsize-linebytes)+x; for(y=0;y<bi.biheight;y++) if(*lpptr!=0) num++; // 1 lpptr-=linebytes; lptempptr=(char *)lptempimgdata+offbits+x; for(y=0;y<num;y++) *lptempptr=0; // num lptempptr+=linebytes; if(hbitmap!=null) DeleteObject(hBitmap); hdc=getdc(hwnd); // hbitmap=createdibitmap(hdc, (LPBITMAPINFOHEADER)lpTempImgData, (LONG)CBM_INIT,()lpTempImgData+sizeof(BITMAPINFOHEADER) +NumColors*sizeof(RGBQUAD),(LPBITMAPINFO)lpTempImgData, DIB_RGB_COLORS); // if(hori) hf=_lcreat("c:\\hproject.bmp",0); else hf=_lcreat("c:\\vproject.bmp",0); _lwrite(hf,()&bf,sizeof(bitmapfileheader)); _lwrite(hf,()lptempimgdata,bufsize);
50 _lclose(hf); // ReleaseDC(hWnd,hDc); LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return TRUE; VC++ int EquaScale; // BOOL HistogramEqua(HWND hwnd) DLGPROC dlginputbox = NULL; DWORD BufSize,OffBits; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf; LONG x,y; LOGPALETTE *ppal; HPALETTE hprevpalette; HLOCAL hpal; WORD i; int Gray; DWORD GrayHits[256]; int GrayIndex[256]; float s[256]; if( NumColors!=256) // 256 MessageBox(hWnd,"Must be a 256 grayscale bitmap!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // dlginputbox = (DLGPROC) MakeProcInstance ( (FARPROC)InputBox, ghinst ); DialogBox (ghinst, "INPUTBOX", hwnd, dlginputbox); FreeProcInstance ( (FARPROC) dlginputbox );
51 if( EquaScale >=255) // 255 MessageBox(hWnd,"The new scale can not be larger than 255","Error Message", MB_OK MB_ICONEXCLAMATION); return FALSE; //OffBits OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); //BufSize BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; //lpimgdata //lptempimgdata lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); // memcpy(lptempimgdata,lpimgdata,offbits); //ColorHits ColorIndex // memset(grayhits,0,256*sizeof(dword)); memset(grayindex,0,256*sizeof(word)); for(y=0;ypalnumentries =(WORD) 256; ppal->palversion = 0x300; lptempptr=(char *)lptempimgdata+sizeof(bitmapinfoheader); for (i = 0; i < EquaScale; i++) Gray=(int)(i*255.0/(EquaScale-1)); // ppal->palpalentry[i].pered=(byte)gray; ppal->palpalentry[i].pegreen=(byte)gray; ppal->palpalentry[i].peblue=(byte)gray; ppal->palpalentry[i].peflags=(byte)0; *(lptempptr++)=(unsigned char)gray; *(lptempptr++)=(unsigned char)gray; *(lptempptr++)=(unsigned char)gray; *(lptempptr++)=0; if(hpalette!=null) DeleteObject(hPalette); // hpalette=createpalette(ppal); LocalUnlock(hPal); LocalFree(hPal);
52 hdc=getdc(hwnd); if(hpalette) hprevpalette=selectpalette(hdc,hpalette,false); RealizePalette(hDc); for(y=0;y VC++ BOOL Transpose(HWND hwnd) DWORD OffBits,SrcBufSize,DstBufSize,DstLineBytes; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; DWORD Wnew,Hnew; HDC hdc; HFILE hf; DWORD x0,y0,x1,y1; BITMAPFILEHEADER DstBf; BITMAPINFOHEADER DstBi; // Wnew = (DWORD)bi.biHeight; Hnew = (DWORD)bi.biWidth; OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); SrcBufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // ImgWidth=Wnew; ImgHeight=Hnew; DstLineBytes=(DWORD)WIDTHBYTES(Wnew*bi.biBitCount); DstBufSize=(DWORD)(sizeof(BITMAPINFOHEADER)+NumColors*sizeof(R GBQUAD)+ (DWORD)DstLineBytes*Hnew); if((htempimgdata=localalloc(lhnd,dstbufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE;
53 lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); lpptr=(char *)lpimgdata; lptempptr=(char *)lptempimgdata; memset(lptempptr,(byte)255,dstbufsize); memcpy(lptempptr,lpptr,offbits); // memcpy((char *)&DstBf,(char *)&bf,sizeof(bitmapfileheader)); memcpy((char *)&DstBi,(char *)&bi,sizeof(bitmapinfoheader)); DstBf.bfSize=DstBufSize+sizeof(BITMAPFILEHEADER); DstBi.biWidth=Wnew; DstBi.biHeight=Hnew; memcpy(lptempptr,(char *)&DstBi,sizeof(BITMAPINFOHEADER)); for(y1=0;y1 VC++ int xoffset=0,yoffset=0; BOOL Translation(HWND hwnd) DLGPROC dlginputbox = NULL; DWORD OffBits,BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; int SrcX0,SrcY0,SrcX1,SrcY1,DstX0,DstY0,DstX1,DstY1; int RectWidth,RectHeight; BOOL xvisible,yvisible; HDC hdc; HFILE hf; int i; // x xoffset y yoffset dlginputbox = (DLGPROC) MakeProcInstance ( (FARPROC)InputBox, ghinst ); DialogBox (ghinst, "INPUTBOX", hwnd, dlginputbox); FreeProcInstance ( (FARPROC) dlginputbox );
54 //OffBits BITMAPINFOHEADER OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // // if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // //lpimgdata lpimgdata=(lpbitmapinfoheader)globallock(himgdata); //lptempimgdata lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); lpptr=(char *)lpimgdata; lptempptr=(char *)lptempimgdata; // 255 memset(lptempptr,(byte)255,bufsize); // memcpy(lptempptr,lpptr,offbits); xvisible=true; //xvisible FALSE x if( xoffset<= -bi.biwidth ) xvisible=false; else if( xoffset<=0) DstX0=0; // x DstX1=bi.biWidth+xOffset; // x else if ( xoffset<= -bi.biheight ) yvisible=false; else if( yoffset<=0) DstY0=0; // y DstY1=bi.biHeight+yOffset; // y else if ( yoffset
55 VC++ #define PI #define RADIAN(angle) ((angle)*pi/180.0) // BOOL Rotation(HWND hwnd) DLGPROC dlginputbox = NULL; DWORD OffBits,SrcBufSize,DstBufSize,DstLineBytes; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; float SrcX1,SrcY1,SrcX2,SrcY2,SrcX3,SrcY3,SrcX4,SrcY4; float DstX1,DstY1,DstX2,DstY2,DstX3,DstY3,DstX4,DstY4; DWORD Wold,Hold,Wnew,Hnew; HDC hdc; HFILE hf; DWORD x0,y0,x1,y1; float cosa,sina; //cos(a),sin(a) float num1,num2; BITMAPFILEHEADER DstBf; BITMAPINFOHEADER DstBi; // dlginputbox = (DLGPROC) MakeProcInstance ( (FARPROC)InputBox, ghinst ); DialogBox (ghinst, "INPUTBOX", hwnd, dlginputbox); FreeProcInstance ( (FARPROC) dlginputbox ); // RotateAngle=(float)RADIAN(RotateAngle); cosa=(float)cos((double)rotateangle); sina=(float)sin((double)rotateangle); // Wold=bi.biWidth; Hold=bi.biHeight; // SrcX1=(float)(-0.5*Wold); SrcY1=(float)(0.5*Hold); SrcX2=(float)(0.5*Wold); SrcY2=(float)(0.5*Hold); SrcX3=(float)(-0.5*Wold);
56 SrcY3=(float)(-0.5*Hold); SrcX4=(float)(0.5*Wold); SrcY4=(float)(-0.5*Hold); // DstX1=cosa*SrcX1+sina*SrcY1; DstY1=-sina*SrcX1+cosa*SrcY1; DstX2=cosa*SrcX2+sina*SrcY2; DstY2=-sina*SrcX2+cosa*SrcY2; DstX3=cosa*SrcX3+sina*SrcY3; DstY3=-sina*SrcX3+cosa*SrcY3; DstX4=cosa*SrcX4+sina*SrcY4; DstY4=-sina*SrcX4+cosa*SrcY4; // Wnew = (DWORD)(max(fabs(DstX4-DstX1), fabs(dstx3-dstx2))+0.5); Hnew = (DWORD)(max(fabs(DstY4-DstY1), fabs(dsty3-dsty2))+0.5); // 9 num1=(float)( -0.5*Wnew*cosa-0.5*Hnew*sina+0.5*Wold); num2=(float)(0.5*wnew*sina-0.5*hnew*cosa+0.5*hold); //OffBits BITMAPINFOHEADER OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); SrcBufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // ImgWidth=Wnew; ImgHeight=Hnew; // DstLineBytes=(DWORD)WIDTHBYTES(Wnew*bi.biBitCount); DstBufSize=(DWORD)(sizeof(BITMAPINFOHEADER)+NumColors*sizeof(R GBQUAD)+ (DWORD)DstLineBytes*Hnew); // // if((htempimgdata=localalloc(lhnd,dstbufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; // //lpimgdata lpimgdata=(lpbitmapinfoheader)globallock(himgdata); //lptempimgdata lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); lpptr=(char *)lpimgdata; lptempptr=(char *)lptempimgdata; // 255
57 memset(lptempptr,(byte)255,dstbufsize); // memcpy(lptempptr,lpptr,offbits); // BITMAPFILEDER BITMAPINFOHERDER memcpy((char *)&DstBf,(char *)&bf,sizeof(bitmapfileheader)); memcpy((char *)&DstBi,(char *)&bi,sizeof(bitmapinfoheader)); // DstBf.bfSize=DstBufSize+sizeof(BITMAPFILEHEADER); DstBi.biWidth=Wnew; DstBi.biHeight=Hnew; // BITMAPINFOHERDER memcpy(lptempptr,(char *)&DstBi,sizeof(BITMAPINFOHEADER)); for(y1=0;y1=0) && (x0=0) && (y0 VC++ BOOL Mirror(HWND hwnd,bool XDirection) //Xdirection TRUE //FALSE DWORD OffBits,BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf; LONG x0,y0,x1,y1; OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); lpptr=(char *)lpimgdata; lptempptr=(char *)lptempimgdata;
58 memset(lptempptr,(byte)255,bufsize); memcpy(lptempptr,lpptr,offbits); if( XDirection) // for(y1=0;y1 VC++ float ZoomRatio=0.25f; // 0.25 BOOL Zoom(HWND hwnd) DLGPROC dlginputbox = NULL; DWORD OffBits,SrcBufSize,DstBufSize,DstLineBytes; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; DWORD Wold,Hold,Wnew,Hnew; HDC hdc; HFILE hf; DWORD x0,y0,x1,y1; float num1; BITMAPFILEHEADER DstBf; BITMAPINFOHEADER DstBi; // dlginputbox = (DLGPROC) MakeProcInstance ( (FARPROC)InputBox, ghinst ); DialogBox (ghinst, "INPUTBOX", hwnd, dlginputbox); FreeProcInstance ( (FARPROC) dlginputbox ); num1=(float)(1.0/zoomratio); // Wold=bi.biWidth; Hold=bi.biHeight; // Wnew = (DWORD)(Wold*ZoomRatio+0.5); Hnew = (DWORD)(Hold*ZoomRatio+0.5); OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); SrcBufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); ImgWidth=Wnew; ImgHeight=Hnew; DstLineBytes=(DWORD)WIDTHBYTES(Wnew*bi.biBitCount);
59 DstBufSize=(DWORD)(sizeof(BITMAPINFOHEADER)+NumColors*sizeof(R GBQUAD)+ (DWORD)DstLineBytes*Hnew); if((htempimgdata=localalloc(lhnd,dstbufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata); lpptr=(char *)lpimgdata; lptempptr=(char *)lptempimgdata; memset(lptempptr,(byte)255,dstbufsize); memcpy(lptempptr,lpptr,offbits); // memcpy((char *)&DstBf,(char *)&bf,sizeof(bitmapfileheader)); memcpy((char *)&DstBi,(char *)&bi,sizeof(bitmapinfoheader)); DstBf.bfSize=DstBufSize+sizeof(BITMAPFILEHEADER); DstBi.biWidth=Wnew; DstBi.biHeight=Hnew; memcpy(lptempptr,(char *)&DstBi,sizeof(BITMAPINFOHEADER)); for(y1=0;y1<hnew;y1++) for(x1=0;x1<wnew;x1++) x0= (DWORD)(x1*num1); y0= (DWORD)(y1*num1); if( (x0>=0) && (x0<wold) && (y0>=0) && (y0<hold)) lpptr=(char *)lpimgdata+(srcbufsize-linebytes-y0*linebytes)+x0; lptempptr=(char *)lptempimgdata+(dstbufsize -DstLineBytes-y1*DstLineBytes)+x1; *lptempptr=*lpptr; hdc=getdc(hwnd); if(hbitmap!=null) DeleteObject(hBitmap); hbitmap=createdibitmap(hdc, (LPBITMAPINFOHEADER)lpTempImgData, (LONG)CBM_INIT, ()lptempimgdata+sizeof(bitmapinfo HEADER) +NumColors*sizeof(RGBQUAD), (LPBITMAPINFO)lpTempImgData, DIB_RGB_COLORS); hf=_lcreat("c:\\zoom.bmp",0);
60 _lwrite(hf,()&dstbf,sizeof(bitmapfileheader)); _lwrite(hf,()lptempimgdata,dstbufsize); _lclose(hf); ReleaseDC(hWnd,hDc); LocalUnlock(hTempImgData); LocalFree(hTempImgData); GlobalUnlock(hImgData); return TRUE; Hori BOOL MedianFilter(HWND hwnd,bool Hori) DWORD OffBits,BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc; HFILE hf; LONG x,y; int g,g1,g2,g3; //OffBits BITMAPINFOHEADER OffBits=bf.bfOffBits-sizeof(BITMAPFILEHEADER); BufSize=bf.bfSize-sizeof(BITMAPFILEHEADER); // if((htempimgdata=localalloc(lhnd,bufsize))==null) MessageBox(hWnd,"Error alloc memory!","error Message",MB_OK MB_ICONEXCLAMATION); return FALSE; lpimgdata=(lpbitmapinfoheader)globallock(himgdata); lptempimgdata=(lpbitmapinfoheader)locallock(htempimgdata);
61
62 3*3 #define TEMPLATE_SMOOTH_BOX 1 //Box #define TEMPLATE_SMOOTH_GAUSS 2 // #define TEMPLATE_SHARPEN_LAPLACIAN 3 // int Template_Smooth_Box[9]=1,1,1,1,1,1,1,1,1; int Template_Smooth_Gauss[9]=1,2,1,2,4,2,1,2,1; int Template_Sharpen_Laplacian[9]=-1,-1,-1,-1,9,-1,-1,-1,-1; ////////////////////////////////////////////////////////////// BOOL TemplateOperation(HWND hwnd, int TemplateType) DWORD OffBits,BufSize; LPBITMAPINFOHEADER lpimgdata; lpptr; HLOCAL htempimgdata; LPBITMAPINFOHEADER lptempimgdata; lptempptr; HDC hdc;
delete pdata; pdata=null; if(m_pbmi!=null) delete m_pbmi; m_pbmi=null; if(pfi!=null) delete pfi; pfi=null; CAvi::CAviCreate(CString &string)// 读文件初始化该
利用 Visual C++ 实现 AVI 文件的图像截取 AVI 文件就是我们所说的多媒体文件, 所谓的 AVI 图像就是视频图像, 该文件是一个 RIFF 说明文件, 它用于获取 编辑 演示音频 视频序列 一般的 AVI 文件包含音频流和视频流, 有的特殊的 AVI 还包含一个控制路径或 MIDI 路径作为附加的数据流 现在播放 AVI 文件的软件很多, 但大多无法从 AVI 视频文件中读取一帧图像并生成
More informationebook50-11
11 Wi n d o w s C A D 53 M F C 54 55 56 57 58 M F C 11.1 53 11-1 11-1 MFC M F C C D C Wi n d o w s Wi n d o w s 4 11 199 1. 1) W M _ PA I N T p W n d C W n d C D C * p D C = p W n d GetDC( ); 2) p W n
More information概述
OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3
More informationc.doc
如 何 显 示 位 图 2002-11-4 17:09:05 PCVC.NET 贾 旭 滨 ( 译 ) 阅 读 次 数 : 14345 // 原 著 :joes Tomas // 译 者 : 重 庆 大 学 光 电 工 程 学 院 贾 旭 滨 // 欢 迎 批 评 指 教, 谢 谢! 位 图 文 件 是 分 成 4 部 分 的 第 一 部 分 是 位 图 文 件 头, 它 包 括 位 图 文 件 名,
More informationint *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;
Memory & Pointer trio@seu.edu.cn 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,
More information概述
OPC Version 1.8 build 0925 KOCRDK Knight OPC Client Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOC_Init...5 2.2.2 KOC_Uninit...5 2.3...5
More informationCC213
: (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,
More informationFY.DOC
高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主
More informationINTRODUCTION TO COM.DOC
How About COM & ActiveX Control With Visual C++ 6.0 Author: Curtis CHOU mahler@ms16.hinet.net This document can be freely release and distribute without modify. ACTIVEX CONTROLS... 3 ACTIVEX... 3 MFC ACTIVEX
More informationMicrosoft Word - CIN-DLL.doc
6.3. 调 用 动 态 链 接 库 (DLL) 相 对 于 CIN 来 讲,NI 更 推 荐 用 户 使 用 DLL 来 共 享 基 于 文 本 编 程 语 言 开 发 的 代 码 除 了 共 享 或 重 复 利 用 代 码, 开 发 人 员 还 能 利 用 DLL 封 装 软 件 的 功 能 模 块, 以 便 这 些 模 块 能 被 不 同 开 发 工 具 利 用 在 LabVIEW 中 使 用
More informationuntitled
1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override
More information<4D F736F F D20CAFDD7D6CDBCCFF1B4A6C0EDB1E0B3CCC8EBC3C52E646F63>
数字图像处理编程入门 前言 当你看到那些用 PhotoShop 或 Corel PhotoPaint 等软件绘制出的精美图片, 并被它们表现出的神奇效果所折服时, 是否曾想到做一个自己的图象处理软件? 就象 PhotoShop 那样 怎么可能, 吹牛吧! 你一定会这么说 呵呵, 别着急, 待我慢慢讲来 我是一名清华大学计算机系的研究生, 一直对图象处理 多媒体的东西非常着迷, 选修过不少这方面的课程,
More information新版 明解C++入門編
511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,
More information四川省普通高等学校
四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9
More informationC/C++ - 文件IO
C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;
More information提问袁小兵:
C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.
More informationuntitled
3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(
More informationVB程序设计教程
高 等 学 校 教 材 Visual Basic 程 序 设 计 教 程 魏 东 平 郑 立 垠 梁 玉 环 石 油 大 学 出 版 社 内 容 提 要 本 书 是 按 高 等 学 校 计 算 机 程 序 设 计 课 程 教 学 大 纲 编 写 的 大 学 教 材, 主 要 包 括 VB 基 础 知 识 常 用 程 序 结 构 和 算 法 Windows 用 户 界 面 设 计 基 础 文 件 处
More informationC 1
C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=
More informationuntitled
不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int
More information(HMI) IO A
6.5 6.5 (HMI) IO 6.52 6.52 6.5 2007 113 A 602 100086 010 82616619 010 62638166 www.kingview.com 4 7 25 38 43 52 63 68 86 SQL 95 99 WEB 105 Web Web Web I/O Microsoft Windows XP/NT/2000 I/O PLC PLC PLC PLC
More informationC/C++程序设计 - 字符串与格式化输入/输出
C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int
More informationBOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2
PowerBuilder 9 PowerBuilder Native Interface(PBNI) PowerBuilder 9 PowerBuilder C++ Java PowerBuilder 9 PBNI PowerBuilder Java C++ PowerBuilder NVO / PowerBuilder C/C++ PowerBuilder 9.0 PowerBuilder Native
More informationC PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha
CYPOK CYPOK 1 UltraEdit Project-->Install Language Tool: Language Suite----->hi-tech picc Tool Name ---->PICC Compiler Executable ---->c:hi-picinpicc.exe ( Command-line Project-->New Project-->File Name--->myc
More information3.1 num = 3 ch = 'C' 2
Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:
More informationuntitled
1 行 行 行 行.NET 行 行 類 來 行 行 Thread 類 行 System.Threading 來 類 Thread 類 (1) public Thread(ThreadStart start ); Name 行 IsAlive 行 行狀 Start 行 行 Suspend 行 Resume 行 行 Thread 類 (2) Sleep 行 CurrentThread 行 ThreadStart
More informationuntitled
XP248 1 XP248 XP248 DCS PLC SCnet SCnet DCS SCnet DCS 1.1 XP248 Modbus HostLink Modbus XP248 4 DB25 XP248 MODBUS XP248 SCControl XP248 4 RS232 RS485 4 32 XP248 COM0-COM1 COM2-COM3 1200 19200bit/s 5 8 1
More informationMicrosoft Word - 01.DOC
第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的
More information全国计算机技术与软件专业技术资格(水平)考试
全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明
More informationuntitled
1 DBF (READDBF.C)... 1 2 (filetest.c)...2 3 (mousetes.c)...3 4 (painttes.c)...5 5 (dirtest.c)...9 6 (list.c)...9 1 dbf (readdbf.c) /* dbf */ #include int rf,k,reclen,addr,*p1; long brec,erec,i,j,recnum,*p2;
More information<4D6963726F736F667420576F7264202D20C8EDC9E82DCFC2CEE7CCE22D3039C9CF>
全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 考 试 2009 年 上 半 年 软 件 设 计 师 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 请 按 下 述 要 求 正 确 填 写 答 题 纸 1. 在 答 题 纸 的 指 定 位 置 填 写 你 所 在 的 省 自 治 区 直 辖 市 计 划 单 列 市 的 名 称 2. 在 答
More information高尔夫赌博现金棋牌,能赚现金的棋牌游戏 街机赌博游戏 真钱的棋牌游戏,30
高 尔 夫 赌 博 现 金 棋 牌, 能 赚 现 金 的 棋 牌 游 戏 街 机 赌 博 游 戏 真 钱 的 棋 牌 游 戏,30 108 http://www.3-pointdriving.com 高 尔 夫 赌 博 现 金 棋 牌, 能 赚 现 金 的 棋 牌 游 戏 街 机 赌 博 游 戏 真 钱 的 棋 牌 游 戏,30 可 以 参 加 这 斗 地 主 和 麻 将 中 的 免 费 赢 奖 品
More informationMicrosoft PowerPoint - ds-1.ppt [兼容模式]
http://jwc..edu.cn/jxgl/ HomePage/Default.asp 2 说 明 总 学 时 : 72( 学 时 )= 56( 课 时 )+ 16( 实 验 ) 行 课 时 间 : 第 1 ~14 周 周 学 时 : 平 均 每 周 4 学 时 上 机 安 排 待 定 考 试 时 间 : 课 程 束 第 8 11 12 章 的 内 容 为 自 学 内 容 ; 目 录 中 标 有
More information1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File
51 C 51 51 C C C C C C * 2003-3-30 pnzwzw@163.com C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test
More information6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit
6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128
More informationnooog
C : : : , C C,,, C, C,, C ( ), ( ) C,,, ;,, ; C,,, ;, ;, ;, ;,,,, ;,,, ; : 1 9, 2 3, 4, 5, 6 10 11, 7 8, 12 13,,,,, 2008 1 1 (1 ) 1.1 (1 ) 1.1.1 ( ) 1.1.2 ( ) 1.1.3 ( ) 1.1.4 ( ) 1.1.5 ( ) 1.2 ( ) 1.2.1
More information51 C 51 isp 10 C PCB C C C C KEIL
http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom
More informationC/C++语言 - C/C++数据
C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;
More information,, 1 ( ) 1 / CurrentSeries Int ConnectionString CString Style3D BOOL IsContinue Graph BOOL LegendType Int SeriesName CString SeriesColor OL E
2007 9 12 5 JOURNAL OF XI AN UN IV ERSITY OF POST AND TEL ECOMMUN ICA TIONS Sep12007 Vol112 No15 TeeChart (, 710121) : ActiveX TeeChart, Visual C + +,,,, :ActiveX ;;Visual C + + : TP311. 1 :A :1007-3264
More informationMicrosoft Word - ch04三校.doc
4-1 4-1-1 (Object) (State) (Behavior) ( ) ( ) ( method) ( properties) ( functions) 4-2 4-1-2 (Message) ( ) ( ) ( ) A B A ( ) ( ) ( YourCar) ( changegear) ( lowergear) 4-1-3 (Class) (Blueprint) 4-3 changegear
More information新・明解C言語入門編『索引』
!... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177
More informationuntitled
MODBUS 1 MODBUS...1 1...4 1.1...4 1.2...4 1.3...4 1.4... 2...5 2.1...5 2.2...5 3...6 3.1 OPENSERIAL...6 3.2 CLOSESERIAL...8 3.3 RDMULTIBIT...8 3.4 RDMULTIWORD...9 3.5 WRTONEBIT...11 3.6 WRTONEWORD...12
More information, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1
21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414
More information目錄
資 訊 素 養 線 上 教 材 單 元 五 資 料 庫 概 論 及 Access 5.1 資 料 庫 概 論 5.1.1 為 什 麼 需 要 資 料 庫? 日 常 生 活 裡 我 們 常 常 需 要 記 錄 一 些 事 物, 以 便 有 朝 一 日 所 記 錄 的 事 物 能 夠 派 得 上 用 場 我 們 能 藉 由 記 錄 每 天 的 生 活 開 銷, 就 可 以 在 每 個 月 的 月 底 知
More informationC C
C C 2017 3 8 1. 2. 3. 4. char 5. 2/101 C 1. 3/101 C C = 5 (F 32). 9 F C 4/101 C 1 // fal2cel.c: Convert Fah temperature to Cel temperature 2 #include 3 int main(void) 4 { 5 float fah, cel; 6 printf("please
More informationWWW PHP Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2
WWW PHP 2003 1 Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2 Comments PHP Shell Style: # C++ Style: // C Style: /* */ $value = $p * exp($r * $t); # $value
More informationepub 33-8
8 1) 2) 3) A S C I I 4 C I / O I / 8.1 8.1.1 1. ANSI C F I L E s t d i o. h typedef struct i n t _ f d ; i n t _ c l e f t ; i n t _ m o d e ; c h a r *_ n e x t ; char *_buff; /* /* /* /* /* 1 5 4 C FILE
More informationTwinCAT 1. TwinCAT TwinCAT PLC PLC IEC TwinCAT TwinCAT Masc
TwinCAT 2001.12.11 TwinCAT 1. TwinCAT... 3 2.... 4... 4...11 3. TwinCAT PLC... 13... 13 PLC IEC 61131-3... 14 4. TwinCAT... 17... 17 5. TwinCAT... 18... 18 6.... 19 Maschine.pro... 19... 27 7.... 31...
More informationuntitled
A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (
More information第3章.doc
3 3 3 3.1 3 IT Trend C++ Java SAP Advantech ERPCRM C++ C++ Synopsys C++ NEC C C++PHP C++Java C++Java VIA C++ 3COM C++ SPSS C++ Sybase C++LinuxUNIX Motorola C++ IBM C++Java Oracle Java HP C++ C++ Yahoo
More informationuntitled
1 Access 料 (1) 立 料 [] [] [ 料 ] 立 料 Access 料 (2) 料 [ 立 料 ] Access 料 (3) 料 料 料 料 料 料 欄 ADO.NET ADO.NET.NET Framework 類 來 料 料 料 料 料 Ex MSSQL Access Excel XML ADO.NET 連 .NET 料.NET 料 料來 類.NET Data Provider
More information基于ECO的UML模型驱动的数据库应用开发1.doc
ECO UML () Object RDBMS Mapping.Net Framework Java C# RAD DataSetOleDbConnection DataGrod RAD Client/Server RAD RAD DataReader["Spell"].ToString() AObj.XXX bug sql UML OR Mapping RAD Lazy load round trip
More informationuntitled
1 LinkButton LinkButton 連 Button Text Visible Click HyperLink HyperLink 來 立 連 Text ImageUrl ( ) NavigateUrl 連 Target 連 _blank _parent frameset _search _self 連 _top 例 sample2-a1 易 連 private void Page_Load(object
More information<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074>
程 序 设 计 实 习 INFO130048 3-2.C++ 面 向 对 象 程 序 设 计 重 载 继 承 多 态 和 聚 合 复 旦 大 学 计 算 机 科 学 与 工 程 系 彭 鑫 pengxin@fudan.edu.cn 内 容 摘 要 方 法 重 载 类 的 继 承 对 象 引 用 和 拷 贝 构 造 函 数 虚 函 数 和 多 态 性 类 的 聚 集 复 旦 大 学 计 算 机 科 学
More informationImportant Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO
Car DVD New GUI IR Flow User Manual V0.1 Jan 25, 2008 19, Innovation First Road Science Park Hsin-Chu Taiwan 300 R.O.C. Tel: 886-3-578-6005 Fax: 886-3-578-4418 Web: www.sunplus.com Important Notice SUNPLUS
More information消防论文(二)
( 20 010010) 787 1092 32 227.50 2004 12 1 2004 12 1 1 1 000 396.00 ( 19.80 ) ...1...19...21...23...37...39...45...48...53...57...61...72...80...82...85 CX...99... 112 I ... 117... 124... 129... 136...
More information1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F
1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o
More informationepub83-1
C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C
More informationuntitled
1 .NET 料.NET 料 料來 類.NET Data Provider SQL.NET Data Provider System.Data.SqlClient 料 MS-SQL OLE DB.NET Data Provider System.Data.OleDb 料 Dbase FoxPro Excel Access Oracle Access ODBC.NET Data Provider 料
More informationUser
Visual C++ 数字图像处理 广义地讲, 凡是记录在纸介质上的 拍摄在底片和照片上的 显示在电视 投影仪和计算机屏幕上的所有具有视觉效果的画面都可以称为图像 根据图像记录方式的不同, 图像可分为两大类 : 一类是模拟图像 (Analog Image), 另一类是数字图像 (Digital Image) 模拟图像是通过某种物理量 ( 光 电等 ) 的强弱变化来记录图像上各点的亮度信息的, 例如模拟电视图像
More informationVisual C++ 1 Page no. 1
Visual C++ 1 Page no. 1 Visual C++ 2 Page no. 2 Visual C++ 3 Page no. 3 Visual C++ 4 Page no. 4 Visual C++ 5 Page no. 5 Visual C++ 6 Page no. 6 Visual C++ 7 Page no. 7 Visual C++ 8 Page no. 8 Visual C++
More information<4D6963726F736F667420576F7264202D20C9CFBAA3CAD0BCC6CBE3BBFAB5C8BCB6BFBCCAD4C8FDBCB6BFBCCAD4B4F3B8D95FBDA8D2E9B8E55F5F303632352E646F63>
上 海 市 高 等 学 校 计 算 机 等 级 考 试 ( 三 级 ) 考 试 大 纲 -- 建 议 稿 -- 2007-6-25 25 目 录 上 海 市 高 等 学 校 计 算 机 等 级 考 试 三 级 总 体 说 明 -----------------1 三 级 ( 计 算 机 系 统 与 网 络 技 术 ) 考 试 大 纲 ---------------------2 三 级 ( 管 理
More informationebook51-14
14 Wi n d o w s M F C 53 54 55 56 ( ) ( Wo r k e r T h r e a d ) 57 ( ) ( U s e r Interface Thread) 58 59 14.1 53 1. 2. C l a s s Wi z a r d O n I d l e () 3. Class Wi z a r d O n I d l e () O n I d l
More information致理技術學院
致 理 技 術 學 院 商 務 科 技 管 理 系 實 務 專 題 報 告 彩 繪 指 甲 預 覽 系 統 指 導 老 師 : 彭 建 文 博 士 學 生 : 蕭 全 佑 (19833150) 鄭 任 翔 (19833111) 林 育 璇 (19833114) 中 華 民 國 101 年 12 月 致 理 技 術 學 院 商 務 科 技 管 理 系 實 務 專 題 報 告 彩 繪 指 甲 預 覽 系
More informationSimulator By SunLingxi 2003
Simulator By SunLingxi sunlingxi@sina.com 2003 windows 2000 Tornado ping ping 1. Tornado Full Simulator...3 2....3 3. ping...6 4. Tornado Simulator BSP...6 5. VxWorks simpc...7 6. simulator...7 7. simulator
More informationRUN_PC連載_12_.doc
PowerBuilder 8 (12) PowerBuilder 8.0 PowerBuilder PowerBuilder 8 PowerBuilder 8 / IDE PowerBuilder PowerBuilder 8.0 PowerBuilder PowerBuilder PowerBuilder PowerBuilder 8.0 PowerBuilder 6 PowerBuilder 7
More information避孕篇
避 孕 篇 生 育 后 时 期 的 避 孕 方 法 : 适 用 的 方 法 : 1) 宫 内 节 育 器 类 : 金 属 环 可 放 置 15 年 左 右 ;V 型 环 可 放 置 5-7 年 ;T 型 环 可 放 置 10-15 年 2) 避 孕 药 ( 针 ) 类 : 各 种 短 效 口 服 避 孕 药, 如 妈 富 隆 敏 定 偶 三 相 片 及 达 英 -35 等, 按 规 定 方 法 服
More informationStrings
Inheritance Cheng-Chin Chiang Relationships among Classes A 類 別 使 用 B 類 別 學 生 使 用 手 機 傳 遞 訊 息 公 司 使 用 金 庫 儲 存 重 要 文 件 人 類 使 用 交 通 工 具 旅 行 A 類 別 中 有 B 類 別 汽 車 有 輪 子 三 角 形 有 三 個 頂 點 電 腦 內 有 中 央 處 理 單 元 A
More informationC/C++ 语言 - 循环
C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf
More information上海市教育考试院关于印发新修订的
沪 教 考 院 社 考 2012 7 号 上 海 市 教 育 考 试 院 关 于 印 发 上 海 市 高 等 学 校 计 算 机 等 级 考 试 大 纲 (2012 年 修 订 ) 的 通 知 各 有 关 高 校 : 为 进 一 步 加 强 本 市 高 校 计 算 机 基 础 教 学 工 作, 推 进 学 校 更 加 科 学 合 理 地 设 置 计 算 机 基 础 课 程 及 安 排 教 学 内 容,
More information( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)
( CIP) /. :, 2005. 2 ( ) ISBN 7-5624-3339-9.......... TP311. 1 CIP ( 2005) 011794 : : : : * : : 174 ( A ) :400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / /www. cqup. com. cn : fxk@cqup.
More informationC C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40
C C trio@seu.edu.cn C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer
More informationMicrosoft Word - 实用案例.doc
计 算 机 系 统 应 用 2009 年 第 12 期 嵌 入 式 Linux 下 温 湿 度 传 感 器 的 设 计 与 实 现 1 Design and Implementation of Temperature and Humidity Sensor Based on Embedded Linux 陈 博 刘 锦 高 ( 华 东 师 范 大 学 电 子 科 学 技 术 系 上 海 200241)
More informationebook39-5
5 3 last-in-first-out, LIFO 3-1 L i n e a r L i s t 3-8 C h a i n 3 3. 8. 3 C + + 5.1 [ ] s t a c k t o p b o t t o m 5-1a 5-1a E D 5-1b 5-1b E E 5-1a 5-1b 5-1c E t o p D t o p D C C B B B t o p A b o
More information1
1 2 3 4 5 GNUDebugger 6 7 void main(int argc, char **argv){ vulncpy(argv[1]); return; } void vulncpy(char *a){ char buf[30]; strcpy(buf, a); return; } *argv[1] buf Shellcode *argv[1]... &buf &buf 8 strcpy
More informationuntitled
CHAPTER 02 2 CHAPTER 2-1 2-4 2-2 2-5 2-3 2-6 2-1 2-1-1 2-2 02 int A[3] = {10, 20, 30; A[0] 10 A[1] 20 A[2] 30 int *pa[3], A[3]; C 3 pa pa[0]pa[1]pa[2] 3 A A[0]A[1]A[2] 3 A A[0] A + i A[i] A + i &A[i]*(A
More informationMicrosoft Word - CPE考生使用手冊160524.docx
大 學 程 式 能 力 檢 定 (CPE) 考 生 使 用 手 冊 2016 年 5 月 24 日 這 份 手 冊 提 供 給 參 加 CPE 檢 定 考 試 的 考 生 內 容 包 含 考 試 環 境 的 使 用, 以 及 解 題 時 所 使 用 I/O 的 基 本 知 識 1. 如 欲 報 名 參 加 CPE 考 試, 請 先 於 CPE 網 站 完 成 帳 號 註 冊, 然 後 再 報 名 該
More informationbingdian001.com
1. DLL(Dynamic Linkable Library) DLL ± lib EXE DLL DLL EXE EXE ± EXE DLL 1 DLL DLL DLL Windows DLL Windows API Visual Basic Visual C++ Delphi 2 Windows system32 kernel32.dll user32.dll gdi32.dll windows
More informationMicrosoft Word - 2008年9月二级C真卷.doc
机 密 启 用 前 2008 年 9 月 全 国 计 算 机 等 级 考 试 二 级 笔 试 试 卷 C 语 言 程 序 设 计 24 注 意 事 项 一 考 生 应 严 格 遵 守 考 场 规 则, 得 到 监 考 人 员 指 令 后 方 可 作 答 二 考 生 拿 到 试 卷 后 应 首 先 将 自 己 的 姓 名 准 考 证 号 等 内 容 涂 写 在 答 题 卡 的 相 应 位 置 上 三
More information第5章修改稿
(Programming Language), ok,, if then else,(), ()() 5.0 5.0.0, (Variable Declaration) var x : T x, T, x,,,, var x : T P = x, x' : T P P, () var x:t P,,, yz, var x : int x:=2. y := x+z = x, x' : int x' =2
More information三維空間之機械手臂虛擬實境模擬
VRML Model of 3-D Robot Arm VRML Model of 3-D Robot Arm MATLAB VRML MATLAB Simulink i MATLAB Simulink V-Realm Build Joystick ii Abstract The major purpose of this thesis presents the procedure of VRML
More information(Microsoft Word - Motion Program \270\305\264\272\276\363 \307\245\301\366 \271\327 \270\361\302\367.doc)
: TBFAT-G5MP-MN004-11 1 GX Series PLC Program Manual 2 GX Series PLC Program Manual Contents Contents...3 1... 1-1 1.1... 1-2 1.2... 1-3 1.2.1... 1-3 1.2.2... 1-4 1.2.3... 1-4 1.2.4... 1-6 1.3... 1-7 1.3.1...
More information穨complete.PDF
1 2 3 4 1.1 PC 3D -- DirectX 5 1.2 RPG -- VC++ DirectX VC++ DirectX 360 : 6 7 8 9 2.2 10 11 12 13 2.3 14 RPG RPG Map_Struct Map[MAPS] MAPS Scene MakeBackGround() MakeBackGround Blt Blt Windows PatBltpattern
More information基于UML建模的管理管理信息系统项目案例导航——VB篇
PowerBuilder 8.0 PowerBuilder 8.0 12 PowerBuilder 8.0 PowerScript PowerBuilder CIP PowerBuilder 8.0 /. 2004 21 ISBN 7-03-014600-X.P.. -,PowerBuilder 8.0 - -.TP311.56 CIP 2004 117494 / / 16 100717 http://www.sciencep.com
More informationbingdian001.com
2016 14 1.5 21 1. 50% 20% 5% 10% A.2 B.10.5 C.10 D.2.1 A = 1/ - =50%20%/10%5%=2 2. 2015 1 1.2 1.5 2016 1.9 2015 A.50% B.90% C.75% D.60% A = / = =1.2 1.5=1.8 2016 =1.9-1 /1=0.9 =0.9/1.8=50% 3. A. B. C.
More informationmvc
Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication
More informationSmart Platform设计与实现技术报告.doc
Smart Platform Smart Platform Smart Platform Directory Service Container Blackboard Facilitator 1 Smart Platform Smart Platform Agent Container Agent Smart Platform Directory Service Directory Service(
More information多層次傳銷與獎金系統
醒 吾 技 術 學 院 資 訊 管 理 系 ( 五 專 部 ) 九 十 六 學 年 度 畢 業 專 題 多 層 次 傳 銷 與 獎 金 系 統 組 員 : 921506122 游 濬 瑋 921506126 陳 彥 宇 921506139 林 龍 華 921506144 陳 昶 志 921506149 楊 璧 如 指 導 老 師 : 汪 淵 老 師 中 華 民 國 九 十 七 年 一 月 十 一 醒
More information引言
BELL 18% 15% 50% 20% BELL 10% 2. 2.1. < 1> 4 TAB < 2> > (1) printf("%d %d %d", a, b, c); (2), "=" "+=" "+" "%" "&&" "&" "
More informationPython a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2
Chapter 02 變數與運算式 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.2 2.2.1 2.2.2 2.2.3 type 2.2.4 2.3 2.3.1 print 2.3.2 input 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 + 2.4.6 Python Python 2.1 2.1.1 a p p l e b e a r c 65438790
More informationbingdian001.com
TSM12M TSM12 STM8L152C6, STM8L152R8 MSP430F5325 whym1987@126.com! /******************************************************************************* * : TSM12.c * : * : 2013/10/21 * : TSM12, STM8L f(sysclk)
More information<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344>
1. 請 問 誰 提 出 積 體 電 路 (IC) 上 可 容 納 的 電 晶 體 數 目, 約 每 隔 24 個 月 (1975 年 更 改 為 18 個 月 ) 便 會 增 加 一 倍, 效 能 也 將 提 升 一 倍, 也 揭 示 了 資 訊 科 技 進 步 的 速 度? (A) 英 特 爾 (Intel) 公 司 創 始 人 戈 登. 摩 爾 (Gordon Moore) (B) 微 軟 (Microsoft)
More information华恒家庭网关方案
LINUX V1.5 1 2 1 2 LINUX WINDOWS PC VC LINUX WINDOWS LINUX 90% GUI LINUX C 3 REDHAT 9 LINUX PC TFTP/NFS http://www.hhcn.com/chinese/embedlinux-res.html minicom NFS mount C HHARM9-EDU 1 LINUX HHARM9-EDU
More information学习MSP430单片机推荐参考书
MSP430 16 MSP430 C MSP430 C MSP430 FLASH 16 1 CPU 16 ALU 16 PC SP SR R4~R15 2 3 00-FFH 100-1FFH 4 5 1 2 51 24 27 6 1 2 3 4 5 6 4 12 SR SP SR CPU SR CPU C Z N GIE CPUOff CPU OscOff SCG0 SCG1 CPU EXIT SP
More informationISA-9620用户手册.PDF
ISA-9620 CAN v1.0 2004 01 08-1 - -------------------------------------------------------1 -------------------------------------------------------1 -------------------------------------------------------1
More information1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10
Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1
More informationuntitled
1 1.1 1.2 1.3 1.4 1.5 ++ 1.6 ++ 2 BNF 3 4 5 6 7 8 1.2 9 1.2 IF ELSE 10 1.2 11 1.2 12 1.3 Ada, Modula-2 Simula Smalltalk-80 C++, Objected Pascal(Delphi), Java, C#, VB.NET C++: C OOPL Java: C++ OOPL C# C++
More informationebook
3 3 3.1 3.1.1 ( ) 90 3 1966 B e r n s t e i n P ( i ) R ( i ) W ( i P ( i P ( j ) 1) R( i) W( j)=φ 2) W( i) R( j)=φ 3) W( i) W( j)=φ 3.1.2 ( p r o c e s s ) 91 Wi n d o w s Process Control Bl o c k P C
More information