လက်ရှိတည်နေရာ: ပင်မစာမျက်နှာ> နောက်ဆုံးရဆောင်းပါးများစာရင်း> Idefreedarc နှင့် imageconvolution ဖြင့် fuzzy arc ပုံကိုမည်သို့ဖန်တီးရမည်နည်း။ ပုံရိပ်အကျိုးသက်ရောက်မှုများမိတ်ဆက်

Idefreedarc နှင့် imageconvolution ဖြင့် fuzzy arc ပုံကိုမည်သို့ဖန်တီးရမည်နည်း။ ပုံရိပ်အကျိုးသက်ရောက်မှုများမိတ်ဆက်

M66 2025-06-23

1 ။ အဘိတ်: GD စာကြည့်တိုက်ကို enable

PHP တွင်, သင်သည် GD စာကြည့်တိုက်ကိုဖွင့်ထားကြောင်းပထမ ဦး ဆုံးသေချာအောင်လုပ်ရန်လိုအပ်သည်။ အကယ်. ၎င်းကိုဖွင့်ထားပါကသင်မသေချာပါက၎င်းကိုအောက်ပါနည်းလမ်းများဖြင့်စစ်ဆေးနိုင်သည်။

 <?php
if (function_exists('gd_info')) {
    echo "GD library is enabled!";
} else {
    echo "GD library is not enabled.";
}
?>

မက်ဆေ့ခ်ျကိုသင်မြင်လျှင် "GD စာကြည့်တိုက်ကိုဖွင့်ထားသည်" ဟုသင်မြင်လျှင်, ဆိုလိုသည်မှာ GD စာကြည့်တိုက်ကိုဖွင့်ထားသည်။ မဖွင့်ပါကသင့်ပတ်ဝန်းကျင်နှင့်အညီထည့်သွင်းပါ။


2 ။ ပတ်တူတစ်ခုဖန်တီးပြီး arc ဆွဲပါ

arc ဆွဲရန် Idefreeedarc ကို ပထမ ဦး ဆုံးအသုံးပြုသည်။ Idefefeedarc သည် ပုံပေါ်၌ပြည့်စုံသော acc ကိုဆွဲဆောင်နိုင်သည်။

 <?php
// a 400x400 Image Canvas Canvas
$image = imagecreatetruecolor(400, 400);

// နောက်ခံအရောင်ကိုသတ်မှတ်ပါ(အဖြူ)
$background_color = imagecolorallocate($image, 255, 255, 255);
imagefill($image, 0, 0, $background_color);

// arc အရောင် set(နီသော)
$arc_color = imagecolorallocate($image, 255, 0, 0);

// 绘制一个နီသော的弧形
imagefilledarc($image, 200, 200, 300, 300, 0, 180, $arc_color, IMG_ARC_PIE);

// output ကိုပုံ
header("Content-Type: image/png");
imagepng($image);
imagedestroy($image);
?>

ဤကုဒ်တွင် 400x400 ပတ်တူတစ်ခုကိုဖန်တီးပြီးအနီရောင် arc ကိုပတ်တူပေါ်တွင်ဆွဲပါ။ arc ၏စတင်ရာထောင့်သည် 0 ဒီဂရီဖြစ်ပြီးအဆုံးထောင့်သည် 180 ဒီဂရီဖြစ်ပြီးတစ်ဝက်ဝန်းကျင်ကိုကိုယ်စားပြုသည်။


3 ။ အဆိုပါ arc မှ Blur အကျိုးသက်ရောက်မှုကိုထည့်ပါ

ထို့နောက် arc image သို့ blur သက်ရောက်မှုများထည့်ရန် စိတ်ကူးစိတ်သန်းကို အသုံးပြုပါမည်။ အဆိုပါ Imageconvolution function သည် convolution matrix ကို အခြေခံ. ရုပ်ပုံများကိုလုပ်ဆောင်နိုင်သည့်အလွန်အစွမ်းထက်သောပုံရိပ်ထုတ်ယူမှုကိရိယာတစ်ခုဖြစ်သည်။

ပထမ ဦး ဆုံး fuzzy convertution matrix ကိုပထမ ဦး ဆုံးသတ်မှတ်ကြပါစို့။

 <?php
// ပုံကပတ်တူဖန်တီးပါ
$image = imagecreatetruecolor(400, 400);

// နောက်ခံအရောင်ကိုသတ်မှတ်ပါ
$background_color = imagecolorallocate($image, 255, 255, 255);
imagefill($image, 0, 0, $background_color);

// arc အရောင် set
$arc_color = imagecolorallocate($image, 255, 0, 0);

// arc ပုံစံများဆွဲပါ
imagefilledarc($image, 200, 200, 300, 300, 0, 180, $arc_color, IMG_ARC_PIE);

// fuzzy convertution matrix ကို defining
$matrix = [
    [1 / 9, 1 / 9, 1 / 9],
    [1 / 9, 1 / 9, 1 / 9],
    [1 / 9, 1 / 9, 1 / 9]
];

// fuzzy အပြောင်းအလဲနဲ့များအတွက် convertution matrix ကိုသုံးပါ
imageconvolution($image, $matrix, 9, 0);

// output ကိုပုံ
header("Content-Type: image/png");
imagepng($image);
imagedestroy($image);
?>

ဤကုဒ်တွင် 3x3 fuzzy convertution matrix ကိုသတ်မှတ်သည်။ ၎င်းသည် pixel ပျမ်းမျှအားဖြင့် pixel ပျမ်းမျှအားဖြင့် pixel တစ်ခုစီ၏အရောင်တန်ဖိုးကိုပြုလုပ်ရန်အသုံးပြုသည်။


4 ။ ပြည့်စုံသောအသုံးပြုမှု: fuzzy arc diagrams ၏ပြီးစီး

acceContonvolution blur အကျိုးသက်ရောက်မှုဖြင့် accepefeledarc မှ accfreeedarc မှရေးဆွဲခြင်းအားဖြင့်ကျွန်ုပ်တို့သည် arc ပုံရိပ်ကိုမှုန်ဝါးခြင်းဖြင့်ရနိုင်သည်။ ဤပုံရိပ်အကျိုးသက်ရောက်မှုကို UI ဒီဇိုင်းနှင့်အထူးသက်ရောက်မှုများပြုပြင်ခြင်းများတွင်အသုံးပြုသည်။ ၎င်းသည်ပုံကိုပျော့ပြောင်းပြီးအလွှာကိုပိုမိုနူးညံ့စေနိုင်သည်။


5 ။ အကျဉ်းချုပ်

ဤဆောင်းပါးမှတစ်ဆင့် PHP တွင် Idefreedarc နှင့် ImageConvolution လုပ်ဆောင်ချက်များကို အသုံးပြု. blurred effects ဖြင့် arc ပုံရိပ်ကိုမည်သို့ဖန်တီးရမည်ကိုလေ့လာခဲ့သည်။ ဤလုပ်ဆောင်ချက်များကို developer များက 0 က်ဘ်အပလီကေးရှင်းများသို့ကြွယ်ဝသောပုံရိပ်အကျိုးသက်ရောက်မှုများကိုတိုးပွားစေပြီးသုံးစွဲသူအတွေ့အကြုံကိုတိုးတက်စေသည်။

ပိုများသောပုံရိပ်အကျိုးသက်ရောက်မှုများကိုမည်သို့ကိုင်တွယ်ရမည်ကိုသင်ပိုမိုသိလိုပါကတရားဝင် PHP မှတ်တမ်းများသို့မဟုတ်ဆက်စပ်ပုံရိပ်ထုတ်ပေးသည့်သင်ခန်းစာများကိုသင်ရည်ညွှန်းနိုင်သည်။ ဤကိရိယာများနှင့်နည်းစနစ်များသည် arcs များနှင့် blurs ကိုကန့်သတ်ထားခြင်းမရှိပါ။