Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Dustin  
#1 Posted : Saturday, September 8, 2007 11:07:55 AM(UTC)
Dustin

Rank: Member

Groups: Member
Joined: 8/21/2007(UTC)
Posts: 4

I am trying to create the effect of adding a "light bulb" at the location of where a user clicks their mouse within a MultiLayerViewer Control. (For instance, the user clicks the mouse at a certain location and it appears that there is an elluminated light at that location). I would like for the user to be able to later move this "light bulb" around on the canvas.

I initially implemented this by simply drawing an Ellipse on the canvas, but would like to spruse this up a bit. The idea behind the transparency fill and a glow effect is to simulate intensity. Is this possible on an Ellipse object? If not, do you have any ideas on how to simluate this effect?

Your help and insight would greatly be appreciated.

thanks...
Alex Kon  
#2 Posted : Sunday, September 9, 2007 4:10:14 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups:
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hi Dustin,

Hm... I've played a little with brushes and can suggest you the following code to create "light bulb": [code] System.Drawing.RectangleF objBorders = obj.GetVObjectBounds(); //where obj is EllipseVObject

Code:
	System.Drawing.Drawing2D.GraphicsPath bulbPath = new System.Drawing.Drawing2D.GraphicsPath();
	bulbPath.AddEllipse(objBorders.X, objBorders.Y, objBorders.Width, objBorders.Height);
	System.Drawing.Drawing2D.PathGradientBrush bulbBrush = new System.Drawing.Drawing2D.PathGradientBrush(bulbPath);
	bulbBrush.CenterColor = System.Drawing.Color.FromArgb(192, System.Drawing.Color.Yellow);
	bulbBrush.SurroundColors = new System.Drawing.Color[] { System.Drawing.Color.Transparent };
				
	obj.Brush = bulbBrush;
	obj.Pen = null;
Feel free to contact me if you intended to get something else :)

Edited by user Monday, December 17, 2007 12:55:00 PM(UTC)  | Reason: Not specified

Dustin  
#3 Posted : Tuesday, September 11, 2007 3:32:46 AM(UTC)
Dustin

Rank: Member

Groups: Member
Joined: 8/21/2007(UTC)
Posts: 4

That worked perfectly Alex! Thank you for your time.
Dustin
Alex Kon  
#4 Posted : Tuesday, September 11, 2007 12:59:06 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups:
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Great! :) I'm pleased to help you.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.