Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8793219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:05:43+00:00 2026-06-13T23:05:43+00:00

Is it possible to scale an image proportionately in VB without one of the

  • 0

Is it possible to scale an image proportionately in VB without one of the 3 or 4 built in properties (since they do not work so well)?

What I am referring to is something that you can do in Java like this:

Image newimg = img.getScaledInstance(230, 310,  java.awt.Image.SCALE_SMOOTH);  

In Java the above line seems to work nicely for scaling the dimensions to fit a specified size.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:05:43+00:00Added an answer on June 13, 2026 at 11:05 pm

    I had a UserControl that I used to accomplish a better quality resize. Here is an extract from it, hopefully you can find it useful.

    Private Const STRETCH_ANDSCANS = 1
    Private Const STRETCH_DELETESCANS = 3
    Private Const STRETCH_HALFTONE = 4
    Private Const STRETCH_ORSCANS = 2
    Private Const SRCCOPY = &HCC0020
    
    Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, _
                                                       ByVal x As Long, _
                                                       ByVal y As Long, _
                                                       ByVal nWidth As Long, _
                                                       ByVal nHeight As Long, _
                                                       ByVal hSrcDC As Long, _
                                                       ByVal xSrc As Long, _
                                                       ByVal ySrc As Long, _
                                                       ByVal nSrcWidth As Long, _
                                                       ByVal nSrcHeight As Long, _
                                                       ByVal dwRop As Long) _
                                                       As Long
    
    Private Declare Function SetStretchBltMode Lib "gdi32" (ByVal hdc As Long, _
                                                          ByVal nStretchMode As Long) _
                                                          As Long
    

    And it was called like this:

    Private Sub UserControl_Paint()
    
       Dim lSave As Long
    
       'set the stretchblit mode (saving the previous value)
       lSave = SetStretchBltMode(UserControl.hdc, STRETCH_HALFTONE)
    
       'perform blit
       Call StretchBlt(UserControl.hdc, 0, 0, UserControl.ScaleWidth, _
                         UserControl.ScaleHeight, picBuffer.hdc, 0, 0, _
                         picBuffer.ScaleWidth, picBuffer.ScaleHeight, SRCCOPY)
    
       'restore previous mode
       Call SetStretchBltMode(UserControl.hdc, lSave)
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why fourier transform(dft) is not possible on color images? Why only on gray scale
I'm wondering if it possible to actually change a UIViews scale value without actually
Is it possible to achieve something like this: I have one picture to set
Possible Duplicate: scale and rotation Template matching I have a template grayscale image ,
More specifically, is it possible to scale a tiled background image using CSS3's transform:scale(x,y)
Possible Duplicate: Stretch and Scale a CSS image Background - With CSS only A
Is it possible with pure CSS to make an inline image size (scale) according
Possible Duplicate: Android: Scale a Drawable or background image? I'd like to make a
I want my transform to scale the image whilst translating it, is it possible
I'm wondering if it's possible to scale an animated GIF image using PIL. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.