' Rapid-Q by William Yu (c)1999-2000 . ' ================================================================================ ' Upload_il_tuo_script_su_Rapidq.it ' QImageEx ****** QImageEx Component ****** QImageEx is a component as QImage with clipboard functions. Image copy to clipboard is possible if image has loading with the méthod LoadFromFile. QImageEx Properties Field Type R/W Default ======================= ======================= ======================= ======================= QImageEx Methods Method Type Description Params ================== ================================ ==================================== ====== CopyToClipboard SUB(rect as QRECT) Copy image to clipboard 1 PasteFromClipboard SUB Paste image from clipboard 0 LoadFromFile SUB Load a bitmap file 4 (FileName$,Width%,Height%,Real%) If the parameter Real is at true, the image will load with his dimensions. CanPaste FUNCTION Return TRUE if image présent in the 0 clipboard. QImageEx Events Event Type Occurs when... Params ======================= ======================= ======================= ======================= QImageEx Examples $typecheck on $INCLUDE "Rapidq.inc" $INCLUDE "Object\QImageEx.inc" declare sub OuvrirClick declare sub QuitterClick declare sub Copier declare sub Coller declare sub Present const title="Viewer picture" dim source as QRECT CREATE Form AS QFORM Caption =title Width = 600 Height = 600 Center CREATE Menu AS QMAINMENU CREATE item1 AS QMENUITEM Caption="&Fichier" CREATE item2 AS QMENUITEM Caption="&Ouvrir" OnClick=OuvrirClick END CREATE CREATE item5 AS QMENUITEM Caption="-" END CREATE CREATE item6 AS QMENUITEM Caption="&Quitter" OnClick=QuitterClick END CREATE END CREATE CREATE item11 as QMENUITEM Caption="&Edition" OnClick=Present CREATE item12 as QMENUITEM Caption="&Copier" OnClick=Copier END CREATE CREATE item13 as QMENUITEM Caption="&Coller" OnClick=Coller Enabled=false END CREATE END CREATE END CREATE CREATE ScrollBox1 AS QSCROLLBOX AutoScroll = 1 Align=5 Color = &HFFFFFF CREATE image AS QImageEx Autosize=1 END CREATE END CREATE END CREATE Form.ShowModal sub OuvrirClick dim file as QOPENDIALOG file.Filter="Fichiers bitmap(*.bmp)|*.bmp" file.InitialDir=CurDir$ if file.Execute then image.loadFromFile(file.fileName,0,0,true) Form.Caption=title+"-"+file.FileName end if end sub sub QuitterClick Form.Close end sub sub Copier source.left=0 source.top=0 source.right=image.width source.bottom=image.height image.copyToClipboard(source) end sub sub coller image.pasteFromClipboard end sub Sub Present if image.canpaste then item13.enabled=true else item13.enabled=false end if End Sub ' =============================================================================== ' 2003 Holyguard.net - 2007_Abruzzoweb