On 06/01/2007, at 7:13 PM, Youri wrote:
Roger Clary wrote:

While you can probably accomplish this with RB code, a MUCH easier way, since you just want a background color anyway, is to create the effect you want in Photoshop

Roger,

I can't do it this way, as each time the color, picture is fetch from a DB.

The PictureEffectsScripter source I pointed you to would make that fairly easy.

1) Create a picture the same size as your control.
2) Use MaskRadialGradient on that picture
3) fill the picture with your desired colour
4) draw the picture into your control
5) draw anything you want on top.

More details, off the top of my head:

dim fadingPict as new Picture(myRect.Width, myRect.Height, 32)
fadingPict.ForeColor = colorFromDatabase
fadingPict.FillRect 0, 0, fadingPict.Width, fadingPict.Height
dim ps as new PictureEffectsScripter(nil, fadingPict, fadingPict.Mask)
ps.MaskRadialGradient 0, 255
myRect.Graphics.DrawPicture fadingPict, 0, 0

Note that creating the mask in fadingPict and creating the foreground are independent operations that can be in either order. The mask is used when you later draw fadingPict somewhere else.

Yes, I know the PictureEffectsScripter stuff would be more useful if it was pulled out into one or more modules but it needs to be in a single context object to be used from RBScript so it was written that way and I haven't had time to change it. Anyone wishing to do so and contribute it back to me is welcome :-)

Andy Dent BSc  MACS   http://www.oofile.com.au/
OOFILE - Database, Reports, Graphs, GUI for c++ on multiple platforms
REALbasic, C++, Python, Mac and Windows development and porting



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

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

Reply via email to