線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:602
推到 Plurk!
推到 Facebook!

test

 
yf90002
一般會員


發表:17
回覆:10
積分:5
註冊:2004-05-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-08-28 00:38:04 IP:219.71.xxx.xxx 未訂閱
 IMAGE S, D;
      BYTE    *R, *G, *B, *E;
      char    *ptr;
      int  x, y, Width, Height;
      double Gx,Gy,pi=3.14159;
      Width = Image1->Picture->Bitmap->Width;
      Height = Image1->Picture->Bitmap->Height;
      S.LoadImg(Image1->Picture->Bitmap);
      R = new BYTE[Width*Height];
      G = new BYTE[Width*Height];
      B = new BYTE[Width*Height];
      E = new BYTE[Width*Height];           for(y=0;yPicture->Bitmap->ScanLine[y];
        for(x=0;x -(pi/8)) && (fabs(Gy) fabs(Gx))/2>100 )
                  {
                    E[y*Width x] = 255;
                    a= E[y*Width x];                        }
               else if ( atan(Gy/Gx)<(3*pi/8) && atan(Gy/Gx)>(pi/8) && (fabs(Gy) fabs(Gx))/2>100 )
                   {
                    E[y*Width x] = 255;
                    b= E[y*Width x];                        }
                else if ( atan(Gy/Gx)<(5*pi/8) && atan(Gy/Gx)>(3*pi/8) && (fabs(Gy) fabs(Gx))/2>100 )
                    {
                      E[y*Width x] = 255;
                      c= E[y*Width x];                          }
                else if ( atan(Gy/Gx)< -(pi/8) && atan(Gy/Gx)> -(3*pi/8) && (fabs(Gy) fabs(Gx))/2>100 )
                    {
                      E[y*Width x] = 255;
                      d= E[y*Width x];                          }
                  
            }
        }
    if(a==255 && (fabs(Gy) fabs(Gx))/2>100)
       ShowMessage("這是0度");
    else if(b==255 && (fabs(Gy) fabs(Gx))/2>100)
       ShowMessage("這是45度");
    else if(c==255 && (fabs(Gy) fabs(Gx))/2>100)
       ShowMessage("這是90度");
    else if(d==255 && (fabs(Gy) fabs(Gx))/2>100)
       ShowMessage("這是135度");
    ShowMessage(fabs(Gx));
    Image2->Picture->Bitmap->Width = Image1->Picture->Bitmap->Width;
    Image2->Picture->Bitmap->Height = Image1->Picture->Bitmap->Height;
    Image2->Picture->Bitmap->PixelFormat = pf24bit;        for(y=0;yPicture->Bitmap->ScanLine[y];
        for(x=0;xPicture->Bitmap);
    Image2->Refresh();        delete R;
    delete G;
    delete B;
系統時間:2024-05-06 8:27:25
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!