投稿日 | : 2002/10/04(Fri) 20:49 |
投稿者 | : うま |
Eメール | : |
URL | : |
タイトル | : Re^4: 画像の一部を取り込む方法 |
これさん、こんばんは。
お蔭様で、なんとなく全貌が掴めるようになりました。
しかし、下記の問題に出会ったまま糸口が見つかりません。
やり方1で何とか先に進みたいのですが・・・。何が悪いのでしょうか?
Private Sub Command1_Click()
'***** やり方1 *****
' 画像がコントロールにぴったりとは挿入できます。が、この場合、
' 実行時エラー’481’:ピクチャーが不正です。
' となります!
With Picture1
.Width = 500
.Height = .Width * 3 / 4 'デジタルカメラ解像度比:1.33
.AutoRedraw = True
.PaintPicture Image1.Picture, _
0, 0, _
.ScaleWidth, _
.ScaleHeight
End With
'***** やり方2 *****
' 問題無く貼り付けられます。しかし、.Pictureメソッドですと
' 画面が大き過ぎてコントロールからはみ出し、領域指定が
' 上手くいきません。
With Picture1
.Width = 500
.Height = .Width * 3 / 4
' .AutoRedraw = False
.Picture = Image1.Picture
End With
End Sub
Private Sub Picture1_MouseUp(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
Picture2.PaintPicture Picture1.Picture, _
0, 0, Shape1.Width, Shape1.Height, _
Shape1.Left, Shape1.Top, _
Shape1.Width, Shape1.Height, vbSrcCopy
End Sub
お手数をお掛けしますが、宜しくアドバイス、お願いいたします。<(_ _)>