imagecolorset Function in PHP

Ankith Reddy
Updated on 31-Dec-2019 07:46:41

121 Views

The imagecolorset() function sets the color for the specified palette index. Using this create flood-fill-like effects in palleted images.Syntaximagecolorset ( img, index, red, green, blue, alpha )Parametersimg: Image created with imagecreatetruecolor() functionindex: The index in the palette imagered: Value of red componentgreen: Value of green componentblue: Value of blue componentalpha: The transparency if image.ReturnThe imagecolorset() function returns nothing.ExampleThe following is an exampleOutputThe following is the output:

imagecolorsforindex Function in PHP

George John
Updated on 31-Dec-2019 07:46:17

105 Views

The imagecolorsforindex() function gets the colors for an index.Syntaximagecolorsforindex ( img, index )Parametersimg: Creates an image with imagecreatetruecolor()Index: Set the color index.ReturnThe imagecolorsforindex() function returns an associative array with red, green, blue and alpha keys that contain the appropriate values for the specified color index.ExampleThe following is an example Live DemoOutputThe following is the output:array(4) { ["red"]=> int(255) ["green"]=> int(255) ["blue"]=> int(255) ["alpha"]=> int(127) }

imagecolorresolvealpha Function in PHP

Arjun Thakur
Updated on 31-Dec-2019 07:45:27

53 Views

The imagecolorresolvealpha() function is used to get the index of the specified color with alpha.Syntaximagecolorresolvealpha (img , red , green , blue , alpha )Parametersimg: Creates an image with imagecreatetruecolor().red: The red componentgreen: The green componentblue: The blue componentalpha: Value between 0 and 127. 0 indicates completely opaque while 127 indicates completely transparent.ReturnThe imagecolorresolvealpha() function returns the color index.ExampleThe following is an example Live DemoOutputThe following is the output:Array ( [0] => 128 [1] => 129 [2] => 130 )

Order by Numeric Value from String Records

AmitDiwan
Updated on 31-Dec-2019 07:45:16

109 Views

Let us first create a table −mysql> create table DemoTable1969    (    BranchCode varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1969 values('CSE 101'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1969 values('CSE 11'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1969 values('CSE 15'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1969 values('CSE 6'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1969 values('CSE 201'); Query OK, 1 row affected (0.00 sec) mysql> insert into ... Read More

imagecopymergegray Function in PHP

George John
Updated on 31-Dec-2019 07:44:46

89 Views

The imagecopymergegray() function is used to copy and merge part of an image with gray scale.Syntaximagecopymerge ( dst_img, src_img, dst_x, dst_y, src_x, src_y, src_w, src_h, pct )Parametersdst_im Set destination image link resource.src_im Set source image link resource.dst_xSet x-coordinate of destination point.dst_y Set y-coordinate of destination point.src_x Set x-coordinate of source point.src_y Set y-coordinate of source point.src_w Set source width.src_h Set source height.pct The src_im will be changed to grayscale according to pct where 0 is fully grayscale and 100 is unchanged.ReturnThe imagecopymergegray() function returns the TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:ExampleLet us see another example wherein we have set ... Read More

jQuery not() Method with Examples

AmitDiwan
Updated on 31-Dec-2019 07:44:27

248 Views

The not() method in jQuery is used to return elements that do not match specific criteria.SyntaxThe syntax is as follows −$(selector).not(criteria, func(index))Above, criteria are a selector expression, whereas func is the function to run for each element in the group.ExampleLet us now see an example to implement the jQuery not() method − Live Demo    $(document).ready(function(){       $("button").click(function(){          $("h2").not(".demo").css("color", "orange");       });    }); h2 {    color: blue; } Student Info This is a demo text. Exam Info This is a demo text. Teacher's ... Read More

imagecopy Function in PHP

Arjun Thakur
Updated on 31-Dec-2019 07:42:43

885 Views

The imagecopy() function is used to copy part of an image.Syntaximagecopy( dst_img, src_img, dst_x, dst_y, src_x, src_y, src_w, src_h)Parametersdst_im Set destination image link resource.src_im Set source image link resource.dst_x Set x-coordinate of destination point.dst_y Set y-coordinate of destination point.src_x Set x-coordinate of source point.src_y Set y-coordinate of source point.src_w Set source width.src_h Set source height.ReturnThe imagecopy() function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:ExampleLet us see another example wherein part of an image is copied:OutputThe following is the output:Read More

Set a Specific Value for the First Three Column Values in MySQL

AmitDiwan
Updated on 31-Dec-2019 07:42:15

234 Views

To set a specific value for only 1st three values, you need to use LIMIT 3. Let us first create a table −mysql> create table DemoTable1968    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Name varchar(20)    ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1968(Name) values('Chris'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1968(Name) values('David'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1968(Name) values('Sam'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1968(Name) values('Mike'); Query OK, 1 ... Read More

imagecopymerge Function in PHP

Chandu yadav
Updated on 31-Dec-2019 07:41:39

797 Views

The imagecopymerge() function copy and merge part of an image.Syntaximagecopymerge ( dst_img, src_img, dst_x, dst_y, src_x, src_y, src_w, src_h, pct )Parametersdst_im Set destination image link resource.src_im Set source image link resource.dst_x Set x-coordinate of destination point.dst_y Set y-coordinate of destination point.src_x Set x-coordinate of source point.src_y Set y-coordinate of source point.src_w Set source width.src_h Set source height.pct The two images will be merged according to pct which can range from 0 to 100.ReturnThe imagecopymerge() function returns the TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output displaying the merge of two images:ExampleLet us see ... Read More

imagecharup Function in PHP

Ankith Reddy
Updated on 31-Dec-2019 07:40:15

56 Views

The imagecharup() function is used to draw a character vertically.Syntaximagecharup( img, font, x, y, c, color )Parametersimg: Create an image with imagecreatetruecolor()font: Sets the font size. It can be 1, 2, 3, 4, 5 for built-in fonts in latin2 encodingx: x-coordinatey: y-coordinatec: character to be drawncolor: color identifierReturnThe imagecharup() function returns TRUE on success or FALSE on failure.ExampleThe following is an example:OutputThe following is the output:ExampleLet us see another example:OutputThe following is the output that draws character E with different dimensions:

Advertisements