dot net rollover

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  08 August 2013
dot net rollover

I want to create a dot net window rollover, as in html, so that certain sections of a graphic are highlighted on mouse rollover, then clickable to trigger an action....any simple code for this to start me off? Thanx again guys.
 
  08 August 2013
post a picture of what you want to get.
 
  08 August 2013
Ok, See below. The first is the dot net window with background graphic. The next three are the rollover animation, perhaps a gif animation? When clicking on the associated region, an event is triggered, such as bone creation. Thanks for your time.
Attached Images
File Type: jpg initilwe.jpg (54.3 KB, 22 views)
File Type: jpg rollover2.jpg (58.0 KB, 22 views)
 
  08 August 2013
It will be a lot of work, either with maxscript or c#

Here's a snippet of what I did for making a "click map", using any html tool for generating the click maps, an image and mxs to make it work. Ymmv

http://public.subd.nl/cgtalk/JHN_cl...ramework_01.zip

It reads the clickmaps from the html file, then build an array with coords form it, and filters it on the imgtag when you click on it. At some point I had written a get/set pixels function to also allow mouse over effects, but can't find the code anymore. This was written pre .net era, also look up LoneRobot's site and get some .net inspiration.

Not sure I would use it again now, but it works.

-Johan
__________________
Online: LinkedIn
 
  08 August 2013
Thanks. I will try it out. Still like to hear from dot net specialists tho..
 
  08 August 2013
Also have a look at Pete's work here.

~Johan
__________________
Online: LinkedIn
 
  08 August 2013
yes. Interesting, but where and how to get rig studio?
 
  08 August 2013
Ok, so forget about the gif animation and rollovers if that's too difficult..what if I just want a dot net solution to just clicking on ceratain areas to trigger different events?
 
  08 August 2013
Originally Posted by DannyBoy3: I want to create a dot net window rollover, as in html, so that certain sections of a graphic are highlighted on mouse rollover, then clickable to trigger an action....any simple code for this to start me off?

a .NET solution can be the using of GraphicsPath and control's region... here is a sample:
try(form.close()) catch()	
 form = dotnetobject "MaxCustomControls.Maxform"
 form.Text = "Shape Control by denisT"	
 form.StartPosition = form.StartPosition.Manual
 form.Bounds = dotnetobject "System.Drawing.Rectangle" 800 200 300 200 
 
 bt0 = dotnetobject "Button"
 bt0.name = "Green Star"
 bt0.FlatStyle = bt0.FlatStyle.Flat
 bt0.BackColor = bt0.BackColor.Green
 bt0.FlatAppearance.MouseOverBackColor = bt0.FlatAppearance.MouseOverBackColor.LightGreen
 bt0.Bounds = dotnetobject "System.Drawing.Rectangle" 0 0 100 100
 
 bt1 = dotnetobject "Button"
 bt1.name = "Red Star"
 bt1.FlatStyle = bt1.FlatStyle.Flat
 bt1.BackColor = bt1.BackColor.Red
 bt1.FlatAppearance.MouseOverBackColor = bt1.FlatAppearance.MouseOverBackColor.Pink
 bt1.Bounds = dotnetobject "System.Drawing.Rectangle" 50 50 100 100
 
 pp0 = 
 #(
 	dotnetobject "System.Drawing.PointF" 68 57,
 	dotnetobject "System.Drawing.PointF" 92 36,
 	dotnetobject "System.Drawing.PointF" 60 33,
 	dotnetobject "System.Drawing.PointF" 47 3,
 	dotnetobject "System.Drawing.PointF" 35 33,
 	dotnetobject "System.Drawing.PointF" 3 36,
 	dotnetobject "System.Drawing.PointF" 27 57,
 	dotnetobject "System.Drawing.PointF" 20 88,
 	dotnetobject "System.Drawing.PointF" 47 72,
 	dotnetobject "System.Drawing.PointF" 75 88
 )
 pp1 = 
 #(
 	dotnetobject "System.Drawing.PointF" 45 61,
 	dotnetobject "System.Drawing.PointF" 68 61,
 	dotnetobject "System.Drawing.PointF" 48 50,
 	dotnetobject "System.Drawing.PointF" 60 30,
 	dotnetobject "System.Drawing.PointF" 40 42,
 	dotnetobject "System.Drawing.PointF" 29 22,
 	dotnetobject "System.Drawing.PointF" 29 45,
 	dotnetobject "System.Drawing.PointF" 6 44,
 	dotnetobject "System.Drawing.PointF" 26 56,
 	dotnetobject "System.Drawing.PointF" 14 75,
 	dotnetobject "System.Drawing.PointF" 34 64,
 	dotnetobject "System.Drawing.PointF" 45 84
 )
 
 pt0 = for k=1 to pp0.count collect (dotnetclass "System.Drawing.Drawing2D.PathPointType").Line.value__
 pt1 = for k=1 to pp1.count collect (dotnetclass "System.Drawing.Drawing2D.PathPointType").Line.value__
 
 gp0 = dotnetobject "System.Drawing.Drawing2D.GraphicsPath" pp0 pt0
 gp0.AddEllipse 34 38 25 25
 bt0.region = dotnetobject "System.Drawing.Region" gp0
 gp1 = dotnetobject "System.Drawing.Drawing2D.GraphicsPath" pp1 pt1
 bt1.region = dotnetobject "System.Drawing.Region" gp1
 
 form.Controls.AddRange #(bt0, bt1)
 
 fn onClick s e = print s.name
 dotnet.addeventhandler bt0 "Click" onClick
 dotnet.addeventhandler bt1 "Click" onClick
 
 form.ShowModeless()
   

see the documentation (methods and constructors) of System.Drawing.Drawing2D.GraphicsPath for more information.

Last edited by denisT : 08 August 2013 at 12:04 PM.
 
  08 August 2013
Interesting. Thanks a lot denis. So I suppose you could have a button on top of a form with it's own background graphic which you could make visible on mouse over, so it creates in effect rollover image.
 
  08 August 2013
Originally Posted by DannyBoy3: Interesting. Thanks a lot denis. So I suppose you could have a button on top of a form with it's own background graphic which you could make visible on mouse over, so it creates in effect rollover image.

all what you tell above, on .NET forms language calls Regions...
 
  08 August 2013
Hmm . I tried to create an event handler function that changed the background image on the button on mouse over but it wouldn't do it for some reason. I also tried to make it visible on mouse over but it wouldn't do that either.
 
  08 August 2013
No it's all good. I worked it out. I guess the only thing left to do is figure out how to carve curves out of the button.
 
  08 August 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:17 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.