Author Topic: wxgraphic.php current conditions icons size  (Read 1551 times)

0 Members and 1 Guest are viewing this topic.

Offline naish666

  • Member
  • *
  • Posts: 2
wxgraphic.php current conditions icons size
« on: February 09, 2012, 05:01:34 PM »
Hello,

It's possible to change the size of the default current_conditions icons? (of the  wxgraphic.php)
The default size is 25x25 and I wanna change it.

Thank you

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxgraphic.php current conditions icons size
« Reply #1 on: February 09, 2012, 06:40:12 PM »
The short answer is 'Yes'.. you can use icons other than the default 25x25 icons.  You'd need to create a matching set of icons to the ones already in the icons/ directory .. your choice of .gif (non-animated), .jpg or .png .. just make them all have the same (square) dimensions.

Then change wxgraphic.php code
Code: [Select]
// now let's create the image
switch (TRUE){
  case ($type == "banner"):
       // put the icon on the background
       if (isset($icon)) {
          imagecopyresampled($img, $icon, $banner_icon_x, $banner_icon_y, 0, 0, 25, 25, 25, 25);
       } // end if
       // write the text onto the 468X60 banner
       write_banner();
  break;
  case ($type == "banner_big"):
       if (isset($icon)) {
          imagecopyresampled($img, $icon, $banner_big_icon_x, $banner_big_icon_y, 0, 0, 25, 25, 25, 25);
      } // end if
       // write the text onto the 500X80 banner
       write_banner_big();
  break;
  case ($type == "avatar"):
       if (isset($icon)) {
          imagecopyresampled($img, $icon, $avatar_icon_x, $avatar_icon_y, 0, 0, 25, 25, 25, 25);
      } // end if
       // write the text onto the 500X80 banner
       write_avatar();
  break;
  case empty($type):
       if (isset($icon)) {
          imagecopyresampled($img, $icon, $default_icon_x, $default_icon_y, 0, 0, 25, 25, 25, 25);
       } // end if
       // write the text onto the default image
     write_default();
  break;
} // end switch

for the new dimensions.

Hope this helps..
Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline naish666

  • Member
  • *
  • Posts: 2
Re: wxgraphic.php current conditions icons size
« Reply #2 on: February 10, 2012, 03:24:21 AM »
It's works.

Thank you very much.

 

anything