Using GlassBackgroundRender

Topics: Developer Forum
Oct 26, 2006 at 11:01 AM
Hi -

I'm trying to use GlassBackgroundRender to render, well, a glass background - for a TreeNode in an owner drawn tree view. My code is

Ascend.Windows.Forms.GradientBackgroundRender rnd = new Ascend.Windows.Forms.GradientBackgroundRender();
rnd.CornerRadius = new Ascend.CornerRadius(5);
rnd.RenderMode = Ascend.Windows.Forms.RenderMode.Glass;
rnd.AntiAlias = true;
rnd.GradientLowColor = SystemColors.InactiveCaption;
rnd.GradientHighColor = SystemColors.Window;
rnd.Render(new PaintEventArgs(e.Graphics, e.Bounds));

Unfortunately, it doesn't render anything - the docs don't explain much here, but maybe one of you can help out?

Thanks in advance,

Phil
Coordinator
Oct 26, 2006 at 4:56 PM
This class was factored out and should have been removed. I will make sure to remove it in future releases. I had it checked off on my housekeeping document but apparently didn’t remove it.

What you need to use is GradientBackgroundRender and set the RenderMode property to RenderMode.Glass. This will result in a glass render based on your properties. There is little difference in how a regular gradient render and a glass render is done internally and it ran far faster in a single class.

Sorry for the confusion.

Thanks,
Scorn
Oct 26, 2006 at 5:47 PM
Thanks for the information - however, I replaced that GlassBackgroundRender instance with a GradientBackgroundRender one, but it still won't paint. The rest of my code above remains the same. Are there any properties that must be set?

Phil
Coordinator
Oct 30, 2006 at 4:25 PM
Sorry, I don’t want you to think I’m blowing your question off. I’m in the final sprint before final unit testing on a project in my day job. It’s taking up more time than I hoped.

Off hand I don’t see anything missing from your code. I will take a better look later this week.

Thanks,
Scott
Nov 2, 2006 at 6:09 AM
Thanks for your help, I really appreciate that!

Phil