Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Look and Chameleon Technology » BUG? ImageOp's not HotSpot aware
BUG? ImageOp's not HotSpot aware [message #30188] Tue, 14 December 2010 11:22 Go to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
some ImageOp functions, i.e. Colorize, will ignore the hotspots when copying the image data.
is it meant like that?

use case is:
i am playing with style and colorizing current style CtrlsImg::iml() using the Colorize funtction (and a helper) works pretty fine, but hotspots are gone..
any hints on that?

same case applys to
ColorMask
AssignAplha
Equalight
Grayscale
Colorize
Contrast
MirrorHorz
MirrorVert

these are functions that dont change size of the image, and could keep the hotspots

[Updated on: Tue, 14 December 2010 11:23]

Report message to a moderator

Re: BUG? ImageOp's not HotSpot aware [message #30194 is a reply to message #30188] Tue, 14 December 2010 17:41 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
i've edited the functions, maybe someone can analyze this and of not otherwise problematic put it upstream..

  • Attachment: ImageOp.cpp
    (Size: 14.74KB, Downloaded 481 times)
Re: BUG? ImageOp's not HotSpot aware [message #30349 is a reply to message #30194] Sat, 25 December 2010 20:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I have added some. I think Mirror should have them swapped, also ortogonal rotations should have them rotated - have not done it yet.

Mirek
Re: BUG? ImageOp's not HotSpot aware [message #30357 is a reply to message #30349] Sun, 26 December 2010 09:48 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
i'll take a look and post the changes left..thanks
Re: BUG? ImageOp's not HotSpot aware [message #31832 is a reply to message #30357] Wed, 30 March 2011 10:58 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
swapping the hotspots when mirroring is not so good, since it generates a 'negative' Rectangle.

i'd vote for simply keep the hotspots where they are, since it's actually a 'visual' mirroring, not a functional.

color mask is same..
so here are the changes left
@@ -138,6 +138,8 @@ Image ColorMask(const Image& src, Color key)
 			*t++ = *s;
 		s++;
 	}
+	ib.SetHotSpot(src.GetHotSpot());
+	ib.Set2ndSpot(src.Get2ndSpot());
 	return ib;
 }
 
@@ -586,6 +588,8 @@ Image MirrorHorz(const Image& img)
 			e--;
 		}
 	}
+	ib.SetHotSpot(img.GetHotSpot());
+	ib.Set2ndSpot(img.Get2ndSpot());
 	return ib;
 }
 
@@ -604,6 +608,8 @@ Image MirrorVert(const Image& img)
 			e++;
 		}
 	}
+	ib.SetHotSpot(img.GetHotSpot());
+	ib.Set2ndSpot(img.Get2ndSpot());
 	return ib;
 }
 
Re: BUG? ImageOp's not HotSpot aware [message #31941 is a reply to message #31832] Sun, 10 April 2011 14:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Wed, 30 March 2011 04:58

swapping the hotspots when mirroring is not so good, since it generates a 'negative' Rectangle.

i'd vote for simply keep the hotspots where they are, since it's actually a 'visual' mirroring, not a functional.



I disagree. Hotspots itself are "visual" as well. Just copying them is no better than ignoring them.
Re: BUG? ImageOp's not HotSpot aware [message #31945 is a reply to message #31941] Sun, 10 April 2011 15:57 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
what do you suggest? sth *should* be done with the hotspots.
at least with Colorize()..

in what 'way' are the hotspots visible? i always thought it makes its appearance in stretching on buttons and the like only..
Re: BUG? ImageOp's not HotSpot aware [message #32004 is a reply to message #31945] Sat, 16 April 2011 20:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Sun, 10 April 2011 09:57

what do you suggest? sth *should* be done with the hotspots.
at least with Colorize()..



Well, Colorize transfers hotspots.

Frankly, I do not think this issue is that much important. But I agree it should be sorted out for completness.

Quote:


in what 'way' are the hotspots visible? i always thought it makes its appearance in stretching on buttons and the like only..


That makes them visible, does not it?

Mirroring image and leaving hotspot in the same place yields invalid results for stretching.

Needless to say, there is no good solution for this anyway, because hotspots can be used for mouse cursors too, so we cannot both fix 'negative rectangle' issue and mouse cursor hotspot...
Re: BUG? ImageOp's not HotSpot aware [message #32015 is a reply to message #32004] Sun, 17 April 2011 14:32 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
sorry i meant ColorMask, where they can be kept as is as well.

i am not that much in that stuff, maybe its good though Smile i can see from the mere user perspective..

my point, so far i could grasp it, is this: as long as the funciton only changes the value of the pixels themselves (or only copies them) hotspots can be kept. the easy solution could be: as soon as the dimensions of an image are changed, hotspot info is gone. mirroring is actually sth in beween.

in ImageOp.cpp, there now these functions, which dont handle hotspot (AFAIK):
Copy, Sharpen, Etched, RotateClockwise, anticlockwise, rotate180, Rotate, Magnify..DstSrc, DstSrcOp, Over, OverStraighOpaque, Crop.

i agree that it cant be solved the perfect way, for both mouse cursor and image stretching.
Re: BUG? ImageOp's not HotSpot aware [message #32023 is a reply to message #32015] Sun, 17 April 2011 21:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, ColorMask fixed.
Re: BUG? ImageOp's not HotSpot aware [message #32024 is a reply to message #32023] Sun, 17 April 2011 21:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sharpen and Etched have nasty implementation problem w.r.t. hotspots copy, that could not be solved easily. I believe it is not worth the effort...
Re: BUG? ImageOp's not HotSpot aware [message #32028 is a reply to message #32024] Mon, 18 April 2011 08:27 Go to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
thats alright. the most cases a user would dare to utilize are fixed. thanks for your patience
Previous Topic: HotSpots usage HOWTO
Next Topic: Appearance problem in TabCtrl
Goto Forum:
  


Current Time: Sat Apr 20 00:22:18 CEST 2024

Total time taken to generate the page: 0.02599 seconds