Home » U++ Library support » Look and Chameleon Technology » HotSpots usage HOWTO
HotSpots usage HOWTO [message #30180] |
Mon, 13 December 2010 22:02  |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
hi guys,
there almost no information on how Hotspots in iml designer work. can anyone drop some information about it?
as much as i know / have found here and there:
* the iml Image editor has an edit option to specify 2 'hotspots' in an Image, a blue and a yellow one.
* they are used in ChPaint related functions, more exactly, in Cham.cpp:177
* they are used to 'somehow' define which area is 'static' and which is dynamic, scaling/stretching the image to fit a whole button of any size..
but how should the hotspots be used to specify it correctly..?
i was looking in code, cant get a light, looking in CtrlLib::Ctrls.iml, cant figure out, why my specifications dont work.
so how does it work with the hotspots? how does the intelligent scaling work?
[Updated on: Mon, 13 December 2010 22:11] Report message to a moderator
|
|
|
Re: HotSpots usage HOWTO [message #30182 is a reply to message #30180] |
Mon, 13 December 2010 22:59   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
playing around a bit i found out some general things:
* blue hotspot seems to be hotspot2 and is not used, or at least i couldnt get it to mean sth logical
* thats why blue hotspot needs to remain in top left corner, default (0,0)
* red hotspot, maybe hotspot1, is the real one used.
usage:
red hotspot marks the marging of area in Image, which can be stretched, and thus separates it from area that is fixed drawn without stretching.
see the quick dirty drawing below:
while the respective corners are drawn as is, the layers that lay inbetween are streched/repeated in the directions indicated and thus create a circular margin.
the area in the center is seen as an Image which is drawn resized into the respective remaining space in destination.
correct me if sth is wrong. it's quite important to have this clear.

-
Attachment: hotspot.gif
(Size: 703.18KB, Downloaded 725 times)
|
|
|
|
Re: HotSpots usage HOWTO [message #30185 is a reply to message #30184] |
Tue, 14 December 2010 08:59   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
thanks for the link. i helped a bit more.
i still can't understand why the hotspots, as far as i got them understood now, are used differently in al the Ctrls.iml CtrlsClassic.iml than they should be used, relying on internal hacks / changes? how is one supposed to understand by reading code in this case?
* the 2 hotspots depict the area in an iml image, which is streched.
* the left button controls the red hotspot, which is hotspot 1
* the right button controls the blue hotspot, hotspot 2
* the image is separated in 9 areas, which are treaded differently
* the 4 corners are drawn fixed, with no resize
* the rectangular part between the 2 hotspots is resized both, in X and Y
* the parts at left and right side, are streched in Y
* the parts at top and bottom side, are streched in X
mirekt mentioned that when swaping the hotspots, instead of streching, they are tiled.
but i really dont understand why most of the Ctrls.iml hotspots are set
red hotspot 1(some x, some y)
blue hotspot 2(0,0)
resulting in a 'negative' Rect..
instead of, for proper understanding, beeing set to
red hotspot 1(some x,some y) in top left part
blue hotspot 2(some x, some y) in bottom right part
red hotspot
|
|
|
Re: HotSpots usage HOWTO [message #30192 is a reply to message #30180] |
Tue, 14 December 2010 12:36   |
|
Hi kohait,
Just a note: I believe that the original historical meaning of "hotspots" is to mark a pixel in cursor image where the actual click operation takes place (e.g. the tip of the arrow). Hotspot1 marks left click Hotspot2 is does the same for right click. You can try this easily just by assigning an image with hotspots as a mouse pointer.
I think that all the usage in chameleon is just clever reusing the existing feature to completely different purpose 
Best regards,
Honza
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 19:39:20 CEST 2025
Total time taken to generate the page: 0.00496 seconds
|