Results 1 to 2 of 2

Thread: [RESOLVED]Resize Image whit GDI+

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    441

    [RESOLVED]Resize Image whit GDI+

    hi there some GDI + APIs to shrink an image before saving.
    for example a 500x500 image to 32x32 pass
    the opposite GdipGetImageBounds >> GdipSetImageBounds


    Thanks

    [RESOLVED]
    http://foren.activevb.de/cgi-bin/for...t=83942&page=1
    Last edited by LeandroA; Oct 29th, 2009 at 02:54 AM. Reason: [RESOLVED]
    leandroascierto.com Visual Basic 6 projects

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: [RESOLVED]Resize Image whit GDI+

    GdipGetImageThumbnail could be what you need..
    Code:
    Public Declare Function GdipGetImageThumbnail Lib "gdiplus" _
           (ByVal image As Long, ByVal thumbWidth As Long, _
           ByVal thumbHeight As Long, thumbImage As Long, _
           Optional ByVal callback As Long = 0, _
           Optional ByVal callbackData As Long = 0) As Long
    It seems you can set the Width and Height using parameters thumbWidth and thumbHeight .

    Another option (more complicated maybe) would be using StretchBlt, but for this one you need Source and Target DC's so in this case you would need 2 PictureBoxes or you could make it the API way and create your DCs with CreateCompatibleDC() API.
    Last edited by jcis; Oct 29th, 2009 at 03:06 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width