Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 22 SEP 2009 02:20:10AM Colin Rule wrote:

On a Bitmap control there is a radio button with three properties, clip, stretch and scale.

IMAGECLIP returns 0 for Scale and 0 for Stretch, and 1 for Clip.

How can we differentiate and set these via code?

Is there some other property for handling these styles?

Nothing in the online help for 8.0.8.

Thanks

Colin


At 22 SEP 2009 10:49AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

pre.code {

 background-color: #E5E5E5;
 border: 1px solid #000000;
 width: 800px;
 padding: 5px;
 font-family: courier, verdana, arial, serif;
 margin: 0px 10px auto;

}

   
   $insert ps_Equates
   equ PSS_BM_SCALEIMAGE$ to 0x0800
   
   bmpStruct=get_Property( @window : ".BITMAP_1", "ORIG_STRUCT" )
   psStyle  =bmpStruct<0,PSPOS_PSSTYLE$,1>
   
   * // Hex to Decimal
   psStyle  =iconv( psStyle3,@svm, "MX" )
   
   * // Check the PSS_BM_SCALEIMAGE$ flag
   isScaled =( bitAnd( psStyle, PSS_BM_SCALEIMAGE$ ) # 0 )

The Sprezzatura Group

The Sprezzatura Blog

World leaders in all things RevSoft

I18N Round Table & London RUG Meeting - Register online now Click here to register for the October I18N RoundTable and next RUG meeting


At 22 SEP 2009 06:43PM Colin Rule wrote:

Thanks, not sure I follow.

This is to determine if the bitmap is scaled.

How to I set this (ie toggle, clip, scale, resize)?

My aim is to have a radio button like the one on the properties screen, so the user can decide how to display the selected image.

Colin


At 23 SEP 2009 05:21AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Colin,

Currently the interface is read only - if you need to change the bitmap you'll need to destroy it and recreate it. The flags you need are in the PS style for the control (which you will see change in the Form Designer in the Raw Style Bit Editor)

So basically, get the ORIG_STRUCT, modify the PS style, destroy the control and then recreate with the modified struct, something like this (NOT TESTED!!!)

compile function bmp_ImageScale( bmpID, bSet ) /*    Example function to get and the IMAGESCALE property    of a bitmap control - NOT TESTED!!!!      */    declare function get_Property    $insert ps_Equates    $insert logical        equ PSS_BM_SCALEIMAGE$ to 0x0800        if assigned( bmpID ) else bmpID = ""    if assigned( bSet )  else bSet  = ""        if len( bmpID ) else       return FALSE$    end        bmpStruct = get_Property( bmpID, "ORIG_STRUCT" )    psStyle   = bmpStruct<0,PSPOS_PSSTYLE$,1>        *  Hex to Decimal    psStyle   = iconv( psStyle  3,@svm  , "MX" )        *  Check the PSS_BM_SCALEIMAGE$ flag    isScaled  = ( bitAnd( psStyle, PSS_BM_SCALEIMAGE$ ) # 0 )

&nbsp;&nbsp;&nbsp;if&nbsp;len(&nbsp;bSet&nbsp;)&nbsp;then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;Set&nbsp;the&nbsp;property &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;isScaled&nbsp;#&nbsp;bSet&nbsp;)&nbsp;then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;bSet&nbsp;then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;psStyle&nbsp;=&nbsp;bitOr(&nbsp;psStyle,&nbsp;PSS_BM_SCALEIMAGE$&nbsp;) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;psStyle&nbsp;-=&nbsp;PSS_BM_SCALEIMAGE$ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bmpStruct&lt;0,PSPOS_PSSTYLE$,1&gt;&nbsp;=&nbsp;"0x"&nbsp;:&nbsp;oconv(&nbsp;psStyle,&nbsp;"MX"&nbsp;) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call&nbsp;utility(&nbsp;"DESTROY",&nbsp;bmpID&nbsp;) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call&nbsp;utility(&nbsp;"CREATE",&nbsp;bmpStruct&nbsp;) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp; return&nbsp;isScaled The Sprezzatura Group The \Sprezzatura Blog World leaders in all things RevSoft I18N Round Table & London RUG Meeting - Register online now Click here to register for the October I18N RoundTable and next RUG meeting </QUOTE> —- === At 23 SEP 2009 05:59AM Colin Rule wrote: === <QUOTE>Ah, thats a nuisance. I dont think Create is a viable utility under the runtime licence (or is it). Seems a bit complex, not really a friendly facility, so I might just withdraw this from the user. Colin </QUOTE> View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/34cf4665e56cfdad852576390022ce6d.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1