'예제'에 해당되는 글 8건
-
2008/03/21
자바 예제 11.3 (1)
- 2008/03/18
- 2008/03/03
- 2008/02/02
- 2008/01/28
- 2008/01/28
- 2008/01/10
- 2008/01/07
// 실습 11.3: Taegukgi.java
import java.applet.Applet;
import java.awt.*;
public class Taegukgi2 extends Applet
{
//태극기를 그린다.
public void paint (Graphics page)
{
//태극마크를 그린다.
page.setColor(Color.red);
page.fillArc(120,60,120,120,0,180);
page.setColor(Color.blue);
page.fillArc(120,60,120,120,180,180);
page.setColor(Color.red);
page.fillArc(120,90,60,60,180,180);
page.setColor(Color.blue);
page.fillArc(180,90,60,60,0,180);
//건곤감리를 그린다.
page.setColor(Color.black);
int x1[]={54,64,99,89};
int y1[]={72,79,28,21};
page.fillPolygon(x1,y1,4);
int x2[]={67,77,112,102};
int y2[]={81,88,37,30};
page.fillPolygon(x2,y2,4);
int x3[]={80,90,125,115};
int y3[]={90,97,46,39};
page.fillPolygon(x3,y3,4);
int x4_1[]={235,245,261,251};
int y4_1[]={46,39,63,70};
page.fillPolygon(x4_1,y4_1,4);
int x4_2[]={254,264,280,270};
int y4_2[]={74,67,91,98};
page.fillPolygon(x4_2,y4_2,4);
int x5[]={248,258,293,283};
int y5[]={37,30,81,88};
page.fillPolygon(x5,y5,4);
int x6_1[]={261,271,287,277};
int y6_1[]={28,21,45,52};
page.fillPolygon(x6_1,y6_1,4);
int x6_2[]={280,290,306,296};
int y6_2[]={56,49,73,80};
page.fillPolygon(x6_2,y6_2,4);
int x7[]={54,64,99,89};
int y7[]={168,161,212,219};
page.fillPolygon(x7,y7,4);
int x8_1[]={67,77,93,83};
int y8_1[]={159,152,176,183};
page.fillPolygon(x8_1,y8_1,4);
int x8_2[]={86,96,112,102};
int y8_2[]={186,179,203,210};
page.fillPolygon(x8_2,y8_2,4);
int x9[]={80,90,125,115};
int y9[]={150,143,194,201};
page.fillPolygon(x9,y9,4);
int x10_1[]={235,245,261,251};
int y10_1[]={194,201,177,170};
page.fillPolygon(x10_1,y10_1,4);
int x10_2[]={254,264,280,270};
int y10_2[]={167,174,150,143};
page.fillPolygon(x10_2,y10_2,4);
int x11_1[]={248,258,274,264};
int y11_1[]={203,210,186,179};
page.fillPolygon(x11_1,y11_1,4);
int x11_2[]={267,277,293,283};
int y11_2[]={176,183,159,152};
page.fillPolygon(x11_2,y11_2,4);
int x12_1[]={261,271,287,277};
int y12_1[]={212,219,195,188};
page.fillPolygon(x12_1,y12_1,4);
int x12_2[]={280,290,306,296};
int y12_2[]={185,192,168,161};
page.fillPolygon(x12_2,y12_2,4);
}
}
| 자바 예제 11.3 (1) | 2008/03/21 |
|---|---|
| 소프트웨어사업대가의기준_고시전문(0711월) (0) | 2008/03/12 |
| 간단한 이진 계산 (0) | 2008/01/28 |
| 함수 이용시 변수 및 함수가 보이지 않을 때 (0) | 2008/01/28 |
| 2008년 정보처리기사 시험일정 (0) | 2008/01/21 |
| 네이트온 파일방 설정 방법 (0) | 2008/01/10 |
| eclipse 3.3 europa + mysql Connection Pool 설정시 오류 및 설정 방법 (0) | 2008/05/27 |
|---|---|
| 로컬 디비 연결 관련 (0) | 2008/05/26 |
| 서버 접속 참고 녀석 (0) | 2008/05/25 |
| 앞으로 자주 쓸 듯해서... db접속 관련 코드 (0) | 2008/05/20 |
| JSP의 작은 실수 하기 쉬우 부분 (0) | 2008/05/05 |
| 과제 참고 소스 (0) | 2008/03/18 |
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.
| 컨트롤과 연결가능한 변수 종류 (0) | 2008/02/10 |
|---|---|
| 대화상자 생성 및 이벤트 처리 (0) | 2008/02/02 |
| OnInitDialog함수 (0) | 2008/02/02 |
| 대화상자 주요 속성 (0) | 2008/02/02 |
| LOGFONT 기본 설정 (0) | 2008/01/28 |
| 텍스트 설정 함수 (0) | 2008/01/28 |
void View::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(nFlags & MK_LBUTTON)
{
// 여기에 코드를 넣으면 마우스 버튼이 눌린 동안 작동
}
CView::OnMouseMove(nFlags, point);
}
| 텍스트 출력 함수 (0) | 2008/01/28 |
|---|---|
| CFont 클래스를 이용하여 새로운 글꼴을 생성하는 방법들 (0) | 2008/01/28 |
| OnMouseMove함수에서 마우스 버튼 눌려졌을 때 설정 (0) | 2008/01/28 |
| SetROP2함수 (0) | 2008/01/28 |
| 4대 클레스 실행 순서 (0) | 2008/01/28 |
| 타 클래스 접근 방식 (0) | 2008/01/28 |
| MFC 화면 크기 얻기 (0) | 2008/01/28 |
|---|---|
| View 클래스의 OnInitialUpdate함수 (0) | 2008/01/28 |
| WM_TIMER 사용법 (0) | 2008/01/28 |
| SelectObject 함수 사용시 주의점(내장 오프젝트 내용 포함) (0) | 2008/01/28 |
| 디바이스 컨텍스트 클래스 관련 (0) | 2008/01/28 |
| DC에 저장되는 그래픽 옵션의 범주 (0) | 2008/01/28 |
| 간단한 이진 계산 (0) | 2008/01/28 |
|---|---|
| 함수 이용시 변수 및 함수가 보이지 않을 때 (0) | 2008/01/28 |
| 2008년 정보처리기사 시험일정 (0) | 2008/01/21 |
| 네이트온 파일방 설정 방법 (0) | 2008/01/10 |
| 헝가리 표기법 (0) | 2008/01/07 |
| 다이렉트X(DirectX) (0) | 2008/01/07 |
#include <windows.h>
// WinMain()함수에서 참조하므로 함수 원형을 선언한다.
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPreInstance, LPSTR lpCmdLine, int nShowCmd)
{
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
// 윈도우 클래스를 초기화하고 운영체제에 등록한다.
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = "HelloClass";
if(!RegisterClass(&wndclass))
{
return -1;
}
// 윈도우를 생성하고 화면에 보이게 한다.
hwnd = CreateWindow("HelloClass", "Hello SDK Application", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
ShowWindow(hwnd, nShowCmd);
UpdateWindow(hwnd);
// 메세지 대기열에서 메시지를 하나씩 꺼내 처리한다.
while(GetMessage(&msg, NULL, 0, 0) > 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
char *str = "Hello SDK";
// 메시지 종류에 따라 응용 프로그램이 적절히 처리한다.
switch(message)
{
case WM_CREATE :
return 0;
case WM_PAINT :
hdc = BeginPaint(hwnd, &ps);
TextOut(hdc, 100, 100, str, lstrlen(str));
EndPaint(hwnd, &ps);
return 0;
case WM_LBUTTONDOWN :
MessageBox(hwnd, "마우스를 클릭했습니다.", "마우스 메세지", MB_OK);
return 0;
case WM_DESTROY :
PostQuitMessage(0);
return 0;
}
// 응용프로그램이 처리하지 않으면 윈도우 운영체제가 처리한다.
return DefWindowProc(hwnd, message, wParam, lParam);
}
| DC에 저장되는 그래픽 옵션의 범주 (0) | 2008/01/28 |
|---|---|
| MFC 도큐먼트 클래스에서의 저장 방법 (0) | 2008/01/22 |
| MFC 화면 업데이트 함수 호출 (0) | 2008/01/22 |
| AppWizard에서 프로젝트 생성시... (0) | 2008/01/09 |
| MessageBox Function (0) | 2008/01/09 |
| 간단한 SDK 예제 프로그램 (0) | 2008/01/07 |