Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleUse the LoadImage API function to antialias an image
Keywordsantialias, anti-alias, anti alias, alias, LoadImage, resize
CategoriesGraphics
 

Load the picture using LoadImage. This function returns a handle to a bitmap containing the image at the indicated size. Use SelectObject to select the bitmap into a PictureBox.

 
' Use LoadImage to load the picture.
Private Sub LoadWithLoadImage(ByVal pic As PictureBox, _
    ByVal file_name As String)
Dim hbm As Long
Dim wid As Long
Dim hgt As Long

    ' Load the image using LoadImage.
    wid = pic.ScaleX(pic.ScaleWidth, pic.ScaleMode, _
        vbPixels)
    hgt = pic.ScaleY(pic.ScaleHeight, pic.ScaleMode, _
        vbPixels)
    hbm = LoadImage(ByVal 0&, file_name, _
        IMAGE_BITMAP, wid, hgt, &H10)

    ' Select the image into the PictureBox's device context.
    pic.AutoRedraw = True
    SelectObject pic.hdc, hbm

    ' Delete the bitmap.
    DeleteObject hbm
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated