Hi,
I'm not Portuga, i'm brasileiro.
Do you speak portuguese ?
It's my problem:
class BarcodeObject {
var $mWidth, $mHeight, $mStyle, $mBgcolor, $mBrush;
var $mImg, $mFont;
var $mError;
function BarcodeObject ($Width = BCD_DEFAULT_Width, $Height = BCD_DEFAULT_HEIGHT, $Style = BCD_DEFAULT_STYLE) {
$this->mWidth = $Width;
$this->mHeight = $Height;
$this->mStyle = $Style;
$this->mFont = BCD_DEFAULT_FONT;
$this->mImg = ImageCreate($this->mWidth, $this->mHeight);
$dbColor = $this->mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_FOREGROUND_COLOR : BCD_DEFAULT_BACKGROUND_COLOR;
$dfColor = $this->mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_BACKGROUND_COLOR : BCD_DEFAULT_FOREGROUND_COLOR;
$this->mBgcolor = ImageColorAllocate($this->mImg, ($dbColor & 0xFF0000) >> 16,
($dbColor & 0x00FF00) >> 8 , $dbColor & 0x0000FF);
$this->mBrush = ImageColorAllocate($this->mImg, ($dfColor & 0xFF0000) >> 16,
($dfColor & 0x00FF00) >> 8 , $dfColor & 0x0000FF);
if (!($this->mStyle & BCS_TRANSPARENT)) {
ImageFill($this->mImg, $this->mWidth, $this->mHeight, $this->mBgcolor);
}
__TRACE__("OBJECT CONSTRUCTION: ".$this->mWidth." ".$this->mHeight." ".$this->mStyle);
}
function DrawObject ($xres) {
/* there is not implementation neded, is simply the asbsract function. */
__TRACE__("OBJECT DRAW: NEED VIRTUAL FUNCTION IMPLEMENTATION");
return false;
}
function DrawBorder () {
ImageRectangle($this->mImg, 0, 0, $this->mWidth-1, $this->mHeight-1, $this->mBrush);
__TRACE__("DRAWING BORDER");
}
function DrawChar ($Font, $xPos, $yPos, $Char) {
ImageString($this->mImg,$Font,$xPos,$yPos,$Char,$this->mBrush);
}
function DrawText ($Font, $xPos, $yPos, $Char) {
ImageString($this->mImg,$Font,$xPos,$yPos,$Char,$this->mBrush);
}
function DrawSingleBar($xPos, $yPos, $xSize, $ySize) {
if ($xPos>=0 && $xPos<=$this->mWidth && ($xPos+$xSize)<=$this->mWidth &&
$yPos>=0 && $yPos<=$this->mHeight && ($yPos+$ySize)<=$this->mHeight) {
for ($i=0;$i<$xSize;$i++) {
ImageLine($this->mImg, $xPos+$i, $yPos, $xPos+$i, $yPos+$ySize, $this->mBrush);
}
return true;
}
__DEBUG__("DrawSingleBar: Out of range");
return false;
}
function GetError() {
return $this->mError;
}
function GetFontHeight($font) {
return ImageFontHeight($font);
}
function GetFontWidth($font) {
return ImageFontWidth($font);
}
function SetFont($font) {
$this->mFont = $font;
}
function GetStyle () {
return $this->mStyle;
}
function SetStyle ($Style) {
__TRACE__("CHANGING STYLE");
$this->mStyle = $Style;
}
function FlushObject () {
if (($this->mStyle & BCS_BORDER)) {
$this->DrawBorder();
}
if ($this->mStyle & BCS_IMAGE_PNG) {
Header("Content-Type: image/png");
ImagePng($this->mImg);
} else if ($this->mStyle & BCS_IMAGE_JPEG) {
Header("Content-Type: image/jpeg");
ImageJpeg($this->mImg);
} else __DEBUG__("FlushObject: No output type");
}
function DestroyObject () {
ImageDestroy($obj->mImg);
}
}
Everything this I put inside of a loop "for", through one include. Therefore a program is part that generates boletos of bank inside the diverse customers of an interval of dates. E the stretch above mentions part to it of the routine that prints the bar code.