📄 mv_skindlg.cpp
字号:
void CMv_skinDlg::OnRadioWqvga()
{
// TODO: Add your control notification handler code here
CWnd *pWnd;
lcd_size = LCD_SIZE_WQVGA;//WQVGA
show_skin_flag = 0;
pWnd = GetDlgItem( IDC_STATIC_LCD_SIZE );
pWnd->SetWindowPos( NULL,0,0,400,240,SWP_NOZORDER | SWP_NOMOVE );
set_update_area();
}
void CMv_skinDlg::OnButtonSelectPictureDir()
{
// TODO: Add your control notification handler code here
if( 0 != select_paths(m_dir_path))
{
UpdateData(FALSE);
}
GetDlgItem(IDC_EDIT_PICTURE_DIR)->SetWindowText(m_dir_path);
}
void CMv_skinDlg::OnButtonSelectAudioPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_AUDIO_BG_PICTURE, IMG_ID_MVPLY_AUDIO_BG);
}
void CMv_skinDlg::OnButtonSelectTitlePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_TITLE_PICTURE, IMG_ID_MVPLY_OSD_INFO_PANNEL);
}
void CMv_skinDlg::OnButtonSelectControlPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_CONTROL_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PANNEL);
}
void CMv_skinDlg::OnButtonSelectTitleBgPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_TITLE_BG_PICTURE, IMG_ID_MVPLY_OSD_TITLE_BG);
}
void CMv_skinDlg::OnButtonSelectTimeBgPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_TIME_BG_PICTURE, IMG_ID_MVPLY_OSD_CUR_TIME_BG);
}
void CMv_skinDlg::OnButtonSelectProgressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PROGRESS_BG_PICTURE, IMG_ID_MVPLY_OSD_BAR_BG);
}
void CMv_skinDlg::OnButtonSelectProgrssPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PROGRESS_PICTURE, IMG_ID_MVPLY_OSD_BAR_ACTIVE);
}
void CMv_skinDlg::OnButtonSelectRightProgrssPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_RIGHT_PROGRESS_PICTURE, IMG_ID_MVPLY_OSD_BAR_RIGHT);
}
void CMv_skinDlg::OnButtonSelectTextBgPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_TEXT_BG_PICTURE, IMG_ID_MVPLY_OSD_CENTER_BG);
}
void CMv_skinDlg::OnButtonSelectBrightnessNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_BRIGHTNESS_PICTURE, IMG_ID_MVPLY_OSD_CNTL_BRIGHTNESS);
}
void CMv_skinDlg::OnButtonSelectBrightnessPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_BRIGHTNESS_PICTURE, IMG_ID_MVPLY_OSD_CNTL_BRIGHTNESS_P);
}
void CMv_skinDlg::OnButtonSelectBrightnessDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_BRIGHTNESS_PICTURE, IMG_ID_MVPLY_OSD_CNTL_BRIGHTNESS_G);
}
void CMv_skinDlg::OnButtonSelectContrastNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_CONTRAST_PICTURE, IMG_ID_MVPLY_OSD_CNTL_CONTRAST);
}
void CMv_skinDlg::OnButtonSelectContrastPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_CONTRAST_PICTURE, IMG_ID_MVPLY_OSD_CNTL_CONTRAST_P);
}
void CMv_skinDlg::OnButtonSelectContrastDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_CONTRAST_PICTURE, IMG_ID_MVPLY_OSD_CNTL_CONTRAST_G);
}
void CMv_skinDlg::OnButtonSelectPlayNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PLAY_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PLAY);
}
void CMv_skinDlg::OnButtonSelectPlayPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PLAY_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PLAY_P);
}
void CMv_skinDlg::OnButtonSelectPlayDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PLAY_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PLAY_G);
}
void CMv_skinDlg::OnButtonSelectPauseNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PAUSE_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PAUSE);
}
void CMv_skinDlg::OnButtonSelectPausePressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PAUSE_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PAUSE_P);
}
void CMv_skinDlg::OnButtonSelectPauseDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PAUSE_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PAUSE_G);
}
void CMv_skinDlg::OnButtonSelectStopNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_STOP_PICTURE, IMG_ID_MVPLY_OSD_CNTL_STOP);
}
void CMv_skinDlg::OnButtonSelectStopPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_STOP_PICTURE, IMG_ID_MVPLY_OSD_CNTL_STOP_P);
}
void CMv_skinDlg::OnButtonSelectStopDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_STOP_PICTURE, IMG_ID_MVPLY_OSD_CNTL_STOP_G);
}
void CMv_skinDlg::OnButtonSelectPreviousNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PREVIOUS_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PREVIOUS);
}
void CMv_skinDlg::OnButtonSelectPreviousPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PREVIOUS_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PREVIOUS_P);
}
void CMv_skinDlg::OnButtonSelectPreviousDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_PREVIOUS_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PREVIOUS_G);
}
void CMv_skinDlg::OnButtonSelectNextNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_NEXT_PICTURE, IMG_ID_MVPLY_OSD_CNTL_NEXT);
}
void CMv_skinDlg::OnButtonSelectNextPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_NEXT_PICTURE, IMG_ID_MVPLY_OSD_CNTL_NEXT_P);
}
void CMv_skinDlg::OnButtonSelectNextDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_NEXT_PICTURE, IMG_ID_MVPLY_OSD_CNTL_NEXT_G);
}
void CMv_skinDlg::OnButtonSelectZoomNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_ZOOM_PICTURE, IMG_ID_MVPLY_OSD_CNTL_ZOOM);
}
void CMv_skinDlg::OnButtonSelectZoomPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_ZOOM_PICTURE, IMG_ID_MVPLY_OSD_CNTL_ZOOM_P);
}
void CMv_skinDlg::OnButtonSelectZoomDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_ZOOM_PICTURE, IMG_ID_MVPLY_OSD_CNTL_ZOOM_G);
}
void CMv_skinDlg::OnButtonSelectBookmarkNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_BOOKMARK_PICTURE, IMG_ID_MVPLY_OSD_CNTL_BOOK);
}
void CMv_skinDlg::OnButtonSelectBookmarkPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_BOOKMARK_PICTURE, IMG_ID_MVPLY_OSD_CNTL_BOOK_P);
}
void CMv_skinDlg::OnButtonSelectBookmarkDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_BOOKMARK_PICTURE, IMG_ID_MVPLY_OSD_CNTL_BOOK_G);
}
void CMv_skinDlg::OnButtonSelectAudionIconNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_AUDIO_ICON_PICTURE, IMG_ID_MVPLY_OSD_CNTL_AUDIO);
}
void CMv_skinDlg::OnButtonSelectAudionIconPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_AUDIO_ICON_PICTURE, IMG_ID_MVPLY_OSD_CNTL_AUDIO_P);
}
void CMv_skinDlg::OnButtonSelectAudionIconDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_AUDIO_ICON_PICTURE, IMG_ID_MVPLY_OSD_CNTL_AUDIO_G);
}
void CMv_skinDlg::OnButtonSelectMuteIconNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_MUTE_ICON_PICTURE, IMG_ID_MVPLY_OSD_CNTL_MUTE);
}
void CMv_skinDlg::OnButtonSelectMuteIconPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_MUTE_ICON_PICTURE, IMG_ID_MVPLY_OSD_CNTL_MUTE_P);
}
void CMv_skinDlg::OnButtonSelectMuteIconDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_MUTE_ICON_PICTURE, IMG_ID_MVPLY_OSD_CNTL_MUTE_G);
}
void CMv_skinDlg::OnButtonSelectTextInfoNormalPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_TEXT_INFO_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PROPERT);
}
void CMv_skinDlg::OnButtonSelectTextInfoPressPic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_TEXT_INFO_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PROPERT_P);
}
void CMv_skinDlg::OnButtonSelectTextInfoDisablePic()
{
// TODO: Add your control notification handler code here
process_button(IDC_EDIT_TEXT_INFO_PICTURE, IMG_ID_MVPLY_OSD_CNTL_PROPERT_G);
}
void CMv_skinDlg::OnButtonMinimize()
{
// TODO: Add your control notification handler code here
NOTIFYICONDATA nid;
nid.cbSize=(DWORD)sizeof(NOTIFYICONDATA);
nid.hWnd=this->m_hWnd;
nid.uID=IDR_MAINFRAME;
nid.uFlags=NIF_ICON|NIF_MESSAGE|NIF_TIP ;
nid.uCallbackMessage=WM_MV_SKIN_MSG;
nid.hIcon=LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME));
strcpy(nid.szTip,"摩威skin工具");
Shell_NotifyIcon(NIM_ADD,&nid); //在托盘区添加图标
ShowWindow(SW_HIDE);
}
void CMv_skinDlg::OnButtonCreateSkin()
{
// TODO: Add your control notification handler code here
int i;
U32 offset,img_len;
char dir_path[SAVE_PATH_LENGTH]={0};
char img_file_path[SAVE_PATH_LENGTH]={0};
char skin_file_path[SAVE_PATH_LENGTH]={0};
CFileFind file_find;
FILE *fp_image_file;
#if 1
for( i = 0; i < IMG_ID_MVPLY_END; i++ )
{
if ( 0 == m_file_attr[i].name[0] )
{
MessageBox("请继续选择图片", NULL, MB_ICONWARNING);
return;
}
}
#endif
strcpy(skin_file_path, m_dir_path);
strcat(skin_file_path, "\\mv.skn");
fp_image_file = fopen(skin_file_path,"wb");
if ( NULL == fp_image_file )
{
MessageBox("打开皮肤文件失败", NULL, MB_ICONWARNING);
fclose(fp_image_file);
return;
}
img_len = 0;
offset = sizeof(img_offset);
fseek(fp_image_file, offset, SEEK_SET);
for( i = 0; i < IMG_ID_MVPLY_END; i++ )
{
if ( 0 == m_file_attr[i].name[0] )
{
continue;
}
memset(img_data_buffer, 0x00, sizeof(img_data_buffer));
strcpy(img_file_path, m_dir_path);
strcat(img_file_path, "\\");
strcat(img_file_path, &m_file_attr[i].name[0]);
if( BMP_FILE == m_file_attr[i].file_type )
{
if( 1 != ABMLoader(img_file_path, img_data_buffer, &img_len) )
{
MessageBox("打开图片失败", NULL, MB_ICONWARNING);
fclose(fp_image_file);
return;
}
}
else if( GIF_FILE == m_file_attr[i].file_type )
{
if( 1 != GIFLoader(img_file_path, img_data_buffer, &img_len) )
{
MessageBox("打开图片失败", NULL, MB_ICONWARNING);
fclose(fp_image_file);
return;
}
}
else
{
MessageBox("文件类型不支持", NULL, MB_ICONWARNING);
fclose(fp_image_file);
return;
}
img_offset[i] = offset;
offset += img_len;
fwrite(img_data_buffer, 1, img_len, fp_image_file);
}
rewind(fp_image_file);//回到文件头
fwrite(img_offset, sizeof(img_offset), 1, fp_image_file);//write every image's offset
fclose(fp_image_file);
MessageBox("完成", NULL, MB_ICONWARNING);
}
void CMv_skinDlg::OnButtonPreview()
{
// TODO: Add your control notification handler code here
show_skin_flag = 1;
set_update_area();
}
//wParam接收的是图标的ID,而lParam接收的是鼠标的行为
LRESULT CMv_skinDlg::OnMvSkinMaxmizeMsg(WPARAM wParam,LPARAM lParam)
{
if( IDR_MAINFRAME != wParam )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -