|
-
Apr 22nd, 2000, 04:48 PM
#1
Thread Starter
Fanatic Member
Does anyone know how to zoom (+ or -) a picture in a picture box. Please give me the code.
Thanks.
-
Apr 22nd, 2000, 06:17 PM
#2
PowerPoster
Maybe you want to stretch a part of the picture (where you want to zoom)... So use StretchBlt
Example is on my page
-
Apr 22nd, 2000, 08:15 PM
#3
transcendental analytic
Recently, I have done some performance research with graphical functions. Paintpicture is faster than stretchblt in this case
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 23rd, 2000, 02:21 AM
#4
Thread Starter
Fanatic Member
Can you PLEASE give a code for zooming out and in a picture in a picture box. It would be of great help to me.
Thanks.
Kinjal
-
Apr 23rd, 2000, 02:53 AM
#5
transcendental analytic
Wow! They just changed the outlook of this site again.
Ok, speed is here the zoomfactor.
Code:
With Picture1
.Picture = .Image
.PaintPicture Picture1, 0, 0, .ScaleWidth, .ScaleHeight, .ScaleWidth / speed, .ScaleHeight / speed, .ScaleWidth - .ScaleWidth / speed * 2, .ScaleHeight - .ScaleHeight / speed * 2
End With
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 23rd, 2000, 03:11 AM
#6
Hyperactive Member
I would use the BitBlt API. Its great for working with images. If you don't know how to use it then simply goto the tutorial section of Lucky's VB Gaming Site.
-
Apr 23rd, 2000, 06:06 AM
#7
transcendental analytic
Bitblt surely is fastest but it doesn't stretch
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 23rd, 2000, 08:02 AM
#8
Fanatic Member
Try the StretchBlt API then. It stretches where BitBlt does not (I think).
John
-
Apr 23rd, 2000, 09:08 AM
#9
PowerPoster
That's right. But I heared PaintPicture is faster (and can also stretch)...
-
Apr 23rd, 2000, 03:34 PM
#10
transcendental analytic
Is anyone reading my posts at all?
Just (if you care) read trough this thread and you know what I mean
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 23rd, 2000, 07:46 PM
#11
Thread Starter
Fanatic Member
Hello Kedanan
Your code worked excellent for magnifying!
But how do I use your code to demagnify the picture? What are the changes required in the code? Hoe to maintain the aspect ratio of the picture?
Thanks.
Kinjal
-
Apr 23rd, 2000, 07:48 PM
#12
Thread Starter
Fanatic Member
Hello FOX
Your example did not work on my picture box, i don't know why? I have drawn grid on my picture box using picture.pset
and also draw lines. But none of them are magnified using your code.
Kinjal
-
Apr 23rd, 2000, 08:12 PM
#13
PowerPoster
Which example did you download? The Screenshot demo uses StretchBlt to resize the captured picture so if you want to zoom into a picture you have to replace the DCs and coordinates of StretchBlt call...
-
Apr 23rd, 2000, 11:39 PM
#14
transcendental analytic
Just set speed to a negative value. With paintpicture you should be able to mirror & flip the picture too. To get the ratio, just use some math.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 24th, 2000, 03:54 AM
#15
Fanatic Member
Re: Is anyone reading my posts
Just (if you care) read trough this thread and you know what I mean
No...oops 
Sorry!
John
-
Apr 24th, 2000, 04:49 AM
#16
transcendental analytic
John, could you make some color options for me (i don't like the purple background)?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|