MapleStory Finger Point

๐Ÿ”ต C,C++,C#/C++ (MFC) ๊ฐœ๋…์ •๋ฆฌ

MFC 2

HYEJU01 2021. 10. 17. 01:52

 

ํ•œ์ค„๋กœ ๊ทธ๋ฆฌ๊ธฐ(์„œ์ˆ ํ•˜๊ธฐ) (๊ธด ์ฝ”๋”ฉ๋ฌธ์ œ๋Š” ์—†์Œ)
์š”์œ„์น˜์— ~ ๋„ค๋ชจ์žํ‘œ ondraw~ ํƒ€์ด๋จธ ๊ฐ„๋‹จ์ฝ”๋”ฉ~ ar ๋ฐ์ดํ„ฐ ๋‹ค์‹œ ๋กœ๋”ฉ์‹œํ‚ค๋Š”๋ฒ• ~~

 

 

 

#์› ,๋„ค๋ชจ ๋งŒ๋“ค๊ฒƒ์ž„

1ํƒ€์ด๋จธ๋กœ ์ž๋™์œผ๋กœ ์›€์ง์ด๊ฒŒ ๋งŒ๋“ค๊ฑฐ์ž„

2๋งˆ์šฐ์Šค ํ‚ค๋ณด๋“œ๋ฅผ์ด์šฉํ•ด์„œ ์›€์ง์ผ ๊ฒƒ์ž„

 

 

 

#

1. view.h ์—์„œ ๋ณ€์ˆ˜ ์ƒ์„ฑ

2. view.cpp ์ƒ์„ฑ์ž์—์„œ ์ดˆ๊ธฐํ™”

3. 

 

 

# ์ง์„  ๊ทธ๋ฆฌ๊ธฐ 

 


 

#๊ทธ๋ฆผ๊ทธ๋ฆฌ๊ธฐ - ์› ๊ทธ๋ฆฌ๊ธฐ Ellipse  <๊ฐ„๋‹จ์ฝ”๋”ฉ>

1. view.h ์—์„œ circle ๋ณ€์ˆ˜ ์„ ์–ธ

2. view.cpp ์ƒ์„ฑ์ž์—์„œ circle ์ดˆ๊ธฐํ™”ํ•˜๊ธฐ {100, 100};

3. OnDraw (pDC ํ•ด์ œํ•˜๊ธฐ)

4. ์› ์ƒ์„ฑ

void ~~ OnDraw(CDC* pDC) {

pDC->Ellipse (์ขŒํ‘œ,์ขŒํ‘œ,์ขŒํ‘œ,์ขŒํ‘œ);

}

 

 

#์ž๋™์œผ๋กœ ์›€์ง์ด๋Š” ์› ๋งŒ๋“ค๊ธฐ

 

 

ondraw -> btn -> invalidate() ํ˜„์žฌํ™”๋ฉด์„ ์ง€์šฐ๊ณ  ๋‹ค์‹œ๊ทธ๋ฆผ 
btn ์•ˆ์—์„œ ๋ฐ”๋กœ ๊ทธ๋ฆผ -> ClientDc(๋งŒ๋“ค๊ธฐ๋‚ด๋ถ€์—) -> ์ง€์šฐ์ง€์•Š๊ณ  ๊ทธ๋ฆผ ๊ณ„์†๊ทธ๋ฆผ 
์ง€์šฐ๊ณ  ๊ทธ๋ฆฌ๋Š”๊ฐ€? ์•ˆ์ง€์šฐ๊ณ  ๊ทธ๋ฆฌ๋Š”๊ฐ€? (์ฐจ์ด)

 


 

 

#๊ทธ๋ฆผ๊ทธ๋ฆฌ๊ธฐ - ๋„ค๋ชจ ๊ทธ๋ฆฌ๊ธฐ Rectangle  <๊ฐ„๋‹จ์ฝ”๋”ฉ>

1. view.h ์—์„œ rect ๋ณ€์ˆ˜ ์„ ์–ธ

2. view.cpp ์ƒ์„ฑ์ž์—์„œ rect ์ดˆ๊ธฐํ™”ํ•˜๊ธฐ {500,300}

3. OnDraw  (pDC ํ•ด์ œํ•˜๊ธฐ)

4. ๋„ค๋ชจ ์ƒ์„ฑ

void ~~ OnDraw(CDC* pDC) {

pDC->Rectangle(์ขŒํ‘œ,์ขŒํ‘œ,์ขŒํ‘œ,์ขŒํ‘œ);

}

 

๋”๋ณด๊ธฐ

โ–ถ CRect ํด๋ž˜์Šค

 

#์ƒ‰์ƒ ์„ ํƒ ํ›„ ์ง์‚ฌ๊ฐํ˜• ๊ทธ๋ฆฌ๊ธฐ

๋”๋ณด๊ธฐ

 

ํด๋ž˜์Šค์— ๋ฉค๋ฒ„๋ณ€์ˆ˜ ์ถ”๊ฐ€
์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ ํ•จ์ˆ˜ ์ถ”๊ฐ€

 

 

 

 

#๋ฌธ์ž -

1. OnChar ์ถ”๊ฐ€ํ•˜๊ธฐ

2. 

 

 

#Timer (ํƒ€์ด๋จธ)  <๊ฐ„๋‹จ์ฝ”๋”ฉ>

์ปดํ“จํ„ฐ์— ๋™์ž‘ํ•˜๋Š” ์‹œ๊ณ„๋ฅผ ํ†ตํ•ด ์ผ์ • ๋‹จ์œ„ ์‹œ๊ฐ„๋งˆ๋‹ค ์‹ ํ˜ธ๋ฅผ ๋ฐ›์Œ

 

void ~~ OnTimer (~ nIDEvent){
circle.x += 30;  // ํƒ€์ด๋จธ์— ๋”ฐ๋ผ ์ขŒํ‘œ๋„ ์›€์ง์ž„

Invalidate(); 
CView::OnTimer(~~);
}

//ํƒ€์ด๋จธ๊ฐ€ ๋‘๊ฐœ์ธ ๊ฒฝ์šฐ ?
//=> ์กฐ๊ฑด๋ฌธ ์ฃผ๊ธฐ (== ํƒ€์ด๋จธ์— ๋ฒˆํ˜ธ ๋งค๊ธฐ๊ธฐ)

void ~~ OnTimer (~ nIDEvent){

if (nIDEvent == 1) {
circle.x += 30;  ์ž„
}

if (nIDEvent == 2) {
rect.x += 30;  
}

Invalidate(); 
CView::OnTimer(~~);
}

 

void ~~View::OnButtonDown(~~nFlags, CPoint point){

setTimer(1,1000,NULL)
//settimer (1๋ฒˆํƒ€์ด๋จธ, 700๋งˆ๋‹ค ๋™์ž‘ , ...)
//1์ดˆ๋งˆ๋‹ค ํ•œ๋ฒˆ์”ฉ OnTimer ์ž๋™ ํ˜ธ์ถœ

setTimer(2,1000,NULL)


killtimer(1);
//1๋ฒˆ ํƒ€์ด๋จธ ๋ฉˆ์ถ”๊ธฐ

CView::OnButtonDown(~~nFlags, CPoint point);
}

 

 

 

 


 

#๋งˆ์šฐ์Šค๋กœ ์ฒ˜๋ฆฌ

1.๋งˆ์šฐ์Šค ์™ผ์ชฝ ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด ์›€์ง์ž„

2. LbuttonDown ๋ฉ”์†Œ๋“œ ์•ˆ์— ํƒ€์ด๋จธ ์ถ”๊ฐ€

 

1.๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด ๋ฉˆ์ถœ๊ฒƒ์ž„

2. RButtonDown ๋ฉ”์†Œ๋“œ ์•ˆ์— ํƒ€์ด๋จธ ์ถ”๊ฐ€ 

 

๋”๋ณด๊ธฐ

•WM_LBUTTONDOWN : ๋งˆ์šฐ์Šค ์™ผ์ชฝ ๋ฒ„ํŠผ์„ ๋ˆŒ๋ €์„ ๋•Œ ๋ฐœ์ƒ

•WM_LBUTTONUP : ๋งˆ์šฐ์Šค ์™ผ์ชฝ ๋ฒ„ํŠผ์„ ๋—์„ ๋•Œ ๋ฐœ์ƒ

•WM_RBUTTONDOWN : ๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ์„ ๋ˆŒ๋ €์„ ๋•Œ ๋ฐœ์ƒ

•WM_RBUTTONUP : ๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ์„ ๋—์„ ๋•Œ ๋ฐœ์ƒ

•WM_MOUSEMOVE : ๋งˆ์šฐ์Šค๋ฅผ ์›€์ง์ผ ๋•Œ ๋ฐœ์ƒ

 


 

 

#ํ‚ค๋ณด๋“œ๋กœ ์ฒ˜๋ฆฌ

2๋งˆ์šฐ์Šค ํ‚ค๋ณด๋“œ๋ฅผ์ด์šฉํ•ด์„œ ์›€์ง์ผ ๊ฒƒ์ž„

if (nChar == 'j')
	circle.x += 30;
if (nChar == 'k')
	circle.x -= 30;

 

๋”๋ณด๊ธฐ

•WM_KEYDOWN : ํ‚ค๋ณด๋“œ์˜ ํ‚ค๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ ๋ฐœ์ƒ

•WM_CHAR : ํ‚ค๋ณด๋“œ์˜ ๋ฌธ์žํ‚ค๋ฅผ ๋ˆŒ๋ €์„ ๋•Œ ๋ฐœ์ƒ

•WM_KEYUP : ํ‚ค๋ณด๋“œ์—์„œ ํ‚ค๋ฅผ ๋ˆŒ๋ €๋‹ค๊ฐ€ ๋—์„ ๋•Œ ๋ฐœ์ƒ

โ–ฒ ํ‚ค๋ณด๋“œ ๋ฉ”์‹œ์ง€์™€ ํ•จ๊ป˜ ์ „๋‹ฌ๋˜๋Š” ์ •๋ณด

 


#ํ…์ŠคํŠธ ์ถœ๋ ฅ

#ํ…์ŠคํŠธ ์ถœ๋ ฅํ•˜๊ธฐ (์ ์ขŒํ‘œ)

x,y์ขŒํ‘œ์—์„œ๋ถ€ํ„ฐ ๊ธ€์”จ๋ฅผ ์“ด๋‹ค

 

#ํ…์ŠคํŠธ ์ถœ๋ ฅํ•˜๊ธฐ (์˜์—ญ์ขŒํ‘œ)

์˜์—ญ์„ ์ •ํ•˜๊ณ   ๊ธ€์”จ๋ฅผ ์“ด๋‹ค.
๋‹ค์–‘ํ•œ ์˜ต์…˜์ด์žˆ์Œ
-๊ธ€์ž ๋“ค์–ด๊ฐ€๊ณ  
-๋ช‡๊ฐœ๊นŒ์ง€ ์“ธ๊ฒƒ์ด๋ƒ 
-์ •๋ ฌ์˜์—ญ (๋‘๊ฐœ์˜ ์ ์ด ํ•˜๋‚˜์˜ ์˜์—ญ์„ ๋งŒ๋“ฌ)

 

#CString ํด๋ž˜์Šค

MFC๊ธฐ๋ณธ์€ String ์‚ฌ์šฉ์ด ์•ˆ๋จ -> CString ์‚ฌ์šฉํ•ด์•ผ๋จ (๋งŽ์€ ํ•จ์ˆ˜๋“ค์„ ๋ณด์œ )

 

 

#์œˆ๋„์šฐ์— ์ž…๋ ฅ๋œ ๋ฌธ์ž์—ด ์ถœ๋ ฅํ•˜๊ธฐ

1.ํ—ค๋”์— str ์ƒ์„ฑ
2.์ƒ์„ฑ์ž์—์„œ ์ดˆ๊ธฐํ™”ํ•ด์ฃผ์„ธ์š”
3. Ondraw ์—์„œ pDC->TextOut()

4. OnChar ์—์„œ str.AppendChar();

5. Invalidate(); ์ถ”๊ฐ€ํ•˜๋ฉด Ondraw ์‹ค์‹œ๊ฐ„ ๋‹ค์‹œ๊ทธ๋ ค์ค€๋‹ค.

6. ์กฐ๊ฑด์ถ”๊ฐ€  str.Delete(str.GetLeghth()-1); 

if (nChar == VK_BACK)
	str.Delete(str.GetLeghth()-1);
else
	str.AppendChar(nChar);

์œˆ๋„์šฐ์— ๋ฌธ์ž์—ด ์ƒ์ˆ˜ ์ถœ๋ ฅํ•˜๊ธฐ

๋”๋ณด๊ธฐ

#append, appendChar ๋ฌธ์ž์—ด ์ถ”๊ฐ€ํ•จ์ˆ˜

 


 

#๋ž˜์Šคํ„ฐ ์—ฐ์‚ฐ

๋ฐฐ๊ฒฝ์ƒ‰๊ณผ ์ถœ๋ ฅํ•˜๋Š” ์ƒ‰ ์‚ฌ์ด์— ์ด๋ฃจ์–ด์ง€๋Š” ์—ฐ์‚ฐ
= ์บ๋ฆญํ„ฐ ์ด๋ฏธ์ง€ + ๋งˆ์Šคํฌ ์ด๋ฏธ์ง€  = ๋งˆ์Šคํฌ ์ด๋ฏธ์ง€

 

 

 

๋”๋ณด๊ธฐ
•ํด๋ž˜์Šค์— ๋ฉค๋ฒ„๋ณ€์ˆ˜ ์ถ”๊ฐ€

 


 

#๋น„ํŠธ๋งต

 

 

#BitBlt

#stretchBlt  

 

#์˜ต์…˜

pDC->StretchBlt(100, 100, 200, 300, &mdc, 100, 100, 500, 500, SRCCOPY);
SRCAND : Combines pixels of the destination and source bitmaps using the Boolean AND operator

 AND ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋Œ€์ƒ ๋น„ํŠธ ๋งต๊ณผ ์†Œ์Šค ๋น„ํŠธ ๋งต์˜ ํ”ฝ์…€์„ ๊ฒฐํ•ฉ

SRCCOPY : Copies the source bitmap to the destination bitmap.

์†Œ์Šค ๋น„ํŠธ ๋งต์„ ๋Œ€์ƒ ๋น„ํŠธ ๋งต์— ๋ณต์‚ฌ

SRCPAINT : Combines pixels of the destination and source bitmaps using the Boolean OR operator.
OR ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋Œ€์ƒ ๋น„ํŠธ ๋งต๊ณผ ์†Œ์Šค ๋น„ํŠธ ๋งต์˜ ํ”ฝ์…€์„ ๊ฒฐํ•ฉ

 

 

#๋”๋ธ”๋ฒ„ํผ๋ง

๋งˆ์Šคํฌ ์ถœ๋ ฅ

 


#Docu

 

 

 

#๋ฐ์ดํ„ฐ view - docu ๊ตํ™˜

view : 1ํ™”๋ฉด์— ์ถœ๋ ฅ (API๊ฐ€ ๋ชฐ๋ ค์ž‡์Œ),2 ๋ฐ์ดํ„ฐ ์ €์žฅ

doc : 1๋ฐ์ดํ„ฐ ์ฝ๊ธฐ/์ €์žฅํ•˜๊ธฐ, 3ํ™”๋ฉด์ถœ๋ ฅ

view() : ํ™”๋ฉด์— ๊ทธ๋ฆฌ๋Š” ๊ฒƒ

Douc(): ๋„ํ ๋Š” ๋ฐ์ดํ„ฐ load / save ๋ฐ์ดํ„ฐ ์ €์žฅ ํŠนํ™”๋˜์–ด์žˆ์Œ

 

๋„ํ์— ๋ณ€์ˆ˜ ์ƒ์„ฑํ•˜๊ณ  doc.view์ƒ์„ฑ์ž์—์„œ ์ดˆ๊ธฐํ™” 
1. ๋ณด๋‚ด๊ณ  ๋ฐ›๊ธฐ์œ„ํ•ด์„œ๋Š” > doc. hํ—ค๋”๊ฐ€ ์žˆ์–ด์•ผํ•จ (view์—)
doc <> view ์ด๋™ํ•˜๋ ค๋ฉด
2. ํ”„๋กœ์ ํŠธ๋ช…์— ๋Œ€ํ•œ onDraw์— ์žˆ๋Š”  pDC = getDocument() ๋ฅผ ๊ฐ’์ด ํ•„์š”ํ•จ

btn ์— ๋„ฃ์–ด์คŒ
pDoc ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋ฐ์ดํ„ฐ๋ฅผ ํ˜„์žฌ view ์˜ ๊ฐ’์„ ๋„ฃ์„์ˆ˜์žˆ์Œ

> doc.h์— ์ƒ์„ฑํ•œ ๋ณ€์ˆ˜์— ๊ฐ’๊ณผ ์ขŒํ‘œ๊ฐ€ ๋“ค์–ด๊ฐ€์ง 
์„œ๋กœ ๊ตํ™˜ํ•  ์ˆ˜ ์žˆ๋‹ค.

 

 

 

#ํŒŒ์ผ ์ €์žฅ/๋กœ๋”ฉ

#๋ฐ์ดํ„ฐ๋ฅผ ํŒŒ์ผ๋กœ ๋งŒ๋“ค๊ฒƒ์ž„

 

๋ฆฌ์†Œ์Šค๊นŒ์ง€ ๊ณ ๋ คํ•ด์ค˜์•ผ๋œ๋‹ค.
Doc ์— ๋ณ€์ˆ˜ ๋„ฃ์–ด์„œ ํ•œ ์ด์œ ? Doc <-> View pDoc->m_ptData[i] ?? 
๋ฐ์ดํ„ฐ๋ฅผ ํŒŒ์ผ๋กœ ๋งŒ๋“ค๊ธฐ์œ„ํ•ด์„œ
Doc ์ง๋ ฌํ™”
๋ฐฐ์—ด์ฒ˜๋Ÿผ ๋ฐ์ดํ„ฐ๊ฐ€ ์ง๋ ฌ๋˜์–ด์žˆ๋Š”๊ฒƒ

ar ์ด ๋ฌด์—‡์ธ๊ฐ€? >
๋‹ค ๋„ฃ๊ฒŒ ๋˜๋ฉด ์—ด์— ์Œ“์ธ๋‹ค. (์ง๋ ฌํ™”)

์ง€๊ธˆ๊นŒ์ง€ ๋ฐ์ดํ„ฐ๋ฅผ ํŒŒ์ผ๋กœ ๋„ฃ์„๊ฒƒ >
Doc ์— m_ptData๊ฐ€ ์ €์žฅ๋˜์–ด์žˆ์Œ

ํŒŒ์ผ์„ ์ €์žฅํ• ๋•Œ๋Š” ar์— ์ €์žฅํ•œ๋‹ค>
๊ทธ๋ฆผ๊ทธ๋ฆฌ๊ณ  -> aa.dat (ํ™•์žฅ์ž๋ฌด๊ด€) ์ €์žฅ
aa.dat ์—ด๊ธฐ -> ๊ทธ๋ฆผ ๋‚˜ํƒ€๋‚จ 

 

 

1. ํŒŒ์ผ๋กœ ๋งŒ๋“ค๋ ค๋ฉด doc . cpp 

2. srialize๊ฐ€ ์žˆ๋‹ค. ⇒ ์ง๋ ฌํ™”๋ผ๊ณ  ํ•œ๋‹ค. (๋ฐ์ดํ„ฐ๊ฐ€ ๋ฐฐ์—ด์ฒ˜๋Ÿฌ ์ญ‰ ์ •๋ ฌ๋˜์–ด์žˆ๋Š”๊ฒƒ)

3. ar ๋กœ ๋˜์–ด์žˆ๊ณ , ํŒŒ์ผ์„ ์ €์žฅํ•  ๋•Œ๋Š” ar์—๋‹ค ์ €์žฅํ•จ

4. ๋ฐฐ์—ด์— ๋ช‡๊ฐœ ๋‹ด๊ฒผ๋Š”์ง€ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

5. ar์—๋‹ค๊ฐ€ ๋ณ€์ˆ˜๋ฅผ ์ฐจ๊ณก์ฐจ๊ณก ์ง‘์–ด ๋„ฃ๋Š”๋‹ค.

5. ๋กœ๋”ฉ์€ ar์„ ์œ„์—์„œ๋ถ€ํ„ฐ ๋นผ๋‚ธ๋‹ค.

6. dat ํŒŒ์ผ๋กœ ์ €์žฅํ•œ๋‹ค. ??

if(ar.IsStoring()){

ar << m_nCount;
for (int i=0; i< m_nCount; i++)
	ar<<m_ptData[i];
}

else{

ar >> m_nCount;
for (int i=0; i< m_nCount; i++)
	ar>>m_ptData[i];
}

 

 

 

void CMFCApplication2View::DrawX(CPoint point)
{
	CClientDC dc(this);

	dc.Ellipse(point.x, point.y, point.x + 100, point.y + 100);
}
---------
void CMFCApplication2View::OnLButtonDown(UINT nFlags, CPoint point)
{

	DrawX(point);

	CView::OnLButtonDown(nFlags, point);
}


void CMFCApplication2View::DrawX(CPoint point)
{
	CClientDC dc(this);

	dc.MoveTo(point.x - 10, point.y - 10);
	dc.LineTo(point.x + 10, point.y + 10);
	dc.MoveTo(point.x - 10, point.y + 10);
	dc.LineTo(point.x + 10, point.y - 10);


}
-------------


void CMFCApplication2View::OnLButtonDown(UINT nFlags, CPoint point)
{
	DrawX(point);

	CView::OnLButtonDown(nFlags, point);
}


void CMFCApplication2View::DrawX(CPoint point)
{
	CClientDC dc(this);

	dc.Rectangle(point.x, point.y, point.x + 100, point.y + 100);

 

void CMFCApplication1View::OnDraw(CDC* pDC)
{
	CMFCApplication1Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;

	CDC memDC;
	CBitmap bitmap, bithuman, bitstar,* oldbitmap;
	bithuman.LoadBitmap(IDB_HUMAN);
	bitstar.LoadBitmap(IDB_STAR);
	memDC.CreateCompatibleDC(pDC);

	oldbitmap = memDC.SelectObject(&bitstar);
	pDC->BitBlt(10, 10, 750, 458, &memDC, 0, 0, SRCCOPY);
	

	memDC.SelectObject(&bithuman);
	pDC->BitBlt(100, 300, 80,120, &memDC, 0, 0, SRCCOPY);
	pDC->BitBlt(400, 300, 80, 120, &memDC, 150, 0, SRCCOPY);
	pDC->StretchBlt(200, 100, 300, 280, &memDC, 230, 170, 300, 280, SRCCOPY);
	pDC->StretchBlt(400, 100, 100, 180, &memDC, 0, 0, 80, 120, SRCCOPY);
	pDC->StretchBlt(600, 100, 70, 100, &memDC, 80, 150, 80, 120, SRCCOPY);

	memDC.SelectObject(oldbitmap);
	bithuman.DeleteObject();
	bitstar.DeleteObject();
	memDC.DeleteDC();



	// TODO: ์—ฌ๊ธฐ์— ์›์‹œ ๋ฐ์ดํ„ฐ์— ๋Œ€ํ•œ ๊ทธ๋ฆฌ๊ธฐ ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
}
void CMFCApplication3Doc::OnLight_40() //-40
{
	// TODO: ์—ฌ๊ธฐ์— ๋ช…๋ น ์ฒ˜๋ฆฌ๊ธฐ ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
	for (int i = 0; i < 256; i++)
		for (int j = 0; j < 256; j++)
			if (m_InImg[i][j] - 40 <= 0) //0~255 
				m_OutImg[i][j] = 0; 
			else				
				m_OutImg[i][j] = m_InImg[i][j] - 40; 

	UpdateAllViews(NULL);
}

void CMFCApplication3View::OnLight30() //+30
{
	// TODO: ์—ฌ๊ธฐ์— ๋ช…๋ น ์ฒ˜๋ฆฌ๊ธฐ ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
	CMFCApplication3Doc* pDoc = GetDocument();
	for (int i = 0; i < 256; i++)
		for (int j = 0; j < 256; j++)
			if (pDoc->m_InImg[i][j] + 30 > 255) //0~255 
				pDoc->m_OutImg[i][j] = 255; 
			else
				pDoc->m_OutImg[i][j] = pDoc->m_InImg[i][j] + 30;

	Invalidate();
}


void CMFCApplication3View::OnLight50()  //+50
{
	CMFCApplication3Doc* pDoc = GetDocument();
	for (int i = 0; i < 256; i++)
		for (int j = 0; j < 256; j++)
			if (pDoc->m_InImg[i][j] + 50 > 255) //0~255 
				pDoc->m_OutImg[i][j] = 255;
			else
				pDoc->m_OutImg[i][j] = pDoc->m_InImg[i][j] + 50;

	Invalidate();

	// TODO: ์—ฌ๊ธฐ์— ๋ช…๋ น ์ฒ˜๋ฆฌ๊ธฐ ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
}