|
Image1->Canvas->Pixels[i][j]에 직접 RGB값을 넣지 마시고 Bitmap b를 하나 더 만들어서
b->Canvas->Pixels[i][j]=RGB( *(p+i*3+2),*(p+i*3+1),*(p+i*3+0) );
를 하신다음
Image1->Picture->Assign(b);
하시면 되겠네요...테스트는 안해봤습니다...;;
김연태 님이 쓰신 글 :
: Graphics::TBitmap*a=new Graphics::TBitmap();
Graphics::TBitmap*b=new Graphics::TBitmap(); <==
:
: if (OpenPictureDialog1->Execute())
: {
: OpenPictureDialog1->Filter = "BMP Image files (*.BMP)|*.BMP|All files (*.*)|*.*";
: a->LoadFromFile(OpenPictureDialog1->FileName);
: }
: for(int j=0;j<a->Height;j++)
: {
: unsigned char*p=(unsigned char*)a->ScanLine[j];
: for(int i=0;i<a->Width;i++)
: {
b->Canvas->Pixels[i][j]=RGB( *(p+i*3+2),*(p+i*3+1),*(p+i*3+0) ); <==
: }
: }
Image1->Picture->Assign(b); <==
:
: 이렇게 했는데 640*480 이미지를
: 320*240 정도 크기의 Image로 로드 시키려 합니다. 여기서
: Image1->Stretch = true;
: 를 추가 하여
: Zoom Out되어서 전체 이미지가 320*240크기의 Image에 보이도록 했는데 그냥 잘린 이미지만 나오는군요..
: 어찌 해결해야 할지 모르겠네요
: 고수님들의 조언 바랍니다,.~
:
|