' Rapid-Q by William Yu (c)1999-2000 . ' ================================================================================ ' Upload_il_tuo_script_su_Rapidq.it ' Qimage ****** QIMAGE Component ****** QImage is used to display a graphical image (BMP/ICON). It can also be used to draw primitive graphics. QImage Properties Field Type R/W Default ================== =================== =================== =================== Align INTEGER RW alNone Align determines how the control aligns within its parent control. Autosize INTEGER RW False AutoSize determines whether the image control resizes to accommodate the image it displays. BMP STRING RW Use BMP to assign a new bitmap file, or to store BMP in the image cache. Examples: DIM Image AS QIMAGE Image.BMP = "whatever.bmp" BMPHandle RESOURCE W Center INTEGER RW False Center positions the image so that it is centered in the image control. CopyMode INTEGER RW cmBlackness Cursor INTEGER RW crDefault Enabled INTEGER RW True Font QFONT W Handle INTEGER RW Height INTEGER RW Hint STRING RW ICOHandle RESOURCE W Icon STRING W IncrementalDisplay INTEGER RW False IncrementalDisplay specifies whether partial renderings of the image are drawn periodically during slow operations or on large compressed images. Left INTEGER RW 0 Parent QFORM/QPANEL/ W QTABCONTROL Pixel 2D ARRAY of INTEGER RW PopupMenu QPOPUPMENU W ShowHint INTEGER RW False Stretch INTEGER RW False Stretch resizes the image so that it exactly fits the bounds of the image control. Tag INTEGER RW Top INTEGER RW 0 Transparent INTEGER RW False Width INTEGER RW Visible INTEGER RW True QImage Methods Method Type Description Params =================== =================== =================== =================== Center SUB Centers image 0 Circle SUB (x1%, y1%, x2%, Draw & Fill 6 y2%, c%, fill%) Circle CopyRect D and S are QRECTs, SUB (D, Image, S) Image can be a 3 QImage, QCanvas, or QBitmap Draw SUB (x%, y%, BMP) Draw Bitmap at 3 (X,Y) FillRect SUB (x1%, y1%, x2%, Draws & Fills a 5 y2%, c%) rectangle Line SUB (x1%, y1%, x2%, Draws a line 5 y2%, c%) Paint SUB (x%, y%, c%, Fill Region 4 borderc%) Pset SUB (x%, y%, c%) Pixel plot 3 Rectangle SUB (x1%, y1%, x2%, Draws a rectangle 5 y2%, c%) Repaint SUB Force repainting of 0 image SUB (xOrigin%, Rotates entire Rotate yOrigin%, Angle%) image at specified 3 origin RoundRect SUB (x1%, y1%, x2%, Draws & Fills a 7 y2%, x3%, y3%, c%) rounded rectangle StretchDraw SUB (Rect AS QRECT, Draw BMP and BMP) stretch to fit 2 inside Rect TextHeight FUNCTION (Text$) AS Returns the height, WORD in pixels, of Text$ 1 string TextWidth FUNCTION (Text$) AS Returns the width, WORD in pixels, of Text$ 1 string SUB (Rect AS QRECT, Write text, and TextRect x%, y%, S$, fc%, clip within region 6 bc%) Rect TextOut SUB (x%, y%, S$, Writes text to 5 fc%, bc%) image QImage Events Event Type Occurs when... Params =================== =================== =================== =================== OnClick VOID User clicked on 0 image OnDblClick VOID User double clicked 0 on image OnMouseDown SUB (Button%, X%, Mouse button held 4 Y%, Shift%) down OnMouseMove SUB (X%, Y%, Mouse moves 3 Shift%) OnMouseUp SUB (Button%, X%, Mouse button is 4 Y%, Shift%) released QImage Examples '-- How to use a resource file CONST False = 0 CONST True = 1 $RESOURCE RES_BMP1 AS "C:\WINDOWS\CLOUDS.BMP" DIM Form AS QForm DIM Image AS QImage Image.Parent = Form Image.Autosize = True Image.BMPHandle = RES_BMP1 Form.ShowModal ' =============================================================================== ' 2003 Holyguard.net - 2007_Abruzzoweb