|
-
Dec 20th, 2000, 12:42 AM
#1
Thread Starter
PowerPoster
Is there any special API/functions for generating thumbnails or everybody uses StrechBlt/PaintPicture for doing so?
-
Dec 20th, 2000, 04:04 AM
#2
transcendental analytic
There isn't any difference, thumbnails are resized
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.
-
Dec 22nd, 2000, 12:53 PM
#3
PowerPoster
Only thing you can do is anti-aliasing to save quality...
-
Dec 26th, 2000, 11:11 AM
#4
Frenzied Member
Interpolate
Here's some code I found to interpolate an image:
Code:
For y = 0 To Pic.Height Step ((Pic.Height / Resized.Height) * 15) - 1
For x = 0 To Pic.Width Step ((Pic.Width / Resized.Width) * 15) - 1
Dim cRed, cBlue, cGreen
For sX = x To (x + ((Pic.Width / Resized.Width) * 15)) Step 15
For sY = y To (y + ((Pic.Height / Resized.Height) * 15)) Step 15
RGBfromLONG (GetPixel(Pic.hdc, sX / 15, sY / 15))
cRed = (cRed + rRed) / 2
cBlue = (cBlue + rBlue) / 2
cGreen = (cGreen + rGreen) / 2
Next sY
Next sX
SetPixel Resized.hdc, rX / 15, rY / 15, RGB(cRed, cGreen, cBlue)
rX = rX + 15
Next x
rY = rY + 15
rX = 0
Next y
Resized.Refresh
Now the function RGBFromLong:
Code:
Private Function RGBfromLONG(LongCol As Long)
'Get The Red, Blue And Green Values Of A Colour From The Long Value
rRed = LongCol And 255
rGreen = (LongCol And 65280) \ 256
rBlue = (LongCol And 16711680) \ 65535
End Function
Oh, there's 3 more variables you must declare (in the Declarations part of the code, before all the other functions) :
Code:
Dim rRed As Byte
Dim rBlue As Byte
Dim rGreen As Byte
That's it. Make sure you have the SetPixel and GetPixel APIs declared. The original image is Pic and the resized image is Resized. Sorry for having no comments, but that's how I found the function. And if it doesn't work, reply back, because I haven't tested it!
-
Dec 27th, 2000, 03:01 AM
#5
Thread Starter
PowerPoster
I am sory to ask this question again, but I still have no answer for this one:
Have any one of you ever tried using PaintPicture or StrechBlt on a child window. I cannot seem to make it work when I call it in the form resize event. The child window and the Mdi window are from two different applications. I am setting the child window to its mdi parent through a api call. If you can't understand the question, please post a message so that I can calrify further.
-
Dec 27th, 2000, 09:51 AM
#6
Thread Starter
PowerPoster
Oops!
Sorry for the trouble, but it was a simple case of setting the autoredraw property to true.
Sorry again
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
|