1

このリンクhttps://developers.facebook.com/docs/reference/fql/profile/にリストされているように、Facebook クエリ言語で Profile の 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 leftますbottom right。これらがどのような座標なのか正確にはわかりません。<left>0.08468</left> <top>0.06897</top>正方形をトリミングするために、全体像の左上のピクセルに到達するにはどうすればよいですか? ちなみに私はPHPで書いています。

4

1 に答える 1

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 は正方形の幅と高さです。

于 2012-08-24T01:14:00.777 に答える