https://github.com/jams10/Sprite_Tool

1. 사용 라이브러리

2. 프로그램 구성도

Untitled

3. 주요 기능 요약

1. 스프라이트 시트 출력

1. Direct3D와 Direct2D를 같이 사용하기 위한 설정.

// DXGI Surface로 부터 D2D 비트맵 생성.
	hr = pContext->CreateBitmapFromDxgiSurface(pSurface, &bp, &pBitmap);
	assert(hr == S_OK);

2. 스프라이트 시트 이미지를 출력하기 위한 변환 적용.

M_Origin = D2D1::Matrix3x2F::Translation(D2D1_SIZE_F{ width / 2.f, height / 2.f });                   // 윈도우 클라이언트 영역의 width, height
M_Mouse = D2D1::Matrix3x2F::Translation(D2D1_SIZE_F{ x, y });
M_Scale = D2D1::Matrix3x2F::Scale(scale,scale, D2D1_POINT_2F{ size.width / 2.f, size.height / 2.f});  // 스프라이트 시트 이미지의 width, height
...
pContext->SetTransform(M_Origin * M_Mouse * M_Scale);

...
pContext->DrawBitmap(
		&Bitmap,
		D2D1::RectF(-(bsize.width - bsize.width / 2), -(bsize.height - bsize.height / 2),                 // bsize는 스프라이트 시트 비트맵 사이즈.
			(bsize.width - bsize.width / 2), (bsize.height - bsize.height / 2)),
		1.0f,
		D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR,
		D2D1::RectF(0.0f, 0.0f, bsize.width, bsize.height)
	);

2. 스프라이트 영역 선택

1. 마우스 클래스