ImagXpress可以讓使用者選擇正在浏覽的圖像的一部分,這個部分中,稱為Rubberband,可以用很多種方式使用:比如,複制到另一個控制或緩沖區,或被選擇作為一個區域來處理。下面來看一下在 Activex & COM版本中Rubberband的使用。
Rubberband使用
1、調用RubberBand方法,設定state = true,在一個指定的位置啟動一個rubberband。
2、調用RubberbandUpdate方法更新rubberband矩形的結束坐标,RubberBandH 、RubberBandW、RubberBandL和RubberBandT屬性真是可讀,會傳回rubberband矩形坐标的的高度、寬度和坐标,當調用RubberBand方法的時候,就會更新這些屬性。
3、調用 CopyRubberbandDIB 方法,複制rubberband建構的内容到一個DIB中。
Activate the rubberband when the user first clicks the mouse
Private
Sub
ImagXpress1_MouseDown(Button
As
Integer
, Shift
As
Integer
, X
As
Single
, Y
As
Single
)
' CLEAR ANY EXISTING RUBBER BANDING REGION
ImagXpress1.RubberBand
False
, X, Y,
False
' CONVERT X & Y TO PIXELS
X = X / Screen.TwipsPerPixelX
Y = Y / Screen.TwipsPerPixelY
' TURN THE RUBBER BANDING ON, SET THE STARTING POINT
ImagXpress1.RubberBand
True
, X, Y,
False
End
Sub
>>>完整示例代碼
>>>ImagXpress 下載下傳