Jump to content
php.lv forumi

izdeidoto bilžu bakcgrounds


Devils666

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...