|
강요찬(난나) 님이 쓰신 글 :
: 안녕하세요...
:
: 그래픽 처리를 할 필요가 있어 여기저기 도움을 얻어 간단하게 작성을 해봤습니다만...
: Al-See 에서 이미지크기를 줄이면 화질의 변화를 전혀 느끼지 못하겠는데,
: 아래 소스로 변환하면 화질이 엉망이 되어 버리는군요... 어떤 다른 그래픽처리를 해줘야 하는 것 같습니다...
: 어떤 작업을 해줘야 하는지요?
:
: 혹, 관련 컴포넌트라도 알고 계시다면 답글 부탁드립니다...
:
: 감사합니다... (--)(__)
:
:
: Graphics::TBitmap *bmpptr;
: Graphics::TBitmap *new_bmp;
: TJPEGImage *jpg_temp;
:
: void __fastcall TFPicManager::EditSize(AnsiString fname)
: {
: AnsiString atemp=ExtractFileExt(fname).LowerCase();
: if (atemp==".bmp") {
: bmpptr->LoadFromFile(fname);
: } else { // jpg 경우
: jpg_temp->LoadFromFile(fname);
: bmpptr->Assign(jpg_temp);
: }
:
: //---------------------------------------------------------------------------
: //사이즈 변경.
: //---------------------------------------------------------------------------
: //Graphics::TBitmap*new_bmp=new Graphics::TBitmap();
: // new bmp 크기 조정
: new_bmp->Assign(bmpptr);
: new_bmp->Width=_ww;
: new_bmp->Height=_hh;
:
: new_bmp->Canvas->Handle, // handle of destination device context
: 0, // x-coordinate of upper-left corner of dest. rect.
: 0, // y-coordinate of upper-left corner of dest. rect.
: new_bmp->Width, // width of destination rectangle
: new_bmp->Height, // height of destination rectangle
: bmpptr->Canvas->Handle, // handle of source device context
: 0, // x-coordinate of upper-left corner of source rectangle
: 0, // y-coordinate of upper-left corner of source rectangle
: bmpptr->Width, // width of source rectangle
: bmpptr->Height, // height of source rectangle
: SRCCOPY // raster operation code
: );
:
: AnsiString new_fname=ExtractFilePath(fname)+_pre+ExtractFileName(fname);
: jpg_temp->Assign(new_bmp);
: jpg_temp->SaveToFile(new_fname);
: }
: //---------------------------------------------------------------------------
StretchBlt를 하시기 바로전에
SetStretchBltMode(new_bmp->Picture->Bitmap->Canvas->Handle, HALFTONE);
이걸 추가해 주시고요. 물론 윈95등에서는 작동하지 않습니다.
그래도 화질이 맘에 들지 않으신다면,
bmpptr->LoadFromFile(fname); 하시기전에 이 그림이 24bit다 32bit다 알려주기위해
new_bmp->Picture->Bitmap->PixelFormat = pf24bit;
를 추가해 보세요 ^^
|