|
-
Apr 5th, 2004, 04:20 PM
#1
-
Apr 5th, 2004, 04:25 PM
#2
Perhaps the following will do the job:
VB Code:
Private Sub Command1_Click()
SavePicture Picture1.Picture, App.Path & "\mypicture.bmp"
End Sub
-
Apr 5th, 2004, 04:28 PM
#3
That was my first guess too...if that doesn't work use BitBlt to Blt it to a new picture box (that one should now have the same size and, not be streched)..and then save it...
-
Apr 5th, 2004, 04:29 PM
#4
-
Apr 5th, 2004, 04:31 PM
#5
-
Apr 5th, 2004, 04:39 PM
#6
Originally posted by manavo11
If I do a normal bitblt I will be able to save it?
It's my best shot right now...
Or you may have to use GetPixel and SetPixel..but I can't understand why taht should work any better then BitBlt...
-
Apr 5th, 2004, 04:40 PM
#7
Originally posted by manavo11
Thanks for the suggestion but it doesn't work... It shows an error. I tried using the Image property also but I just get a gray box saved... Any other ideas?
Make sure Picture1.AutoRedraw = True.
-
Apr 5th, 2004, 04:42 PM
#8
It seems it isn't working...
VB Code:
picTemp.Picture = Clipboard.GetData()
StretchBlt picStretch.hdc, 0, 0, picTemp.ScaleWidth / 2, picTemp.ScaleHeight / 2, picTemp.hdc, 0, 0, picTemp.ScaleWidth, picTemp.ScaleHeight, vbSrcCopy
picStretch.Height = picTemp.Height / 2
picStretch.Width = picTemp.Width / 2
Picture2.Width = picStretch.Width
Picture2.Height = picStretch.Height
BitBlt Picture2.hdc, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, picStretch.hdc, 0, 0, vbSrcCopy
SavePicture Picture2.Image, "C:\test.bmp"
I'm trying to make it half size...
Has someone helped you? Then you can Rate their helpful post. 
-
Apr 5th, 2004, 04:48 PM
#9
You don't need that second Blt... ...
-
Apr 5th, 2004, 04:49 PM
#10
Ex-Super Mod'rater
Yeah if you just Set AutoRedraw = True if works.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Apr 5th, 2004, 04:49 PM
#11
You don't even need any api to do that:
VB Code:
Public Sub ZoomPicture(pct As PictureBox, zoom As Double)
With pct
.Width = .Width * zoom
.Height = .Height * zoom
.PaintPicture .Picture, 0, 0, .ScaleWidth, .ScaleHeight
End With
End Sub
Also, open attachments for a sample project
-
Apr 5th, 2004, 04:50 PM
#12
-
Apr 5th, 2004, 04:52 PM
#13
Not at all, but take a look at that sample I sent last time.
-
Apr 5th, 2004, 04:52 PM
#14
Ex-Super Mod'rater
Seen as though you halfing the size it might be an idea to blur the image first so quality isn't lost so much.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Apr 5th, 2004, 05:13 PM
#15
-
Apr 5th, 2004, 05:14 PM
#16
-
Apr 5th, 2004, 05:19 PM
#17
Soften the edges....a lot of algorithms to do that....don't bother with it if this is just an example...
-
Apr 5th, 2004, 05:25 PM
#18
Ex-Super Mod'rater
Simplest way is to just set each pixel to the average of itself and the surounding pixels, as NoteMe says theres not really any point if your just playing around to see what StretchBlt does .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Apr 5th, 2004, 05:38 PM
#19
-
Apr 5th, 2004, 05:49 PM
#20
Ex-Super Mod'rater
Well when you use StretchBlt its like taking everyother pixel and using that, however this means if you use it on a grid and the lines on the grid are 1 think (and lie on the every other line) they will be lost or the other way round and they will appear as a solid color.
When you use the Blur first this means that a pixel on the missed out lines isn't forgotten because it has had an effect on the surrounding pixels.
There is a slight delay but it all depends on how big the picture is and what method you use. Some methods you wont even notice the delay.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Apr 5th, 2004, 05:56 PM
#21
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
|