I installed gpc and all required or recommended packages using aptitude. The manual apparently contains no mention of graphics output. But that's why I downloaded Pascal in the first place!
Looking through the mailing list archives, I find mention of a GRX library. But when I do a search for "grx" within aptitude, I come up empty.
All I want to do is create a 432 pixel x 378 pixel image with over 2000 different 24-bit colors, all in a very precise pattern, a fractal shape as a matter of fact. In the time it is taking me to find any programming language that will let me do this, I suppose I could do it manually with a graphics editor, although this would be somewhat tedious.
I can create a 432x378 array of strings, where each string is the hexadecimal code for a 24-bit color. How can I turn this array into an image? Does anyone know of a programming language which DOES do graphics?
Thanks for your patience.
David Bush
David Bush wrote:
I installed gpc and all required or recommended packages using aptitude. The manual apparently contains no mention of graphics output. But that's why I downloaded Pascal in the first place!
Looking through the mailing list archives, I find mention of a GRX library. But when I do a search for "grx" within aptitude, I come up empty.
You can download GRX from http://grx.gnu.de. You have to compile it before you can use it and for compilation you should choose X version (other variants are useless for you).
All I want to do is create a 432 pixel x 378 pixel image with over 2000 different 24-bit colors, all in a very precise pattern, a fractal shape as a matter of fact. In the time it is taking me to find any programming language that will let me do this, I suppose I could do it manually with a graphics editor, although this would be somewhat tedious.
I can create a 432x378 array of strings, where each string is the hexadecimal code for a 24-bit color. How can I turn this array into an image? Does anyone know of a programming language which DOES do graphics?
You can easily create .pnm file (gradient demo how to do this). Then install netpbm package and use for example 'pnmtopng' to convert .pnm file to a more popular format.
Waldek Hebisch wrote:
I can create a 432x378 array of strings, where each string is the hexadecimal code for a 24-bit color. How can I turn this array into an image? Does anyone know of a programming language which DOES do graphics?
You can easily create .pnm file (gradient demo how to do this). Then install netpbm package and use for example 'pnmtopng' to convert .pnm file to a more popular format.
I'd second Waldek's suggestion. Especially since your array of strings is already quite close to the PNM format, and you don't need any library to create the file (simple WriteLn will do :-).
A real graphics library, which will write the image to the screen (or a virtual context) and read it back to write it to a file is kind of overkill if you really just want to create the file.
Frank
-- -- All I want to do is create a 432 pixel x 378 pixel image with over 2000 different 24-bit colors, all in a very precise pattern, a fractal shape as a matter of fact. In the time it is taking me to find any programming language that will let me do this, I suppose I could do it manually with a graphics editor, although this would be somewhat tedious. -- -- David Bush
Hallo, may be your problem can be solved quite simple by using a GPC-unit which uses postscript and ghostscript as the graphics backend (gs must be installed on your system). Here is what you need for a test:
Compile these units whith GPC: http://www.desy.de/~bohnen/gpc/units1/gs_graphic.pas http://www.desy.de/~bohnen/gpc/units1/base.pas
Compile and run a simple test: http://www.desy.de/~bohnen/gpc/units1/test_gs_graphic.pas
This test works fine for: - openSUSE 10.3 2.6.22.19-0.4 (32-bit) - gpc version 20041218, based on gcc-3.3.4 - Ghostscript 8.15.3 (2006-04-19) - Other conditions not testet
Hope that may help Ernst-Ludwig
I would just replace the content of an similar existing tiff file created in Gimp:
PROGRAM ReplaceTiff;
VAR C: CHAR; F,F2: FILE; I: ShortCard; L: MedCard;
BEGIN Reset(F,'Old.tif',1); Rewrite(F2,'New.tif',1);
{ Save Header }
BlockRead(F, C,1); BlockWrite(F2, C,1);
BlockRead(F, C,1); BlockWrite(F2, C,1);
BlockRead(F, I,2); BlockWrite(F2, I,2);
BlockRead(F, L,4); { L needed later! } BlockWrite(F2, L,4);
{ Write Body }
FOR Y := 1 TO yResolution DO BEGIN FOR X := 1 TO xResolution DO BEGIN BlockWrite(F2, a[X,Y],1); END; END;
{ Save Trailer }
Seek(F,L); WHILE NOT EOF(F) DO BEGIN BlockRead(F, I,2); BlockWrite(F2, I,2); END;
Close(F2); Close(F); END.
On Fri, Oct 9, 2009 at 2:53 PM, twixt@cstone.net wrote:
I installed gpc and all required or recommended packages using aptitude. The manual apparently contains no mention of graphics output. But that's why I downloaded Pascal in the first place!
Looking through the mailing list archives, I find mention of a GRX library. But when I do a search for "grx" within aptitude, I come up empty.
All I want to do is create a 432 pixel x 378 pixel image with over 2000 different 24-bit colors, all in a very precise pattern, a fractal shape as a matter of fact. In the time it is taking me to find any programming language that will let me do this, I suppose I could do it manually with a graphics editor, although this would be somewhat tedious.
I can create a 432x378 array of strings, where each string is the hexadecimal code for a 24-bit color. How can I turn this array into an image? Does anyone know of a programming language which DOES do graphics?
Thanks for your patience.
David Bush