Compaq iPAQ h3760 Datenblatt Seite 30

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 75
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 29
ENEE408G Fall 2003 (Update 09/23/2003)
Mobile Computing and Pocket PC Programming
29
// TODO: Add extra initialization here
// Add you own initialization here Æ
bExistFile = FALSE;
//Å
return TRUE; // return TRUE unless you set the focus to a control
}
// #############################################
// ## Open File ##
// #############################################
void CImageProcPPCDlg::OnButtonOpenfile()
{
// TODO: Add your control notification handler code here
// Add your own codes here Æ
// Construct the Open File Window
CString strFilter = "Bitmap Files (*.bmp)|*.bmp|All Files (*.*) |*.*||";
CfileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY|OFN_EXPLORER, strFilter, NULL);
if (dlg.DoModal() == IDOK) { // if open file window works
if( m_pDib.Load(dlg.GetPathName()) == TRUE ){ // load Bitmap to DibSectionLite class
if( m_pDib.GetBitCount() != 24 ){ // currently, we only deal with 24 bps Bitmap
MessageBox(_T("Must be 24 bits"));
bExistFile = FALSE;
return;}
sz = m_pDib.GetSize(); // get dimension of bitmap and allocate memory for Image Processing
if( bExistFile == TRUE ){ // if a previous bitmap exists, delete the allocated memory and new one
delete[] dibit;}
else{ bExistFile = TRUE; }
dibit = new BYTE[3*sz.cx*sz.cy]; }}
else{ // if fail to open a file and load a bitmap
MessageBox(_T("Fail to load MBP"));
return; }
// Å
}
// #################################
// ## Save File ##
// #################################
void CImageProcPPCDlg::OnButtonSavefile()
{
// TODO: Add your control notification handler code here
// Add your own codes here Æ
// Construct the Save File Window
CString strFilter = "Bitmap Files (*.bmp)|*.bmp|All Files (*.*) |*.*||";
CfileDialog dlg(FALSE, NULL, NULL, OFN_HIDEREADONLY|OFN_EXPLORER, strFilter, NULL);
if( bExistFile == TRUE ){ // we cannot save a bitmap without any existing bitmap in memory
if (dlg.DoModal() == IDOK) {
if( m_pDib.Save(dlg.GetPathName()) == FALSE ){
MessageBox(_T("Fail to save MBP"));
return;}}}
// Å
}
// ###########################################################
// ## Image Processing ( display red component ) ##
// ###########################################################
void CImageProcPPCDlg::OnButtonRed()
{
// TODO: Add your control notification handler code here
// Add your own codes here Æ
long i;
Seitenansicht 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 74 75

Kommentare zu diesen Handbüchern

Keine Kommentare