TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: MARC VAN DEN DIKKENBERG
date: 1998-01-26 22:57:00
subject: Re: Creating Gif Or Jpg

From: pb@excelsior.xs4all.nl.REMOVE-THIS (Marc van den Dikkenberg)
Subject: Re: Creating Gif Or Jpg
 
On 26 Jan 1998 16:48:11 GMT, Tim Hutzler 
wrote:
 
>JS>I am looking for some powerbasic code to create a GIF or JPG file from
>JS>either whats on the screen or what is made by some graphics (LINE,
>JS>PSET,CIRCLE etc) commands.
>
>JS>My application is to upload some graphical telemetry data to our WEB
>JS>server. The interface program has already been written in PowerBasic
>JS>for another app.
>
>If you indend to encode line graphics, use GIF only. It is easier to
>implement, and compresses better than JPEG.
 
Below you'll find a GIF encoder for QuickBasic from one of the ABC
packets... http://www.xs4all.nl/~excel/pb.html
 
Maybe you can convert it to PowerBasic.
(If you do, I'm interested in a copy ;-)
 
Of course you'll have to add some screen 13 functions, but that shouldn't
be the problem:
 
entering screen 13:
 
! MOV AX,&H13
! INT &H10
 
plotting a pixel:
POKE X% + Y% * 320 , COLOUR%
Reading a pixel:
COLOUR% = PEEK X% + Y% * 320
 
(Before you can use any of these, you'll have to be in the right memory
segment, by using DEF SEG=&HA000)
 
(since you'll be reading/writing binary files, you definitely have to add
"OPTION BINARY BASE 1" to the start of the program to be QB-compatible)
 
'===========================================================================
' Subject: MAKE GIF FILE                     Date: Year of 1992 (00:00)
'  Author: Rich Geldreich                    Code: QB, PDS
'    Keys: MAKE,GIF,FILE                   Packet: GRAPHICS.ABC
'===========================================================================
'
'-----------------------------------------------------------------------------
'    PDS 7.1 & QB4.5 GIF Compression Routine v1.01 By Rich Geldreich 1992
'-----------------------------------------------------------------------------
'QuickBASIC 4.5 & QBASIC users: Use search and replace and change all of
the
'"SSEG" strings to "VARSEG" strings for this program to work properly.
'
'If anybody finds any problems with this routine, or has any questions,
'then write/call:
'Rich Geldreich
'410 Market St.
'Gloucester City, NJ 08030
'(609)-742-8752 or (609)-456-0721
'
'This routine is in the public domain... do what you want with it! Just
'give credit where credit is due! Thanks!
'
'NOTE: This version does not currently support EGA palettes.
'V1.01- fixed up VGA palette messups with some VGA's
 
DEFINT A-Z
DECLARE SUB BufferWrite (A%)
DECLARE FUNCTION GetByte% ()
DECLARE SUB MakeGIF (A$, ScreenX%, ScreenY%, Xstart%, YStart%, Xend%,
Yend%, NumColors%, AdaptorType%)
DECLARE SUB PutByte (A%)
DECLARE SUB PutCode (A%)
CONST True = -1, False = 0
 
DIM SHARED OutBuffer$, OStartAddress, OAddress, OEndAddress, Oseg
DIM SHARED CodeSize, CurrentBit, Char&, BlockLength
DIM SHARED Shift(7) AS LONG
DIM SHARED x, y, Minx, MinY, MaxX, MaxY, Done, GIFFile, LastLoc&
 
ShiftTable:
DATA 1,2,4,8,16,32,64,128
 
'-------------- Only for testing purposes:
SCREEN 13
 
FOR A = 1 TO 40
    x = RND * 320
    y = RND * 200
    c = RND * 256
    CIRCLE (x, y), RND * 80, c
 
Continued with next message...
 
*** QwkNews (tm) v2.1
 * [TN11.1] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.