Thomas Haupt
|
AW: Problem in using the Zoom Resource of an Image Area.
|
Thomas Haupt
09/30/2008 7:53 AM
post14222
|
AW: Problem in using the Zoom Resource of an Image Area.
Hi,
as the docs say, this is a scalar resource of type "long", and
will be interpreted as a 16.16 fixed point number.
That means that of the 32 bits in the resource value, the upper
16 bits will give the integer part of the zoom factor, while the
least signifcant 16 bits provide the fractional part - in other
words, if you write down the number and place a '.' right in the
middle of the 32 bits, you see the "true" zoom factor.
Keep in mind that the bits to the right of the binary point denote
one half, one quarter, one eight, and so on...
Some examples:
0x00010000 ==> 0x0001.0000 == 1
0x00020000 ==> 0x0002.0000 == 2
0x00008000 ==> 0x0000.8000 == 0.5
0x00004000 ==> 0x0000.4000 == 0.25
0x00123000 ==> 0x0012.3000
==> 00000000 00010010.00110000 00000000 (binary)
== 18 + 1/8 + 1/16
== 18 + 0.125 + 0.0625
== 18.1875
Note that the "Autoscale" image area flag must be OFF in order
for this resource to work.
Further, zoom factors < 1 will (to my knowledge) be ignored.
Hope this helps,
- Thomas Haupt
> -----Ursprungliche Nachricht-----
> Von: chandrashekhar kulkarni [mailto:community-noreply@qnx.com]
> Gesendet: 30 September 2008 13:26
> An: general-ide
> Betreff: Problem in using the Zoom Resource of an Image Area.
>
>
>
> In a window, I have an Image Area widget(of class
> PtImageArea) in which I have imported a bitmap image. Now I
> am trying to zoom it by attaching an Activate callback to the
> Image area widget which calls the PtSetResource function to
> set the Pt_ARG_IMAGEAREA_ZOOM. I am not sure of the value and
> length of this resource as even after much searching, I could
> not get any information about it. Can any one help me out?
>
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post14219
>
>
|
|
|