Path: news.daimi.aau.dk!news.uni-c.dk!recycled.news.erols.com!news-feed.ifi.uio.no!uninett.no!news.maxwell.syr.edu!EU.net!main.Germany.EU.net!main.de.uu.net!Dortmund.Germany.EU.net!dortmund.de.uu.net!Informatik.Uni-Dortmund.DE!news From: ger <_ger@geocities.com> Newsgroups: comp.lang.beta Subject: beta guienv questions Date: Mon, 13 Oct 1997 09:47:34 +0200 Organization: CS Department, University of Dortmund, Germany Lines: 76 Message-ID: <3441D216.37D1@geocities.com> NNTP-Posting-Host: marvin.informatik.uni-dortmund.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (X11; I; SunOS 5.5.1 sun4u) Xref: news.daimi.aau.dk comp.lang.beta:11270 Hello everyone, I've some questions about BETA's guienv: 1) The following source was intended to generate a window with randomly colored, random lines. Unfortunately it does only draw random lines, but all have the same (default) color. Why? I thought the (r,g,b)->TheLines[i].pen.foregroundcolor statement (marked with *** ) would do it. [---source follows ---] ORIGIN '~beta/guienv/v1.4/guienv'; INCLUDE '~beta/guienv/v1.4/figureitems'; INCLUDE '~beta/basiclib/v1.5/random' --- program: descriptor --- guienv (# AWindow:@Window (# open:: (# do (100,100)->position; (300,100)->size; 'AWindow'->title; #); LineDemo: (# x1,y1,x2,y2,r,g,b:@integer; TheLines:[10]^Line; do (for i:TheLines.range repeat (1,300)->ignuin->x1; (1,300)->ignuin->x2; (1,100)->ignuin->y1; (1,100)->ignuin->y2; (0,255)->ignuin->r; (0,255)->ignuin->g; (0,255)->ignuin->b; (if TheLines[i][]=NONE then &Line[]->TheLines[i][]; TheLines[i].open; if); (* *** *) (r,g,b)->TheLines[i].pen.foregroundcolor; (x1,y1)->TheLines[i].start; (x2,y2)->TheLines[i].end; for); AWindow.update; 30->system.wait; restart LineDemo; #) #) do AWindow.open; AWindow.LineDemo; #) [---end of source---] 2) I can't get graphics/drawSpot to work (it does not draw anything). Can someone give me a little example, perhaps just change the above source so that it draws randomly colored points instead of lines? 3) I've writte a program which calculates images and writes them into an array [XSIZE*YSIZE] of type color (integer r,g,b). In order to display the calculated image I use a drawSpot workaround with moveto & drawto and draw every single pixel through a x and y loop. Of course this is very slow, and I suppose even if I could get drawSpot to work, it wouldn't be much faster. Is there some possibility to blit the whole (XSIZE,YSIZE) block at once? (I thought writing the pixels into a pixmap instead and using drawRaster could be possible, but the documentation says "Note ..., pixmap, ... are not implemented". I tried it, and I didn't get it to work.) Your help to any of this questions is very welcome, Bye, ger -- "Das gab es noch nie: Informatik am Computer!" bhv-Katalog 96/97 S.21 PGP Fingerprint: 09 27 E6 BB 5C FD 2B 32 16 57 70 EF 3B CA B0 1E