| ||
auteur : Equipe SWAG | ||
|
| ||
auteur : Equipe SWAG | ||
|
| ||
auteur : Equipe SWAG | ||
How do I make an ansi and put it in my Pascal File ?
I know there is an option to save as pascal, but it does not look like anything to me ! Any help is appreciated ! Here is a Program that will read an ANSI File into a buffer in 2k chunks then Write it (to screen) Character by Character. BUT - it will Write all ANSI-escape-sequences as StringS. Two reasons For this : 1) I just 'feel happier' if each ANSI escape sequence is written to screen as a String instead of as individual Characters. (Its just an irrational 'thing' I have) 2) By assembling all the Characters in the escape sequence together, it make its _easy_ to FILTER OUT all ANSI sequences if you want to just output plain black-and-white Text. This is For those people who for some strange reason would rather not have ANSI.SYS installed, but complain about getting 'garbage' Characters on the screen. All you have to do to filter out the escape sequences is to un-bracket the 'if AnsiDetected then' part. If you want me to post 'Function AnsiDetected: Boolean' just let me know.
|
| ||
auteur : Dustin Nulf | ||
I've run into that familiar problem in trying to view Ansi colored pictures and using the Crt Unit at the same time.
The Crt Unit doesn't translate the Ansi codes and displays them literally.
Now, I've created an Ansi interpreter Procedure that reads each line in an ansi File and calls the appropriate TextColor/TextBackground Procedures, according to what ansi escape String was found.
This is groovy and all, but I just found out something new today With :
...and that it translates all the ansi codes For me already!
Now, the big question is, what are the advantages and disadvantages of using this Assign method vs. the Ansi interpreter method ?
Is this Assign method slower/faster, take up more memory, more disk space, etc.
Any information would be highly appreciated! :)
|
| ||
auteur : Equipe SWAG | ||
Now that I need to make a .ANS bulletin Type File, I was wondering how to Write from a Pascal Program, ANSI control Characters to a File and produce nice color bulletin screen to be displayed by RA. The following Unit will enable you to Write Ansi sequences to a Text File Without having to look them up yourself. It enables you to do this using the (easier) Crt Unit style of commands, and provides the optimum Ansi sequence to do the job.
|
| ||
auteur : Robert Rothenburg | ||
For those interested in using ANSI in Turbo Pascal (at least Dos v2-5...I don't know if Dos 6 Uses this routine--Interrupt $29--or not) here's a tip: The "undocumented" Fast PutChar interrupt is used by ANSI.SYS, and thus anything you send to that interrupt will be ANSI-interpreted (provided ANSI.SYS is loaded :). Use this routine to output a Character to ANSI: (you'll have to modify it to output Strings, of course).
|
| ||
auteur : Equipe SWAG | ||
Well here it is again, its a little rough and some of the Crt.tpu Functions are left out.
This Unit will generate Ansi TextColor and TextBackGrounds. Because of the Ansi screen Writes you can send the Program to the com port just by using CTTY or GateWay in a bat File before you start your Program.
|
| ||
auteur : Equipe SWAG | ||
The following Functions provide a way to determine if the machine the your application is running on has ANSI installed. If your Program is written using the Crt Unit the Function may return the result as False even if ANSI is present, unless you successfully use a 'work around' method to ensure all Writes go through Dos. I find it's easier just to not use Crt if my Program is working With ANSI - since there is not much that you use the Crt Unit For that can't be done in some other way. The Dos-based alternatives to ReadKey and KeyPressed are included since they are needed For the AnsiDetect Function.
|
| ||
auteur : Equipe SWAG | ||
|
| ||
auteur : Equipe SWAG | ||
If you save as Pascal, and follow the instructions in the manual For TheDraw everything will work fine.
It is also much more efficient then using normal ANSI-Files, since TheDraw-Pascal Files can be Compressed...
If your picture is not crunched you can use this routine to show them With VideoSeg has to be $B000 or $B800, then use the Vars from the generated picture and insert when you call that procedure.
|
| |||||
auteur : Equipe SWAG | |||||
Save the Files into Bin Format, then run BinOBJ on them.
When you select a public name, remember that this will be the Procedure's name. After that Write :
Walkthrough example : - Saved File : Welcom.Bin
In Pascal :
In order to display, dump the Procedure to b800:0 -
4000 is the size For 80x25.
The size is x*y*2.
If your picture is not crunched you can use this routine to show them With VideoSeg has to be $B000 or $B800, then use the Vars from the generated picture and insert when you call that procedure.
|
| ||
auteur : Equipe SWAG | ||
Well, everyone is asking how to integrate a picture from TheDraw into your Pascal Program, so here is how to do it. First start up TheDraw, and either Draw, or load your picture (pretty simple). Then select Save. When asked for a Save format, select (ObJect). For Save mode, select (Normal). For Memory model, select (Turbo Pascal v4+). For Reference identifier to use, type in the name that you wish to have the picture Procedure named, this will be explained later. Then, for the Filename, of course enter the Filename you wish to save it under. Next, is the method to place The .OBJ image into your Program. Somewhere up in the declarations area (after the Var statements, and before your begin) place the following :
Then, to call that picture, there is 1 of 2 ways.
First of all, you can make another procedure immediatly after this one that goes as such :
Then all you have to do is call the procedure DrawANSIScreen to draw your picture.
Or you can copy that line beginning With Move into your source code directly.
Make sure to again replace the ProcName with your specified Reference Identifier.
Make sure to give each picture a different identifier, I do not know what the outcome would be if you used the same one.
Probably wouldn't even Compile.
Also, I have not tried this with animation.
Considering that this writes directly to screen, it probally won't work, or will be too fast For the human eye to follow.
On top of this, I migh point out that since this IS a direct video access, the cursor WILL not move for it's last position when the screen is printed, so you can fill the Complete screen, and it will not scroll. Hope that this has been helpful. It's very easy, and I pulled it direct from TheDraw docs. This is supposed to work with Pascal 6.0 and up only. To work with earlier Pascal versions, please read the docs. They entail the process completely (but not very understandibly <G>). |
| ||
auteur : James Fielden | ||
| ||
auteur : Steve Connet | ||
| ||
auteur : Guy McLoughlin | ||
| ||
auteur : James Fielden | ||
| ||
auteur : Jack Dybczak | ||
| ||
auteur : Equipe SWAG | ||
| ||
auteur : Maynard Philbrook | ||
| ||
auteur : Equipe SWAG | ||
| ||
auteur : Dave Lowe | ||
| ||
auteur : Stefan Xenos | ||
| ||
auteur : Eric Miller | ||
| ||
auteur : Robert Long | ||
| ||
auteur : Greg Estabrooks | ||
| ||
auteur : Betabech Computing | ||
| ||
auteur : Gayle Davis | ||
| ||
auteur : Greg Smith | ||
| ||
auteur : Larry Hadley | ||
| ||
auteur : Erik Anderson | ||
| ||
auteurs : Scott Earnest, Ben Kimball | ||
| ||
auteurs : Gayle Davis, David Anderson | ||
| ||
auteur : Tobin Fricke | ||
| ||
auteur : Equipe SWAG | ||
| ||
auteur : Robert Long | ||
| ||
auteur : Ueli Rutishauser | ||
| ||
auteur : Andrew Nowinski | ||
| ||
auteur : Jonathan Downes | ||
| ||
auteur : Aaron Schroeder | ||
| ||
auteur : David Adamson | ||
| ||
auteur : Jonathan Downes | ||
| ||
auteur : Jason Randall | ||
| ||
auteur : Mike Phillips | ||
| ||
auteur : Brian Petersen | ||
| ||
auteur : Chad Moore | ||
| ||
auteur : Yuval Melamed | ||
| ||
auteur : Equipe SWAG | ||
Les sources présentées sur cette page sont libres de droits et vous pouvez les utiliser à votre convenance. Par contre, la page de présentation constitue une œuvre intellectuelle protégée par les droits d'auteur. Copyright © 2010 Developpez Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site ni de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon vous encourez selon la loi jusqu'à trois ans de prison et jusqu'à 300 000 € de dommages et intérêts.