|
-
Apr 1st, 2001, 08:14 AM
#1
Thread Starter
Lively Member
Hey, I've been trying to make some sort of thumbnail viewer, but all the thumbs look like **** when they are reduced in size? Is there a way to make them look better?? I mean like, when you resize a picture in PaintShop Pro and make it small, it still looks good.
Help is appreciated and rewarded with beers where appropriate, hihi
-
Apr 1st, 2001, 09:00 AM
#2
transcendental analytic
there's a bilinear resizing sample at http://www.ur.co.nz/
but be prepared, it's slow. I wouldn't care if the thumbnails were resized the way paint shop pro resize them in the browser, which can be done with ie paintpicture, without much performance
-
Apr 1st, 2001, 09:38 AM
#3
Thread Starter
Lively Member
"I wouldn't care if the thumbnails were resized the way paint shop pro resize them in the browser, which can be done with ie paintpicture, without much performance"
Didn't really understand what you meant by this...?
-
Apr 1st, 2001, 09:48 AM
#4
Good Ol' Platypus
I'll take a labbatt.... 
For / 2 thumbnails (20x20 - 10x10), average out each group of four pixels and plot that one pixel on the first one. Like kedaman said, these processes are slow.
BTW. kedaman, your avatar was better non-existant. This one scares me.... :0
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Apr 1st, 2001, 09:49 AM
#5
Good Ol' Platypus
Oh never mind, I just noticed what it was... I thought it was a picture of you warped, never mind... 
Silly me...
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Apr 1st, 2001, 10:11 AM
#6
Thread Starter
Lively Member
Hmmm.... the VB bilinear filter thingy didn't work.... it just warped whatever picture I put in? Weird... I probably did something wrong... but I don't think so.
It seems to cut the picture in 2 part, showing one part to the left and the other part to the right... don't think I really understand why.
Well, if you have ever used ACDSee they resize your picture in a preview image and that looks amazing even when it's really small. Do they use a routine like the one you gave me kedman? Or should I be looking for something different
-
Apr 1st, 2001, 10:11 AM
#7
transcendental analytic
well it's a picture of me 
i suggest paintpicture again, and yep, the browser in psp doesn't do any bilinear resizing or anything close to that.
-
Apr 1st, 2001, 10:17 AM
#8
Thread Starter
Lively Member
Could you give me some sort of example of using paintpicture to resize an image so it won't look ****ty when it gets like 70x70 or somethign similar?
-
Apr 1st, 2001, 10:25 AM
#9
transcendental analytic
sure
Code:
With Picture2
Picture1.PaintPicture Picture2.Picture, 0, 0, 70, 70, 0, 0, .ScaleWidth, .ScaleHeight, vbSrcCopy
End With
-
Apr 1st, 2001, 10:43 AM
#10
Thread Starter
Lively Member
-
Apr 1st, 2001, 10:48 AM
#11
transcendental analytic
well if you don't care how long it takes, go check out the link to unlimited realities i posted, there's a lot of other handy stuff out there too
-
Apr 1st, 2001, 10:52 AM
#12
Thread Starter
Lively Member
Well, I do care how long it takes, but I'll check out the link for more info, thanks.
-
Apr 1st, 2001, 03:18 PM
#13
Thread Starter
Lively Member
Ok, I got the blurring/resizing part to work quite well, but there are a couple of things I don't understand. First of all this :
The blurring seems to work poorly on very large images (bigger than 450 pixels in width) so I thought I'd resize them down to about 300 pixel in width and THEN blur them. But what happens is when I use paintpicture and then try to run the blur code I get to something the code can't handle... this part :
Code:
If bmp.bmBitsPixel <> 24 Then
MsgBox " 24-bit bitmaps only", vbCritical
Exit Sub
End If
When I use paintpicture the picture1.picture seems to not be a 24bit BMP anymore? Why is that and is there a say I can make it be a 24bit BMP? Here is the part of the code I use to resize the picture. If there is a better way to do it please tell 
Code:
NewPicHeight = ThumbnailHeight
NewPicWidth = Picture1.Width \ (Picture1.Height \ ThumbnailHeight)
Picture2.Height = NewPicHeight
Picture2.Width = NewPicWidth
Picture2.PaintPicture Picture1.Picture, 0, 0, NewPicWidth, NewPicHeight
Picture2.Picture = Picture2.Image
c.CreateFromPicture Picture2.Picture
Everything works really well, except for images larger than 450 pixels in width and larger than 450 pixels in height also, so any ideas as what to do?
-
Apr 1st, 2001, 05:22 PM
#14
transcendental analytic
thats somewhat weird, i haven't tried out the bigger images. About the 24 bit thing, if you paint picture to another picturebox, the image will probably gain the same properties as the picture, so if you have a non24 bit image, like a gif as picture, the image will turn out 8 bit too. This also might be the problem why your gif's looks crap when you used paintpicture earlier. Try it out before you go further.
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 1st, 2001, 06:16 PM
#15
Thread Starter
Lively Member
Well, I've tried lots of stuff now, but no luck. Still get the message about the picture being a non24bit BMP... I'm using this code to intercept pictures larger than 450 pixels :
Code:
If Picture1.Width > (450 * 15.5) Then
NewPicWidth = (450 * 15.5)
NewPicHeight = Pic1Height \ (Pic1Width \ (450 * 15.5))
Pictbuf.Height = NewPicHeight
Pictbuf.Width = NewPicWidth
Pictbuf.PaintPicture Picture1.Picture, 0, 0, NewPicWidth, NewPicHeight, , , , , vbSrcCopy
Pictbuf.Picture = Pictbuf.Image
Picture1.Picture = Pictbuf.Picture
Picture1.Height = NewPicHeight
Picture1.Width = NewPicWidth
'****** BLURING *********
DoImagePro "Blur"
Picture1.Refresh
'************************
The DoIamgePro function takes the pictbuf as a source and the picture1 as destionation and blurs it. But when I resize my pics like this, I get that damn error... any more ideas? Am I doing something wrong when I resize the picture so that it is no longer 24bit?? Oh and I am using a .jpg picture (24bit) with a size of 1100x1200 so that's not the problem. The blur works fine when I remove the resize code, but since the picture is bigger than 450 in width the colors gets ****ed up...
-
Apr 1st, 2001, 09:01 PM
#16
Thread Starter
Lively Member
Well, I found a solution to my problem, kind of.... I found an example program that could blur the images as I wanted using something called DIB Sections and cDIBsection. Well, it looked really advanced so I'll see what I get out of it. If anyone could help me out with some pointers and tips on DIB Sections I would greatly appreciate it!! 
If anyone else needs help with these kinds of things, there's a lot of stuff covered here. A bit advanced though...
http://www.vbaccelerator.com/codelib/gfx/imgproc2.htm
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
|