Vistas de página en total

miércoles, 2 de abril de 2014

RECTANGLE


Función para realizar rectangulos apoyandolnos en la función linea.

Macro DE LLAMADA para ampliar en GRAPHICS.MAC

GRAPHICS.MAC
;Dibuja un rectangulo
rectangle macro x0,y0,x1,y1,color
ifndef _rectangle
        extrn _rectangle:near
endif
        mov ax,x0
        push ax
        mov ax,y0
        push ax
        mov ax,x1
        push ax
        mov ax,y1
        push ax
        mov ax,color
        push ax
        call _rectangle
       
 endm 




RECTAN.ASM
; Copyright (C) 2013  José Ángel Moneo Fernández

;    This program is free software: you can redistribute it and/or modify
;    it under the terms of the GNU General Public License as published by
;    the Free Software Foundation, either version 3 of the License, or
;   (at your option) any later version.

;    This program is distributed in the hope that it will be useful,
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;    GNU General Public License for more details.

;    You should have received a copy of the GNU General Public License
;    along with this program.  If not, see <http://www.gnu.org/licenses/>.
include graphics.mac


.model compact,pascal

        public _rectangle
.data

.code
       ;algoritmo Bresenham
_rectangle proc uses ,x0,y0,x1,y1,color
        line x0,y0,x1,y0,color
        line x0,y1,x1,y1,color
        line x0,y0,x0,y1,color
        line x1,y0,x1,y1,color
        ret
_rectangle endp

end

No hay comentarios:

Publicar un comentario

Si tienes algún comentario, duda o sugerencia, o si quieres aportar algún código creado a partir de las librerías expuestas aquí, por favor, indícamelo.