i tried with StretchBlt, but i cant zoom as much as i want.
so i said to myself, what about copy my picture in an image, and just
strech it..
i dont know. :/
thanks!
See if this gives you some ideas:
Add a picturebox to a new form and paste in the code below.
Then start drawing on the picturebox, or the form....
(Left button = Black -- Right Button = White)
LFS
Option Explicit
' Initialize Form / Picturebox
Private Sub Form_Load()
Picture1.ScaleMode = vbPixels
Picture1.Move 90, 90, 330, 330
Picture1.AutoRedraw = True
Picture1.BackColor = vbWhite
Me.Show: Me.Refresh
PlotPic 0, 0, vbWhite
End Sub
' Draw on Form
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
PlotForm X, Y, vbWhite And (Button = vbRightButton)
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button Then PlotForm X, Y, vbWhite And (Button = vbRightButton)
End Sub
' Draw on Picturebox
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
PlotPic X, Y, vbWhite And (Button = vbRightButton)
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button Then PlotPic X, Y, vbWhite And (Button = vbRightButton)
End Sub
Private Sub PlotForm(ByVal X&, ByVal Y&, ByVal K&)
Dim xx&, yy As Long
xx = (X - 480) \ 165
yy = (Y - 90) \ 165
PlotPic xx, yy, K
End Sub
Private Sub PlotPic(ByVal X&, ByVal Y&, ByVal K&)
Picture1.PSet (X, Y), K
Me.PaintPicture Picture1.Image, 480, 90, 3000, 3000
End Sub
Because of the VB online help for this method is as poor as
usally and took me some wasted time too, here a short
description:
picT.PaintPicture picS.Picture, xT, yT, wT, hT, xS, yS, wS,
hS
with S indicating source and T indicating target picture
box, and x,y,w,h indicating position and size of the
rectangles. As far as I remember both picture boxes **must**
have set AutoRedraw=True.
So, if you define the target region twice so big as the
source region you hav a zoom factor of 2, a very fine thing,
and you even can have different zoom factors for x- and
y-direction.