|
-
Jan 5th, 2008, 04:33 PM
#1
Thread Starter
Junior Member
[RESOLVED] Saving images w/Common Dialog
:/
I'm trying to save a picture in a picturebox
Code:
Private Sub mnuSave_Click()
cdlDialog.Filter = "Images (*.jpg) | *.jpg"
cdlDialog.ShowSave ' show save dialog box..cm
SavePicture picImg.Picture, cdlDialog.FileName
End Sub
I'm getting error 380 "Invalid Property Value".
-
Jan 5th, 2008, 04:46 PM
#2
Re: Saving images w/Common Dialog
Are you sure you are wanting to save picImg.Picture or should it be picImg.Image? Double check. If you haven't Set picImg.Picture = something, then picImg.Picture is probably zero.
-
Jan 5th, 2008, 05:07 PM
#3
Thread Starter
Junior Member
Re: Saving images w/Common Dialog
Yep, that was it. But another problem now 
In the program you can draw your picture and save it. When trying to re-open that picture, it is too large (There's an image size limit).
Here's my code for the image limiting...
Code:
If picImg.Picture.Height > 9285 Or picImg.Picture.Width > 10860 Then
MsgBox "Sorry, that picture is too large." & picImg.Picture.Height & "x" & picImg.Picture.Width
Set picImg.Picture = LoadPicture(vbNullString)
picImg.Height = 6855
picImg.Width = 9705
End If
What scale would the images from a dialog box be in? It's not pixels, and not twips. The images saved are 643x453 pixels. The msgbox is saying it's 11986x17013 in w/e units.
-
Jan 5th, 2008, 05:15 PM
#4
Re: Saving images w/Common Dialog
A picture's width & height are in a scalemode called HiMetrics. To determine the actual size. Replace vbPixels with vbTwips or other scale as needed
Code:
Debug.Print "Width="; ScaleX(picImage.Picture.Width, vbHimetric, vbPixels)
Debug.Print "Height="; ScaleY(picImage.Picture.Height, vbHimetric, vbPixels)
Last edited by LaVolpe; Jan 5th, 2008 at 05:37 PM.
-
Jan 5th, 2008, 05:35 PM
#5
Thread Starter
Junior Member
Re: Saving images w/Common Dialog
That's giving me an error...Invalid procedure or argument.
-
Jan 5th, 2008, 05:37 PM
#6
Re: Saving images w/Common Dialog
Sorry, try again, you may have copied the code before I realized a typo.
-
Jan 5th, 2008, 05:41 PM
#7
Thread Starter
Junior Member
Re: Saving images w/Common Dialog
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
|