|
-
Mar 4th, 2001, 06:34 PM
#1
Thread Starter
Lively Member
Hey, I was wondering if anyone out there could show
me a way to resize a .jpg picture and then save it as
a .jpg again. To make thumbnails and such. Any help
would be greatly appreciated.
-Zen
-
Mar 4th, 2001, 07:00 PM
#2
Addicted Member
You can easily resize the picture using the PaintPicture method. Just pass the selected values for the Width and Height parameters. As for saving a picture to JPG, use this code from vbAccelerator (click on the "Media" category).
-
Mar 4th, 2001, 07:20 PM
#3
Thread Starter
Lively Member
Ok, but how to use painpicture?
I'm not really sure how to use paintpicture, do you think
you could help me out with that too? Thanks a lot 
-Zen
-
Mar 4th, 2001, 07:39 PM
#4
Addicted Member
Ok... put a PictureBox control on the form and load a picture in it. Leave the names as they are.
Code:
Private Sub Form_Load()
Picture1.Visible = False
' Set the desired width and height
Picture1.Width = 1440
Picture1.Height = 780
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Button And vbLeftButton) = vbLeftButton Then
Me.Cls
Me.PaintPicture Picture1.Picture, X, Y, Picture1.Width, Picture1.Height
ElseIf (Button And vbRightButton) = vbRightButton Then
Me.Cls
Me.PaintPicture Picture1.Picture, X, Y
End If
End Sub
When you click a form with the left mouse button, the picture will be displayed like a thumbnail and when you click with the right mouse button, it will be displayed in full-size.
-
Mar 4th, 2001, 08:26 PM
#5
Thread Starter
Lively Member
Ok, I tried that and it worked well. But now how do I
save this? I see what happens is that it just resizes the
picturebox and doesn't resize the picture IN the
picturebox. It makes a new image that has nothing to
do with the picturebox, right? Now if I wanted to save
this what would I have to do (using the vbAccelerator
code you showed me). If it had been resized inside the
picturebox I could just saved the result from it, but now
I don't really know what to do.
I'm sorry if I'm asking to many questions, but I am kinda
newbie here so Thanks for the help so far though!
-Zen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|