Home Backend Development PHP Tutorial 让php处理图片变得简单 基于gb库的图片处理类附实例代码下载_PHP

让php处理图片变得简单 基于gb库的图片处理类附实例代码下载_PHP

Jun 01, 2016 pm 12:16 PM
gb Process pictures

这个类的设计思想借鉴于jQuery,通过连缀方法来操作图片,如:
复制代码 代码如下:
$image = new UsaImage(array('filepath'=>'image1.jpg'));
//图片图片覆盖一张图片,第二和第三参数为,要放置的x,y位置
$image->Overlap("image99.gif", 10, 10)
//以相对位置来覆盖图片,最后一个参数为缩放比例,默认为1
->Overlap2('image00.gif',array('right'=>23,'bottom'=>50),0.5)
//缩放图片,设置最大宽和最大高,图片会等比例缩放
->Scale3(300,300)
//输出到屏幕,自动会加上图片头部,类型为jpg,IMAGETYPE_JPEG 为php的gb库的常量
->Write(IMAGETYPE_JPEG);

效果:

 

更多方法,请查看代码备注

代码下载: usaimage.rar

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1653
14
PHP Tutorial
1251
29
C# Tutorial
1224
24
How many GB is 1t of memory equal to? How many GB is 1t of memory equal to? Feb 22, 2023 pm 04:55 PM

1t memory is equal to 1024GB. 1t memory refers to the memory storage capacity of "1TB", and 1TB is equal to 1024GB. But this is only a theoretical value based on computer principles. Generally, the available storage space displayed by the system will be less; because the hard drive manufacturer's definition of the hard drive is different from the computer's algorithm for the hard drive capacity, resulting in the hard drive identification capacity and the operating system display. Actual capacity may vary.

How many MB is 1g of memory? How many MB is 1g of memory? Mar 16, 2023 pm 04:19 PM

1g memory is 1024MB. g stands for "GB", which means "gigabyte" in Chinese, and MB refers to "megabyte"; GB and MB are both commonly used to indicate the storage capacity of computer hard drives, memories and other storage media with larger capacities. The conversion rate between GB and MB is approximately equal to 1000 (1024), that is, "1GB=1024MB".

1g equals how many MB of memory capacity 1g equals how many MB of memory capacity Feb 03, 2023 pm 03:55 PM

1g is equal to 1024MB memory capacity. The full name of g is "GB", which means "gigabyte" in Chinese. It is a decimal unit of information measurement and is often used to indicate the storage capacity of computer hard drives, memories and other large-capacity storage media. The conversion rate between GB and MB is approximately equal to 1000 (1024), that is, "1GB = 1024MB".

What is the storage capacity of a 10GB hard drive? What is the storage capacity of a 10GB hard drive? Mar 08, 2023 am 10:35 AM

A 10GB hard drive represents a storage capacity of "10 billion bytes." Byte is a unit of measurement used by computer information technology to measure storage capacity, usually abbreviated as "B"; gb, also called gigabyte, is a decimal unit of information measurement. Hard drive manufacturers usually calculate in decimal places: 1KB=1000B, 1MB=1000KB, 1GB=1000MB; therefore, if you convert "1GB=1000MB=1000*1000KB=1000*1000*1000B", it is 10 billion bytes.

Is 1 megabit 1G? Is 1 megabit 1G? Feb 27, 2023 pm 03:43 PM

1 trillion is not 1G. 1 megabyte is 1MB, and 1G is equal to 1024MB. The full name of MB is "MByte", which refers to the number of bytes. It is a storage unit in computers and is pronounced as "mega"; while GB is a decimal unit of information measurement, 1GB=1024MB, 1GB=1048576KB, 1GB=1073741824B.

How many bytes does a 20 GB hard drive have? How many bytes does a 20 GB hard drive have? Feb 28, 2023 am 11:59 AM

A 20GB hard drive represents a capacity of approximately 20 billion bytes. GB, also called gigabyte, is a decimal unit of information measurement; byte is a unit of measurement used in computer information technology to measure storage capacity, and can be abbreviated as "B". The conversion relationship between gb and bytes: 1gb is equal to 1024MB, 1MB is equal to 1024KB, and 1KB is equal to 1024B; therefore 20GB=20*1024MB=20*1024*1024KB=20*1024*1024*1024B=21474836480B.

10gb equals how many bytes 10gb equals how many bytes Feb 23, 2023 pm 04:49 PM

10GB is equal to 10737418240 bytes (B). Byte is a unit of measurement used by computer information technology to measure storage capacity, usually abbreviated as "B". GB is also called gigabyte, which is a decimal unit of information measurement. 1GB=1024MB, 1MB=1024KB, and 1KB=1024B (bytes); therefore, convert "10GB=10240MB=10485760KB=10737418240B".

SK Hynix releases 24GB mobile DRAM: smartphone performance improves again SK Hynix releases 24GB mobile DRAM: smartphone performance improves again Aug 17, 2023 pm 12:21 PM

SK Hynix announced a latest breakthrough on August 11, officially launching a 24GB package product of high-performance DRAM (memory) LPDDR5X1 (LowPowerDoubleDataRate5eXtended) suitable for mobile devices such as smartphones. It is said that this product will bring more powerful performance to mobile devices. According to the editor's understanding, SK Hynix successfully produced LPDDR5X in November last year, and through further technological development, they launched a mobile DRAM package with a capacity of 24GB. , and has already begun supply. This move brings new opportunities to smartphone manufacturers, especially in terms of multitasking and running large applications. According to industry insiders, the highly anticipated

See all articles