|
질문 내용을 보다 상세하게 적으시면 아마 답변이 더 많을 것 같군요.
일단, 저도 오늘 처음 제대로 한 번 만들어봤는데 의외로 간단하군요.
먼저 빈 폼에 2개의 TImage32 컨트롤을 넣습니다. 하나는 img32Src라고 이름을 바꾸고 또 하나는
img32Dst라고 이름을 바꾸고, img32Src를 더블클릭해서 임의의 이미지를 박아 넣습니다.
TTrackBar를 하나 박아 넣고 OnChange 이벤트를 작성합니다.
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "GR32_Transforms.hpp" // << 이거 추가해 줘야하죠
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "GR32_Image"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TrackBar1Change(TObject *Sender)
{
int nWidth = img32Src->Width;
int nHeight = img32Src->Height;
img32Dst->Bitmap->Width = nWidth;
img32Dst->Bitmap->Height = nHeight;
TAffineTransformation* pT = new TAffineTransformation();
pT->SrcRect = FloatRect(0,0,nWidth,nHeight);
pT->Rotate(nWidth/2, nHeight/2, TrackBar1->Position);
img32Dst->BeginUpdate();
img32Dst->Bitmap->Clear(clGray32);
Transform(img32Dst->Bitmap, img32Src->Bitmap, pT);
img32Dst->EndUpdate();
img32Dst->Repaint();
delete pT;
}
//---------------------------------------------------------------------------
해 보시면 잘 될겁니다.
이상훈 님이 쓰신 글 :
: graphics32에서 비트맵회전시켜보신분 계십니까?
:
: TTransformation 과 TAffineTransformation 을 어떻게 연결시켜야할지 모르겠습니다.
:
: 누가 좀 도와주세요...
|