|
방태윤 님이 쓰신 글 :
: 전에 제가 해 논게 있어 적어봅니다.
: 두개의 그림을 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개의 이미지를 하나의 이미지로 만들고 싶습니다..
: :
: : 단순히 투명처리해서 만드는것이 아니라..
: :
: : 두개의 이미지를 서로 섞어서 만드는 이미지를 만들려고 하는데 도통 찾을수 없네요...
: :
: : 두개의 이지지에 중간색상을 얻어서 그려주고 싶은데 방법은 없는지...
: :
: :
: : 그럼 즐프....
: :
: :
: :
: :
|