320x200 picture display MARKUS 
Author Message
 320x200 picture display MARKUS



Quote:
>   Hello Everyone!

> Can anyone tell me how to make a program that shows
> a picture in mode 13h

> PLEASE!!

Hi markus,

I don't know what you mean by a picutere - GIF, PCX, BMP, TGA, DIB, JPG, TIF
- there are a lot of pictures types. But what I can explain to you is how to
display a buffer on screen where the buffer holds the pixels for the image.

Here it comes:

ShowPicture proc
   arg   buffer:dword, width:word, height:word, x:word, y:word
   push  ds
   push  si
   push  es
   push  di
   cld
   mov   ax, [y]
   mov   di, ax
   shl   ax, 6
   shl   di, 8
   add   di, ax      ; di = y * 320 (to get row offset)
   add   di, [x]     ; di = y * 320 + x (offset upper corner picture)
   mov   dx, [width]
   lds   si, [buffer]
   mov   ax, 0a000h
   mov   es, ax      
   mov   cx, [height]
   mov   bx, 320
   sub   bx, dx
NextLine:
   mov   ax, cx             ; save CX fast (faster than PUSH)
   mov   cx, dx
   rep   movsb              ; throw one line on screen
   add   di, bx             ; adjust di to point to next line on screen
   mov   cx, ax
   loop  NextLine           ; do next line
   pop   di
   pop   es
   pop   si
   pop   ds
   ret




Wed, 30 Dec 1998 03:00:00 GMT  
 320x200 picture display MARKUS



Quote:
>   Hello Everyone!

> Can anyone tell me how to make a program that shows
> a picture in mode 13h

> PLEASE!!

Hi markus,

I don't know what you mean by a picutere - GIF, PCX, BMP, TGA, DIB, JPG, TIF
- there are a lot of pictures types. But what I can explain to you is how to
display a buffer on screen where the buffer holds the pixels for the image.

Here it comes:

ShowPicture proc
   arg   buffer:dword, width:word, height:word, x:word, y:word
   push  ds
   push  si
   push  es
   push  di
   cld
   mov   ax, [y]
   mov   di, ax
   shl   ax, 6
   shl   di, 8
   add   di, ax      ; di = y * 320 (to get row offset)
   add   di, [x]     ; di = y * 320 + x (offset upper corner picture)
   mov   dx, [width]
   lds   si, [buffer]
   mov   ax, 0a000h
   mov   es, ax      
   mov   cx, [height]
   mov   bx, 320
   sub   bx, dx
NextLine:
   mov   ax, cx             ; save CX fast (faster than PUSH)
   mov   cx, dx
   rep   movsb              ; throw one line on screen
   add   di, bx             ; adjust di to point to next line on screen
   mov   cx, ax
   loop  NextLine           ; do next line
   pop   di
   pop   es
   pop   si
   pop   ds
   ret




Wed, 30 Dec 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. 320x200 picture

2. Picture display problem continues

3. Displaying picture issue..

4. displaying pictures as movies?

5. Displaying a picture help

6. Downloading and displaying a picture

7. display a picture when select a record in a browse

8. Displaying Pictures in CW4

9. Display DD/MM picture for a field

10. Problem with displaying pictures in the form

11. 2.1 Picture Display

12. Help displaying picture

 

 
Powered by phpBB® Forum Software