2012-04-20 2 views
1

このリンクに記載されているように、Facebookのクエリ言語でProfileのpic_cropオブジェクトを使用したいhttps://developers.facebook.com/docs/reference/fql/profile/ 私はこれを私のプロフィール画像で有効にして、これらの結果を得ました:/fql/profile/APIで 'pic_crop'を使用する方法

<fql_query_response list="true"> 
    <profile> 
    <pic_crop> 
     <uri>https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/xxxxxx_xxxxxxxx_xxxxxxxxxx_n.jpg</uri> 
     <width>180</width> 
     <height>173</height> 
     <left>0.08468</left> 
     <top>0.06897</top> 
     <right>0.91532</right> 
     <bottom>0.93103</bottom> 
    </pic_crop> 
    </profile> 
</fql_query_response> 

幅と高さは、大きな画像の正方形のサイズです。私が間違っている場合は私を修正しますが、top leftbottom rightは正方形を正しく見つけるためのオリジナルの大きな画像の座標です。これらの座標の種類は正確に分かりません。どのようにして情報の<left>0.08468</left><top>0.06897</top>大きな画像の左上のピクセルに四角形を切り取ることができますか?ところで、私はPHPで書いています。

答えて

0

左、上、右、下は比率であり絶対的な位置ではありません。

x = width * left = 15.2424 
y = height * top = 11.93181 
sw = width * (right-left) = 149.5152 
sh = height * (bottom -top) = 149.13638 

ここで、sw、shは正方形の幅と高さです。

関連する問題