1:
每次规定玩相册大小后,并导入成功后,在右侧空白处形成一相册,有封面,不止一个!不用图像控件
2:对照片添加文字说明,形成相册后,可以通过文字检索找到需要的照片,谢谢 !!
3:如何实现自动放映和特殊效果,急用 !!
我的思路:通过字符串保存路径,并记录每个照片路径长度,用FOR循环,实现下一张
下面是我的代码::
void CMy201432010417Dlg::OnBUTTONChooseIn()
{
// TODO: Add your control notification handler code here
UpdateData(true);
CString Lujing;
Lujing = m_oSource;
LJ += Lujing;
int len = LJ.GetLength(); //得到路径长度
lenth[mm]=len;
mm++;
if (mm>m_oNumber) //比较大小
{ MessageBox("载入相册成功");
}
else
MessageBox("继续");
UpdateData(false);
}
void CMy201432010417Dlg::OnBUTTONAlbumName()
{
// TODO: Add your control notification handler code here
UpdateData(true);
}
void CMy201432010417Dlg::OnBUTTONAddInformation()
{
// TODO: Add your control notification handler code here
UpdateData(true);
m_nInformation.Empty();
m_nInformation="add information:"+m_nAddInformation;
UpdateData(false);
}
/*void CMy201432010417Dlg::()
{
int cx,cy;
cx = GetSystemMetrics(SM_CXSCREEN);
cy = GetSystemMetrics(SM_CYSCREEN);
CRect rcTemp;
rcTemp.BottomRight() = CPoint(cx, cy);
rcTemp.TopLeft() = CPoint(0, 0);
MoveWindow(&rcTemp);
}*/
void CMy201432010417Dlg::OnFull()
{
m_bFullScreen=!m_bFullScreen; // 设置全屏显示标志
LONG style = ::GetWindowLong(this->m_hWnd,GWL_STYLE);
if(m_bFullScreen)//全屏显示
{
style &= ~(WS_DLGFRAME | WS_THICKFRAME);
SetWindowLong(this->m_hWnd,GWL_STYLE, style);
this->ShowWindow(SW_SHOWMAXIMIZED);
CRect rect;
this->GetWindowRect(&rect);
::SetWindowPos(this->m_hWnd,HWND_NOTOPMOST,rect.left-1, rect.top-1, rect.right-rect.left + 3, rect.bottom-rect.top + 3, SWP_FRAMECHANGED);
}
else
{
style |= WS_DLGFRAME | WS_THICKFRAME;
SetWindowLong(this->m_hWnd, GWL_STYLE, style);
this->ShowWindow(SW_NORMAL);
}
}
void CMy201432010417Dlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(nType!=SIZE_MINIMIZED ) //判断窗口是不是最小化了,因为窗口最小化之后 ,窗口的长和宽会变成0,当前一次变化的时就会出现除以0的错误操作
{
ChangeSize(IDC_BUTTON2,cx,cy); //对每一个控件依次做调整
ChangeSize(IDC_BUTTON_AddInformation,cx,cy);
ChangeSize(IDC_BUTTON_AlbumName,cx,cy);
ChangeSize(IDC_BUTTON10,cx,cy);
ChangeSize(IDC_BUTTON_ChooseIn,cx,cy);
ChangeSize(IDC_BUTTON_Information,cx,cy);
ChangeSize(IDC_BUTTON_ChangeName,cx,cy);
ChangeSize(IDC_BUTTON_Next,cx,cy);
ChangeSize(IDC_BUTTON_OK,cx,cy);
ChangeSize(IDC_BUTTON_Open,cx,cy);
ChangeSize(IDC_EDIT_AddInformation,cx,cy);
ChangeSize(IDC_EDIT_AlbumName,cx,cy);
ChangeSize(IDC_EDIT_Information,cx,cy);
ChangeSize(IDC_EDIT_Name,cx,cy);
ChangeSize(IDC_EDIT_Number,cx,cy);
ChangeSize(IDC_EDIT_Source,cx,cy);
ChangeSize(IDC_STATIC_album,cx,cy);
ChangeSize(IDC_STATIC1,cx,cy);
ChangeSize(IDC_STATIC2,cx,cy);
ChangeSize(IDC_STATIC3,cx,cy);
ChangeSize(IDC_STATIC,cx,cy);
ChangeSize(IDC_STATIC4,cx,cy);
GetClientRect(&m_rect); //最后要更新对话框的大小,当做下一次变化的旧坐标
}
}
void CMy201432010417Dlg::ChangeSize(UINT nID, int x, int y)
{
CWnd *pWnd;
pWnd=GetDlgItem(nID);
if(pWnd!=NULL) //判断是否为空,因为在窗口创建的时候也会调用OnSize函数,但是此时各个控件还没有创建,Pwnd为空
{
CRect rec;
pWnd->GetWindowRect(&rec); //获取控件变化前的大小
ScreenToClient(&rec); //将控件大小装换位在对话框中的区域坐标
rec.left=rec.left*x/m_rect.Width(); //按照比例调整空间的新位置
rec.top=rec.top*y/m_rect.Height();
rec.bottom=rec.bottom*y/m_rect.Height();
rec.right=rec.right*x/m_rect.Width();
pWnd->MoveWindow(rec); //伸缩控件
}
}
void CMy201432010417Dlg::OnButton2()
{
// TODO: Add your control notification handler code here
MessageBox("请打开需添加的相册内容");
m_oNumber++;
OnBUTTONOpen();
}
void CMy201432010417Dlg::OnButton10()
{
// TODO: Add your control notification handler code here
m_oNumber--;
}