用php的GD库画不出水平的虚线解决方法
用php的GD库画不出水平的虚线
运行一下以下代码
- PHP code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->$img = imagecreatetruecolor(600, 600); $white = imagecolorallocate($img, 255, 255, 255); imagedashedline($img, 20, 20, 500, 20, $white); imagedashedline($img, 20, 20, 20, 500, $white); header("content-type:image/jpeg"); imagejpeg($img); imagedestroy($img);
你会发现垂直的虚线没问题,但水平虚线就不显示。有谁知道为什么?
------解决方案--------------------
- PHP code
$img = imagecreatetruecolor(600, 600); $white = imagecolorallocate($img, 255, 255, 255); $red = imagecolorallocate($img, 255, 0, 0); $style = array($red, $red, $red, $red, $red, $white, $white, $white, $white, $white); imagesetstyle($img, $style); imageline($img, 20, 20, 500, 20, IMG_COLOR_STYLED); header("content-type:image/jpeg"); imagejpeg($img); imagedestroy($img); <br><font color="#e78608">------解决方案--------------------</font><br>The bug reported by 'michi at marel dot at' also exists in PHP version 5.1.1. This functions just works with vertical lines! 5.1.1版本发现的BUG,反对使用本函数。应该用 imagesetstyle() 和 imageline() 的组合替代之 <br><font color="#e78608">------解决方案--------------------</font><br>This functions just works with vertical lines!该函数只能画垂直线! <br><font color="#e78608">------解决方案--------------------</font><br>确实,GD库只能画竖直的虚线! <div class="clear"> </div>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Methods to open img files include using virtual optical drive software, using compression software, and using special tools. Detailed introduction: 1. Use virtual optical drive software to open, download and install a virtual optical drive software, right-click the img file, select "Open with" or "Associated Program", select the installed virtual optical drive software in the pop-up dialog box, virtual The optical drive software will automatically load the img file and use it as a disc image in the virtual optical drive. Double-click the disc icon in the virtual optical drive to open the img file and access its contents, etc.

How to open the img file: 1. Confirm the img file path; 2. Use the img file opener; 3. Select the opening method; 4. View the picture; 5. Save the picture. The img file is a commonly used image file format, usually used to store picture data.

TheFiiOCP13cassetteplayerwasannouncedinJanuary.Now,FiiOisexpandingitsportfoliowithtwonewmodels-onewitharedfrontandonewithatransparentfront.Thelatternotonlyperfectlymatchestheretrocharmoftheangulardesign,butalso

The rapid development of blockchain technology has brought about the need for reliable and efficient analytical tools. These tools are essential to extract valuable insights from blockchain transactions in order to better understand and capitalize on their potential. This article will explore some of the leading blockchain data analysis tools on the market, including their capabilities, advantages and limitations. By understanding these tools, users can gain the necessary insights to maximize the possibilities of blockchain technology.

img is a file compression format, mainly used to create image files of floppy disks. It can be used to compress the contents of an entire floppy disk or an entire CD; files with the extension ".IMG" are created using this file format. ; The img file includes 3 basic nodes, namely "Ehfa_HeaderTag", "Ehfa_File" and "Ehfa_Entry".

Hello everyone, I am your old friend, a friend who talks to you about the crypto market in Binance Plaza all year round. Binance Launchpool recently launched the 64th phase project - RedStone (RED). As a multi-chain oracle project, it sparked a lot of discussion before it was launched. Today we will have an in-depth analysis of RED to see how its potential and how the price may go after it is launched. Binance Launchpool No. 64 project analysis and price forecast: Can RedStone (RED) ignite the market? Project background and core highlights RedStone (RED) is a multi-chain oracle platform focusing on decentralized finance (DeFi), with the goal of E

Web3 Vertical AIAgent: Subvert tradition and reshape the industry landscape? This paper discusses the application differences of AIAgent in Web2 and Web3 and the future potential of Web3Agent. Web2 has been widely used to improve efficiency, covering sales, marketing and other fields, and has achieved significant economic benefits. Web3Agent combines blockchain technology to open up new application scenarios, especially in the DeFi field. It demonstrates potential beyond Web2Agent through token incentives, decentralized platforms and on-chain data analysis. Although Web3Agent is currently facing challenges, its unique advantages make it expected to compete with Web2 in the medium and long term, and even reshape the industry landscape. Web2AI

According to news from this site on April 13, Nikon officially announced that it has completed the acquisition of RED, and RED has officially become a subsidiary of Nikon. According to the official announcement, RED’s former president Jarred Land and founder James Jannard will serve as consultants for the new company, and Nikon Imaging Division Keiji Oishi will be appointed as CEO of the new company. Tommy Rios, the former executive vice president of RED, will be promoted to co-CEO of the new company. The announcement stated that there will be no changes to RED’s current product lineup, partners, and relationships with dealers. RED will continue to support its policies through warranty, repair services, customer service and overall product support. Nikon said Nikon and RED will combine the strengths of both companies to develop unique products while leveraging
