📄 dlinedlg2.cpp
字号:
m_Blue=GetBValue(m_Color);
m_Slider_Blue.SetPos(m_Blue);
m_Red=GetRValue(m_Color);
m_Slider_Red.SetPos(m_Red);
m_Green=GetGValue(m_Color);
m_Slider_Green.SetPos(m_Green);
UpdateData(false);
}
void CDLineDlg2::OnSTATICBlue()
{
// TODO: Add your control notification handler code here
m_Color=RGB(0,0,255);
CDC * pDC;
CBrush brush;
CRect rect;
pDC=m_CStatic_ShowColor.GetDC();
m_CStatic_ShowColor.GetClientRect(&rect);
brush.CreateSolidBrush(m_Color);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_CStatic_ShowColor.ReleaseDC(pDC);
if(m_Check_Pen.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowPenColor.GetDC();
m_Static_ShowPenColor.GetClientRect(&rect);
m_PenColor=m_Color;
brush.CreateSolidBrush(m_PenColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowPenColor.ReleaseDC(pDC);
}
if(m_Check_Brush.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBrushColor.GetDC();
m_Static_ShowBrushColor.GetClientRect(&rect);
m_BrushColor=m_Color;
brush.CreateSolidBrush(m_BrushColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBrushColor.ReleaseDC(pDC);
}
if(m_Check_Background.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBackgroundColor.GetDC();
m_Static_ShowBackgroundColor.GetClientRect(&rect);
m_BackgroundColor=m_Color;
brush.CreateSolidBrush(m_BackgroundColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBackgroundColor.ReleaseDC(pDC);
}
m_Blue=GetBValue(m_Color);
m_Slider_Blue.SetPos(m_Blue);
m_Red=GetRValue(m_Color);
m_Slider_Red.SetPos(m_Red);
m_Green=GetGValue(m_Color);
m_Slider_Green.SetPos(m_Green);
UpdateData(false);
}
void CDLineDlg2::OnSTATICGreen()
{
// TODO: Add your control notification handler code here
m_Color=RGB(0,255,0);
CDC * pDC;
CBrush brush;
CRect rect;
pDC=m_CStatic_ShowColor.GetDC();
m_CStatic_ShowColor.GetClientRect(&rect);
brush.CreateSolidBrush(m_Color);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_CStatic_ShowColor.ReleaseDC(pDC);
if(m_Check_Pen.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowPenColor.GetDC();
m_Static_ShowPenColor.GetClientRect(&rect);
m_PenColor=m_Color;
brush.CreateSolidBrush(m_PenColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowPenColor.ReleaseDC(pDC);
}
if(m_Check_Brush.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBrushColor.GetDC();
m_Static_ShowBrushColor.GetClientRect(&rect);
m_BrushColor=m_Color;
brush.CreateSolidBrush(m_BrushColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBrushColor.ReleaseDC(pDC);
}
if(m_Check_Background.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBackgroundColor.GetDC();
m_Static_ShowBackgroundColor.GetClientRect(&rect);
m_BackgroundColor=m_Color;
brush.CreateSolidBrush(m_BackgroundColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBackgroundColor.ReleaseDC(pDC);
}
m_Blue=GetBValue(m_Color);
m_Slider_Blue.SetPos(m_Blue);
m_Red=GetRValue(m_Color);
m_Slider_Red.SetPos(m_Red);
m_Green=GetGValue(m_Color);
m_Slider_Green.SetPos(m_Green);
UpdateData(false);
}
void CDLineDlg2::OnSTATICDrakGreen()
{
// TODO: Add your control notification handler code here
m_Color=RGB(0,128,0);
CDC * pDC;
CBrush brush;
CRect rect;
pDC=m_CStatic_ShowColor.GetDC();
m_CStatic_ShowColor.GetClientRect(&rect);
brush.CreateSolidBrush(m_Color);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_CStatic_ShowColor.ReleaseDC(pDC);
if(m_Check_Pen.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowPenColor.GetDC();
m_Static_ShowPenColor.GetClientRect(&rect);
m_PenColor=m_Color;
brush.CreateSolidBrush(m_PenColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowPenColor.ReleaseDC(pDC);
}
if(m_Check_Brush.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBrushColor.GetDC();
m_Static_ShowBrushColor.GetClientRect(&rect);
m_BrushColor=m_Color;
brush.CreateSolidBrush(m_BrushColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBrushColor.ReleaseDC(pDC);
}
if(m_Check_Background.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBackgroundColor.GetDC();
m_Static_ShowBackgroundColor.GetClientRect(&rect);
m_BackgroundColor=m_Color;
brush.CreateSolidBrush(m_BackgroundColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBackgroundColor.ReleaseDC(pDC);
}
m_Blue=GetBValue(m_Color);
m_Slider_Blue.SetPos(m_Blue);
m_Red=GetRValue(m_Color);
m_Slider_Red.SetPos(m_Red);
m_Green=GetGValue(m_Color);
m_Slider_Green.SetPos(m_Green);
UpdateData(false);
}
void CDLineDlg2::OnSTATICYellow()
{
// TODO: Add your control notification handler code here
m_Color=RGB(255,255,0);
CDC * pDC;
CBrush brush;
CRect rect;
pDC=m_CStatic_ShowColor.GetDC();
m_CStatic_ShowColor.GetClientRect(&rect);
brush.CreateSolidBrush(m_Color);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_CStatic_ShowColor.ReleaseDC(pDC);
if(m_Check_Pen.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowPenColor.GetDC();
m_Static_ShowPenColor.GetClientRect(&rect);
m_PenColor=m_Color;
brush.CreateSolidBrush(m_PenColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowPenColor.ReleaseDC(pDC);
}
if(m_Check_Brush.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBrushColor.GetDC();
m_Static_ShowBrushColor.GetClientRect(&rect);
m_BrushColor=m_Color;
brush.CreateSolidBrush(m_BrushColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBrushColor.ReleaseDC(pDC);
}
if(m_Check_Background.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBackgroundColor.GetDC();
m_Static_ShowBackgroundColor.GetClientRect(&rect);
m_BackgroundColor=m_Color;
brush.CreateSolidBrush(m_BackgroundColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBackgroundColor.ReleaseDC(pDC);
}
m_Blue=GetBValue(m_Color);
m_Slider_Blue.SetPos(m_Blue);
m_Red=GetRValue(m_Color);
m_Slider_Red.SetPos(m_Red);
m_Green=GetGValue(m_Color);
m_Slider_Green.SetPos(m_Green);
UpdateData(false);
}
void CDLineDlg2::OnSTATICRarkRed()
{
// TODO: Add your control notification handler code here
m_Color=RGB(128,0,0);
CDC * pDC;
CBrush brush;
CRect rect;
pDC=m_CStatic_ShowColor.GetDC();
m_CStatic_ShowColor.GetClientRect(&rect);
brush.CreateSolidBrush(m_Color);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_CStatic_ShowColor.ReleaseDC(pDC);
if(m_Check_Pen.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowPenColor.GetDC();
m_Static_ShowPenColor.GetClientRect(&rect);
m_PenColor=m_Color;
brush.CreateSolidBrush(m_PenColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowPenColor.ReleaseDC(pDC);
}
if(m_Check_Brush.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBrushColor.GetDC();
m_Static_ShowBrushColor.GetClientRect(&rect);
m_BrushColor=m_Color;
brush.CreateSolidBrush(m_BrushColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBrushColor.ReleaseDC(pDC);
}
if(m_Check_Background.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBackgroundColor.GetDC();
m_Static_ShowBackgroundColor.GetClientRect(&rect);
m_BackgroundColor=m_Color;
brush.CreateSolidBrush(m_BackgroundColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBackgroundColor.ReleaseDC(pDC);
}
m_Blue=GetBValue(m_Color);
m_Slider_Blue.SetPos(m_Blue);
m_Red=GetRValue(m_Color);
m_Slider_Red.SetPos(m_Red);
m_Green=GetGValue(m_Color);
m_Slider_Green.SetPos(m_Green);
UpdateData(false);
}
void CDLineDlg2::OnStaticBitmap6()
{
// TODO: Add your control notification handler code here
m_Color=RGB(0,255,255);
CDC * pDC;
CBrush brush;
CRect rect;
pDC=m_CStatic_ShowColor.GetDC();
m_CStatic_ShowColor.GetClientRect(&rect);
brush.CreateSolidBrush(m_Color);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_CStatic_ShowColor.ReleaseDC(pDC);
if(m_Check_Pen.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowPenColor.GetDC();
m_Static_ShowPenColor.GetClientRect(&rect);
m_PenColor=m_Color;
brush.CreateSolidBrush(m_PenColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowPenColor.ReleaseDC(pDC);
}
if(m_Check_Brush.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBrushColor.GetDC();
m_Static_ShowBrushColor.GetClientRect(&rect);
m_BrushColor=m_Color;
brush.CreateSolidBrush(m_BrushColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBrushColor.ReleaseDC(pDC);
}
if(m_Check_Background.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBackgroundColor.GetDC();
m_Static_ShowBackgroundColor.GetClientRect(&rect);
m_BackgroundColor=m_Color;
brush.CreateSolidBrush(m_BackgroundColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBackgroundColor.ReleaseDC(pDC);
}
m_Blue=GetBValue(m_Color);
m_Slider_Blue.SetPos(m_Blue);
m_Red=GetRValue(m_Color);
m_Slider_Red.SetPos(m_Red);
m_Green=GetGValue(m_Color);
m_Slider_Green.SetPos(m_Green);
UpdateData(false);
}
void CDLineDlg2::OnStaticBitmap5()
{
// TODO: Add your control notification handler code here
m_Color=RGB(0,170,170);
CDC * pDC;
CBrush brush;
CRect rect;
pDC=m_CStatic_ShowColor.GetDC();
m_CStatic_ShowColor.GetClientRect(&rect);
brush.CreateSolidBrush(m_Color);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_CStatic_ShowColor.ReleaseDC(pDC);
if(m_Check_Pen.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowPenColor.GetDC();
m_Static_ShowPenColor.GetClientRect(&rect);
m_PenColor=m_Color;
brush.CreateSolidBrush(m_PenColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowPenColor.ReleaseDC(pDC);
}
if(m_Check_Brush.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBrushColor.GetDC();
m_Static_ShowBrushColor.GetClientRect(&rect);
m_BrushColor=m_Color;
brush.CreateSolidBrush(m_BrushColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBrushColor.ReleaseDC(pDC);
}
if(m_Check_Background.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowBackgroundColor.GetDC();
m_Static_ShowBackgroundColor.GetClientRect(&rect);
m_BackgroundColor=m_Color;
brush.CreateSolidBrush(m_BackgroundColor);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_Static_ShowBackgroundColor.ReleaseDC(pDC);
}
m_Blue=GetBValue(m_Color);
m_Slider_Blue.SetPos(m_Blue);
m_Red=GetRValue(m_Color);
m_Slider_Red.SetPos(m_Red);
m_Green=GetGValue(m_Color);
m_Slider_Green.SetPos(m_Green);
UpdateData(false);
}
void CDLineDlg2::OnSTATICDarkYellow()
{
// TODO: Add your control notification handler code here
m_Color=RGB(128,128,0);
CDC * pDC;
CBrush brush;
CRect rect;
pDC=m_CStatic_ShowColor.GetDC();
m_CStatic_ShowColor.GetClientRect(&rect);
brush.CreateSolidBrush(m_Color);
pDC->FillRect(&rect,&brush);
brush.DeleteObject();
m_CStatic_ShowColor.ReleaseDC(pDC);
if(m_Check_Pen.GetCheck()==BST_CHECKED)
{
pDC=m_Static_ShowPenColor.GetDC();
m_Static_ShowPenColor.GetClientRect(&rect);
m_PenColor=m_Color;
brush.CreateSolidBrush(m_PenColor);
pDC->FillRect(&rect,&brush);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -