Implement zooming functionality using HIcon--URGENT
Hi ,
I need to implement the zoom functionality on my Image. I am using HIcon to render the image.
The image is rendered at the point where Iset the bounds of the HIcon object.
But for a scaled image of say twice the size , I can only see a part of the image.
The only way i can see the whole image is to increase the bounds of the HIcon object. Is there any other way to do this?.I dont want to change the bounds or position of my HIcon object. Is there any way I can change the point of decoding of the image so that the bounds I set can remain fixed and my changing the point of decoding i can traverse through the whole image with my component staying at the same point always..
Thanks and Regards,
Pundit
[753 byte] By [
pundita] at [2007-11-27 4:30:39]

# 1
Hi Pundit,
I haven't had to solve this exact problem and am switching computers so I can't try it out at the moment, but HVisible, which HIcon inherits from, provides a method public void setResizeMode(int resize) where your options for the int parameter are:
HVisible.RESIZE_NONE
HVisible.RESIZE_PRESERVE_ASPECT
HVisible.RESIZE_ARBITRARY
The default is RESIZE_NONE, I believe, so changing the resize mode might solve your problem?
Hope that helps.
Anne
# 2
Hey anne,
The resize mode doesnt solve my problem. I think resize can be done if the image is smalller than the component. But in my case it is the opposite.
My image is bigger than the component and i want to show the image without touching the viewing window(ie my component).
Thanks anyways,
Pundit
ps: The question is still open guys!!!
# 4
Hi Pundit,I think that what you are asking for, is not feasible... because it is not possible to increase the canvas of a component without changing his bounds.RegardsAndrea
# 5
Well I finally implemented that.!!..phew!!
I extended the HGraphicLook class which is used to render the HIcon image and created my own Look class.
Then i played around with the graphic context and thus i could manage scaling and zooming any part of the image and show it in my component without changing the bounds in any way..
Thanks guys for all the help..
Regards
Pundit