النتائج 1 إلى 6 من 6

الموضوع: يا أخوان هل في دالة لتصغير الصور و هل في دالة لدمج الصور ؟؟

  1. #1
    عضو نشيط جدا
    تاريخ التسجيل
    Apr 2004
    المشاركات
    504

    Unhappy يا أخوان هل في دالة لتصغير الصور و هل في دالة لدمج الصور ؟؟



    السلام على الأخوان جميعاً

    شباب أسأل إذا في دالتين الي مطلوبين ؟

    1- دالة تصغير الصور
    2- دالة دمج الصور


    إذا في واحد يعرف اي غله حتى او كانت بصيطه يعطينيا أياها


    وشكراً يا أخوان على جهودكم الطيبه



    أخوكم حمد





    star4host غير متواجد حالياً


  2. #2
    عضو نشيط جدا
    تاريخ التسجيل
    Aug 2004
    المشاركات
    361


    هذا هو للتصغير

    ولكن بعتمد على مكتبة GD


    كود PHP:

    /*

    Smart Image Thumbnail Creator
    By AJ Quick
    [email]AJ@AJQuick.com[/email]

    Version 1.2W

    There will be some minor alterations that you will need to do with this to make it work to your liking. This is ment to be used in addition to some type of image upload script. You will need to do some changes to the variable to make it stick, and make thumbnails to your liking. This is not exact and it will not work every time, but it is very successful. It will resize your image, and crop it at the same time so you don't have stretching, or black areas in the thumbnail. Included in this is the function of good resizing, by John Jensen.

    */

    //VARIABLES

    $nw=100//The Width Of The Thumbnails
    $nh=75//The Height Of The Thumbnails

    $ipath "/web/you/etc/"//Path To Place Where Images Are Uploaded. No Trailing Slash
    $tpath "/web/you/etc/thumbnails";//Path To Place Where Thumbnails Are Uploaded. No Trailing Slash

    /*
    You will need to go down in the code below, and change the image names. Currently it is set as "$img".
    The outputted thumbnail's name is: "$thumb".
    */



    $dimensions GetImageSize($img);

    $thname "$tpath/$img_name";

    $w=$dimensions[0];
    $h=$dimensions[1];

    $img2 ImageCreateFromJpeg($img);
    $thumb=ImageCreateTrueColor($nw,$nh);
        
    $wm $w/$nw;
    $hm $h/$nh;
        
    $h_height $nh/2;
    $w_height $nw/2;
        
    if(
    $w $h){
        
        
    $adjusted_width $w $hm;
        
    $half_width $adjusted_width 2;
        
    $int_width $half_width $w_height;
        
        
    ImageCopyResampled($thumb,$img2,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h); 
        
    ImageJPEG($thumb,$thname,95); 
        
    }elseif((
    $w $h) || ($w == $h)){
        
        
    $adjusted_height $h $wm;
        
    $half_height $adjusted_height 2;
        
    $int_height $half_height $h_height;
        
        
    ImageCopyResampled($thumb,$img2,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h); 
        
    ImageJPEG($thumb,$thname,95); 
        
    }else{
        
    ImageCopyResampled($thumb,$img2,0,0,0,0,$nw,$nh,$w,$h);     
        
    ImageJPEG($thumb,$thname,95); 
    }

    imagedestroy($img2); 






    __________________
    أستغفر الله :: أستغفر الله :: أستغفر الله ::
    لا إله إلا أنت سبحانك أستغفرك وأتوب إليك إنى كنت من الظالمين

    phparabia @ msn.com
    PHP-ARABIA.com غير متواجد حالياً

  3. #3
    عضو نشيط جدا
    تاريخ التسجيل
    Apr 2004
    المشاركات
    504


    مشكور أخوي PHP-ARABIA.com

    على هل داله الي كنت ناطرها من زمان

    ولكن ها هناك داله لدمج الصور ؟؟

    يعني أحط صوره داخل صوره

    وشكراً لك

    أخوك حمد





    star4host غير متواجد حالياً

  4. #4
    عضو نشيط
    تاريخ التسجيل
    Nov 2003
    المشاركات
    175


    بالنسبة لدالة التصغير في بعض الأحيان تشوه الصورة ، و لا أدي لماذا ..

    يبدو أن مكتبة GD لديها حساسية من بعض الألوان ..





    __________________
    إن كان الكلام من فضة ، فالسكوت من ذهب
    أبو كامل غير متواجد حالياً

  5. #5
    عضو نشيط جدا
    تاريخ التسجيل
    Aug 2004
    المشاركات
    361


    رد مقتبس من أبو كامل
    بالنسبة لدالة التصغير في بعض الأحيان تشوه الصورة ، و لا أدي لماذا ..

    يبدو أن مكتبة GD لديها حساسية من بعض الألوان ..

    من الطبيعى ان تفقد الصورة بعض من قيمتها اللونية عند التصغير عموما وليس فقط بسبب مكتبة GDجى دى
    حتى هذا يحدث فى برنامج الفوتوشوب

    الاخ aa25

    الكود التالى لإنشاء الصورة

    كود PHP:


    <?php 

        $im 
    imagecreate(500500); // Create a blank 500x500 pixel image. 
        
    $white imagecolorallocate($im255255255); // Allocate $white to the white color in $im. 
        
    $blue imagecolorallocate($im00255); // Allocate $blue to the blue color in $im. 
        
    imagerectangle($im315390440); // Create a rectangle starting at (3, 15), the upper left corner, that goes down to (390, 440), the lower right corner. 
        
    header('Content-Type: image/png'); // Send the PNG content type header so the browser knows what it's getting. 
        
    imagepng($im); // Output the image to the browser. 

    ?>






    __________________
    أستغفر الله :: أستغفر الله :: أستغفر الله ::
    لا إله إلا أنت سبحانك أستغفرك وأتوب إليك إنى كنت من الظالمين

    phparabia @ msn.com
    PHP-ARABIA.com غير متواجد حالياً

  6. #6
    عضو نشيط جدا
    تاريخ التسجيل
    Apr 2004
    المشاركات
    504


    مشكوووووور أخوي PHP-ARABIA.com

    أنشالله نخدمك في الأفراح

    وشكراً لكم جميعاً

    أخوكم حمد





    star4host غير متواجد حالياً





ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض