Path: news.cs.au.dk!not-for-mail From: "Sascha Kimmel \(tricos Mediaservice\)" Newsgroups: comp.lang.beta Subject: How to copy a bitmap object (nti)? Date: 8 Feb 2000 20:19:40 -0000 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 47 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <20000208201940.24992.qmail@noatun.mjolner.dk> Reply-To: "Sascha Kimmel \(tricos Mediaservice\)" NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 950041199 12575540 255.255.255.255 (8 Feb 2000 20:19:59 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 8 Feb 2000 20:19:59 GMT Xref: news.cs.au.dk comp.lang.beta:12231 Hi! I want to copy a bitmap object (on Windows) to realize a simple image buffer for animation. (See http://msdn.microsoft.com/library/techart/msdn_anim32.htm and http://msdn.microsoft.com/library/techart/msdn_flicker.htm for details) This works as follows: you have a bitmap which is the background, a sprite (also a bitmap) that you draw onto the background bitmap - and then copy the resulting bitmap to the screen - this prevents flickering ("single buffer"). So I need to copy a bitmap (pixmap in beta): .... screenBitmap,bg,sprite,buffer:^pixmap; do (** INIT **) &pixmap[]->buffer[]; &pixmap[]->screenBitmap[]; 'background.bmp'->screenBitmap.read; &pixmap[]->bg[]; 'background.bmp'->bg.read; &pixmap[]->sprite[]; 'sprite.bmp'->sprite.read; .... (** Off-screen drawing **) bg[]->buffer[]; (** well, here's the problem !! **) (sprite[],(0,0),(5,5),sprite.width,sprite.height)->buffer.drawPixmap; (** Copying buffer to screen bitmap **) buffer[]->ScreenBitmap[]; (** another problem **) .... Due to the use of references instead of objects (a->b, (a,b pixmaps) gives a compiler error) when assigning bg[] to the buffer[] and the following drawPixmap both buffer[] and bg[] point to the same pixmap, so *both* are changed. Any solution? Regards, Sascha Kimmel