イメージのサイズを、比率を変えないで縮小するファンクションです。 |
Option Explicit Public Function ImgSizeChenge( _ ByRef MyHeight as Long,ByRef MyWidth as Long, _ ByVal BaseHeight as Long,ByVal BaseWidth as Long) Dim intTmp As Long Dim intTmp2 As Long 'イメージのサイズを設定する '縦のサイズを調整する If MyHeight > BaseHeight Then intTmp = MyHeight - BaseHeight intTmp2 = MyHeight MyHeight = MyHeight - intTmp MyWidth = MyWidth - (MyWidth * (intTmp / intTmp2)) End If If MyWidth > BaseWidth Then intTmp = MyWidth - BaseWidth intTmp2 = MyWidth MyWidth = MyWidth - intTmp MyHeight = MyHeight - (MyHeight * (intTmp / intTmp2)) End If End Function VisualBasic Help参照ポイント Function ステートメント ByRef キーワード
今回はコメントを省きましたが、必要な時はお知らせください。 トップページに、掲示板が有りますので、そちらにどうぞ。 参考にして頂ければ幸いです。 |
Copyright(C) 1999-2000 スタジオ T-MAN MailTo:t-man@mx4.ttcn.ne.jp |