IMAGECLIP Property (OpenInsight 32-Bit)
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 )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 )
if len( bSet ) then * Set the property if ( isScaled # bSet ) then if bSet then psStyle = bitOr( psStyle, PSS_BM_SCALEIMAGE$ ) end else psStyle -= PSS_BM_SCALEIMAGE$ end bmpStruct<0,PSPOS_PSSTYLE$,1> = "0x" : oconv( psStyle, "MX" ) call utility( "DESTROY", bmpID ) call utility( "CREATE", bmpStruct ) end end return 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...