realbasic-nug
[Top] [All Lists]

Getting Background Color for offscreen pictures

To: realbasic-nug at lists dot realsoftware dot com
Subject: Getting Background Color for offscreen pictures
From: David Anderson GM4JJJ <david at gm4jjj dot co dot uk>
Date: Mon, 31 May 2004 12:55:13 +0100
Delivered-to: realbasic-nug at lists dot realsoftware dot com
List-help: <mailto:realbasic-nug-request@lists.realsoftware.com?subject=help>
List-id: REALbasic NUG <realbasic-nug.lists.realsoftware.com>
List-post: <mailto:realbasic-nug@lists.realsoftware.com>
References: <20040531073344 dot BE1B51FDCA6 at lists dot realsoftware dot com>
Hope someone can help me on this one, on Windows and Linux I need to stop flicker, so I use an offscreen to buffer like this:


  // Offscreen
  // The Buffers are properties of this Window
AZBuffer=newpicture(AZCanvas.width,AzCanvas.height,24)// Offscreen for AZ


  AZbuffer.graphics.forecolor=self.backcolor
AZbuffer.graphics.fillrect(0,0,AZCanvas.width,AZcanvas.height)//fill canvas with window backcolor

  AZbuffer.graphics.textfont="Helvetica"
  AZbuffer.graphics.textsize=40
  AZbuffer.graphics.bold=true
  AZbuffer.graphics.italic=true
  AZbuffer.graphics.drawstring AZTEXT,10,50

  // Blit Offscreens to canvases
  AZCanvas.graphics.drawpicture AZbuffer,0,0


My problem is with the color of the fill of the canvas, I want it to match the window background color.

If I use the following to fill the eventual canvas, and have the 'hasbackcolor=true' for the window then it works fine, however I would like to not use my own window backcolor, rather let the appearance theme govern the backcolor of the window.

If I turn off hasbackcolor for the window then my code still uses whatever color I had chosen for the backcolor rather than the theme's color.

If I don't do the following code then the canvas ends up with a white background.

 AZbuffer.graphics.forecolor=self.backcolor
AZbuffer.graphics.fillrect(0,0,AZCanvas.width,AZcanvas.height)//fill canvas with window backcolor


Is there a simple way around this?

Many thanks
--
David

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>