📄 olorform.cpp
字号:
// olorForm.cpp : implementation file
//
#include "stdafx.h"
#include "ImagePercent.h"
#include "olorForm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// ColorForm dialog
ColorForm::ColorForm(CWnd* pParent /*=NULL*/)
: CDialog(ColorForm::IDD, pParent)
{
//{{AFX_DATA_INIT(ColorForm)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void ColorForm::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(ColorForm)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(ColorForm, CDialog)
//{{AFX_MSG_MAP(ColorForm)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// ColorForm message handlers
void ColorForm::OnPaint()
{
int i,j;
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
for(j=0;j<256;j++)
{
for(i=0;i<256;i++) dc.SetPixel(i,256-j,RGB(255,i,j));
for(i=1;i<256;i++) dc.SetPixel(255+i,256-j,RGB(255-i,255,j));
}
for(j=0;j<256;j++)
{
for(i=0;i<256;i++) dc.SetPixel(i,256+j,RGB(255-j,i,j));
for(i=1;i<256;i++) dc.SetPixel(255+i,256+j,RGB(255-i,255-j,j));
}
// Do not call CDialog::OnPaint() for painting messages
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -