Devils666 Posted December 30, 2009 Report Share Posted December 30, 2009 sveiki, te atkal es, sorry ka tik bieži te postoju... taču - modificiju vienu bilžu reseizeri, kas apgriež malas ar attiecibu 1:1 un dazām bildem sanāk melnas malas, kas ir backgrounds koda daļa function createThumb(){ $this->thumb = imagecreatetruecolor($thumbSize1, $thumbSize2); imagecopyresampled($this->thumb, $this->myImage, 0, 0,$this->x, $this->y, $thumbSize1, $thumbSize2, $this->cropWidth, $this->cropHeight); } kā es varētu nomainīt, lai taisõt bildes, background būtu balts, ja gadijumā tas ir vajadzīgs Quote Link to comment Share on other sites More sharing options...
waplet Posted December 30, 2009 Report Share Posted December 30, 2009 kāda jēga apgriezt ar 1 pret 1? tad apgriez pēc īsākās malas :) Quote Link to comment Share on other sites More sharing options...
Devils666 Posted December 30, 2009 Author Report Share Posted December 30, 2009 (edited) nu man tā lapas dizainā vislabāk, visādi izmēģināju, un ta jau vispār gaumes lieta :P bet par temu, kā dabūt, lai backgrounds izveidotajam bildem butu balts nevis melns? Edited December 30, 2009 by Devils666 Quote Link to comment Share on other sites More sharing options...
waplet Posted December 30, 2009 Report Share Posted December 30, 2009 pastkeis, ko tā imagecreatetruecolor piedāvā tev Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted January 4, 2010 Report Share Posted January 4, 2010 Visdrīzāk tev šie mainīgie nepareizi sarēķinās - $this->x, $this->y, $this->cropWidth, $this->cropHeight, tādēļ bilde tiek apgriezta mazāka nekā tiek izveidota un paliek melnas malas. Vai arī, proporcionāli samazināta un nocentrēta jaunajā, lai pieliktu liekās malas. Quote Link to comment Share on other sites More sharing options...
werd Posted January 4, 2010 Report Share Posted January 4, 2010 imagecolorallocate // sets background to red $background = imagecolorallocate($im, 255, 0, 0); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.