原創(chuàng)|使用教程|編輯:郝浩|2013-07-19 13:45:11.000|閱讀 512 次
概述:ImagXpress可以讓用戶選擇正在瀏覽的圖像的一部分,這個(gè)部分中,稱為Rubberband,可以用很多種方式使用:比如,復(fù)制到另一個(gè)控制或緩沖區(qū),或被選擇作為一個(gè)區(qū)域來處理。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
ImagXpress可以讓用戶選擇正在瀏覽的圖像的一部分,這個(gè)部分中,稱為Rubberband,可以用很多種方式使用:比如,復(fù)制到另一個(gè)控制或緩沖區(qū),或被選擇作為一個(gè)區(qū)域來處理。下面來看一下在Activex & COM版本中Rubberband的使用。
Rubberband使用
1、調(diào)用RubberBand方法,設(shè)置state = true,在一個(gè)指定的位置啟動(dòng)一個(gè)rubberband。
2、調(diào)用RubberbandUpdate方法更新rubberband矩形的結(jié)束坐標(biāo),RubberBandH 、RubberBandW、RubberBandL和RubberBandT屬性真是可讀,會(huì)返回rubberband矩形坐標(biāo)的的高度、寬度和坐標(biāo),當(dāng)調(diào)用RubberBand方法的時(shí)候,就會(huì)更新這些屬性。
3、調(diào)用 CopyRubberbandDIB 方法,復(fù)制rubberband構(gòu)建的內(nèi)容到一個(gè)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 ' Track the user's changes whenever they move the mouse Private Sub ImagXpress1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) ' UPDATE THE RUBBER BAND X = X / Screen.TwipsPerPixelX Y = Y / Screen.TwipsPerPixelY ImagXpress1.RubberbandUpdate X, Y End Sub ' Do something with the region when the user lifts off the mouse Private Sub ImagXpress1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim xpos, ypos, w, h As Integer ' YOU CAN DO ANYTHING WITH, OR TO, THE REGION THE USER HAS SELECTED. IN THIS EXAMPLE, WE WILL ' COPY THE AREA TO ANOTHER CONTROL. ImagXpress2.hDib = ImagXpress1.CopyRubberbandDib ImagXpress2.ZoomToFit ZOOMFIT_BEST ' TURN THE RUBBER BAND OFF ImagXpress1.RubberBand False, X, Y, False End Sub
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件