C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[11629] Re:Re:감사합니다... 즐프...
고스트 [ghost2277] 2641 읽음    2001-10-08 14:37

방태윤 님이 쓰신 글 :
: 전에 제가 해 논게 있어 적어봅니다.
: 두개의 그림을 fade-in-out 하는겁니다.
: 대상그림은 24bit 비트맵 입니다.
:
: int get_fade_color(int first,int last,int pro)
: {
:   return (int)(((last-first)/100.0)*pro)+first;
: }
: int get_fade_rgb(int first,int last,int pro)
: {
:   return RGB(
:     get_fade_color(GetRValue(first),GetRValue(last),pro),
:     get_fade_color(GetGValue(first),GetGValue(last),pro),
:     get_fade_color(GetBValue(first),GetBValue(last),pro)
:   );
: }
:
: void __fastcall TFSlide::Button2Click(TObject *Sender)
: {
: //이 부분은 width 가 짝수이어야 함
:   Graphics::TBitmap*b=new Graphics::TBitmap();
:   b->LoadFromFile("c:\\11.bmp");
:
:   Graphics::TBitmap*a=new Graphics::TBitmap();
:   a->LoadFromFile("c:\\22.bmp");
:
:   unsigned char*buf=(unsigned char*)malloc(b->Width*b->Height*3); // 24 bit bitmap only
:   unsigned char*temp;
:
:   BITMAPINFO BitmapInfo;
:   ZeroMemory(&BitmapInfo,sizeof(BITMAPINFO));
:
:   BitmapInfo.bmiHeader.biSize        = sizeof(BitmapInfo.bmiHeader);
:   BitmapInfo.bmiHeader.biWidth       = b->Width;
:   BitmapInfo.bmiHeader.biHeight      = b->Height;
:   BitmapInfo.bmiHeader.biPlanes      = 1;
:   BitmapInfo.bmiHeader.biBitCount    = 24;
:   BitmapInfo.bmiHeader.biCompression = BI_RGB;
:   BitmapInfo.bmiHeader.biSizeImage   = b->Width*b->Height*3;
:
:   for(int k=0;k<200;k+=2){
:     temp=buf;
:     for(int j=0;j<b->Height;j++){
:       unsigned char*pb=(unsigned char*)b->ScanLine[b->Height-1-j];
:       unsigned char*pa=(unsigned char*)a->ScanLine[a->Height-1-j];
:       for(int i=0;i<b->Width*3;i++){
:         *temp=(unsigned char)get_fade_color((int)(*(pb+i)),(int)(*(pa+i)),k>100?100:k);
:         temp++;
:       }
:     }
:     SetDIBitsToDevice(Canvas->Handle,0,0,b->Width,b->Height,0,0,0,b->Height,
:                      buf,&BitmapInfo,DIB_RGB_COLORS);
:     if(k>=100){
:       break;
:     }
:   }
:
:   free(buf);
:   delete a;
:   delete b;
: }
:
:
: 고스트 님이 쓰신 글 :
: : 안녕하세요
: :
: : 고스트라고 합니당...
: :
: : 오늘도 즐프 하시고요~
: :
: : Graphics::TBitmap *bm1, *bm2; 
: :
: : bm1 = new Graphics::TBitmap;
: : bm2 = new Graphics::TBitmap;
: :
: : // 중간에 파일 읽어오기( bmp )
: :
: :
: : /////////////////////////////////
: : // 여기에서 어떻게 하는지...???
: : // bm2 속성을 어떻게 넎어야 하는지..
: : //////////////////////////////////
: : bm1->Canvas->Draw( 0,0, bm2 );
: :
: :
: : delete bm1;
: : delete bm2;
: :
: :
: : 2개의 이미지를 하나의 이미지로 만들고 싶습니다..
: :
: : 단순히 투명처리해서 만드는것이 아니라..
: :
: : 두개의 이미지를 서로 섞어서 만드는 이미지를 만들려고 하는데 도통 찾을수 없네요...
: :
: : 두개의 이지지에 중간색상을 얻어서 그려주고 싶은데 방법은 없는지...
: :
: :
: : 그럼 즐프....
: :
: :
: :
: :

+ -

관련 글 리스트
11616 이미지 합성에 관하여... 고스트 3160 2001/10/08
11627     Re:이미지 합성에 관하여... 방태윤 3147 2001/10/08
11629         Re:Re:감사합니다... 즐프... 고스트 2641 2001/10/08
11626     Re:이미지 합성에 관하여... 제라툴 3009 2001/10/08
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.