نمایش نتایج 1 تا 3 از 3

نام تاپیک: imagecolorexact

  1. #1
    کاربر دائمی آواتار billgivz
    تاریخ عضویت
    مهر 1387
    محل زندگی
    شیراز
    پست
    275

    imagecolorexact

    سلام میخواستم بدونم چطور میشه خروجی تابع imagecolorexact رو که index هست به height و with تبدیل کرد
    ?

    در ضمن این تایع کارش اینه که یک کد رنگ رو به عنوان ورودی دریافت کرده و خروجیش موقعیت کد رنگ رو عکس نشون میده البته به صورت index
    http://www.php.net/manual/en/functio...colorexact.php

  2. #2
    کاربر دائمی آواتار sattaryekta
    تاریخ عضویت
    دی 1389
    محل زندگی
    اصفهان
    سن
    40
    پست
    220

    نقل قول: imagecolorexact


    $red = 161;
    $green = 40;
    $blue = 41;

    /**
    * create image and put pixels in of our color
    */
    $pic = imagecreatetruecolor(10,10);
    $white = imagecolorallocate($pic, 255, 255, 255);
    $ourcolor = imagecolorallocate($pic, 161, 40, 41);
    imagefill($pic, 0,0,$white);
    imagefilledrectangle($pic, 5, 5, 7, 7, $ourcolor);

    /**
    * now find where color occurs in image
    */
    $srch_rgb = ($red << 16) + ($green << 8) + $blue;

    $w = imagesx ($pic);
    $h = imagesy ($pic);
    for ($x=0; $x<$w; $x++)
    {
    for ($y=0; $y<$h; $y++)
    {
    if (imagecolorat($pic, $x, $y) == $srch_rgb) echo "$x, $y <br/>";
    }
    }




    منبع: http://www.phpfreaks.com/forums/php-...agecolorexact/

  3. #3
    کاربر دائمی آواتار billgivz
    تاریخ عضویت
    مهر 1387
    محل زندگی
    شیراز
    پست
    275

    نقل قول: imagecolorexact

    نقل قول نوشته شده توسط sattaryekta مشاهده تاپیک

    $red = 161;
    $green = 40;
    $blue = 41;

    /**
    * create image and put pixels in of our color
    */
    $pic = imagecreatetruecolor(10,10);
    $white = imagecolorallocate($pic, 255, 255, 255);
    $ourcolor = imagecolorallocate($pic, 161, 40, 41);
    imagefill($pic, 0,0,$white);
    imagefilledrectangle($pic, 5, 5, 7, 7, $ourcolor);

    /**
    * now find where color occurs in image
    */
    $srch_rgb = ($red << 16) + ($green << 8) + $blue;

    $w = imagesx ($pic);
    $h = imagesy ($pic);
    for ($x=0; $x<$w; $x++)
    {
    for ($y=0; $y<$h; $y++)
    {
    if (imagecolorat($pic, $x, $y) == $srch_rgb) echo "$x, $y <br/>";
    }
    }


    منبع: http://www.phpfreaks.com/forums/php-...agecolorexact/
    ممنون دوست عزیز

    غیر از اینکه بیام تمام پیکسل ها رو بررسی کنیم راه دیگه ای نیست .

    منظورم تابع خاص .

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •