Click here to Skip to main content
12,752,448 members (38,053 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB6
I have created a program which is more on loading an image. I have already finish my program but I have still a problem in running my program. My program is too slow because of large images.
I try this code to make the images lighter but it doesn't work.
Public Sub LoadImage(ByVal imgName As String)
    With Entry1
        .imgView.ScrollBars = SB_Both
        .imgView.ViewUpdate = True
        .imgView.ToolSet TOOL_Hand, IXMOUSEBUTTON_Left, 0
        .imgView.PageNbr = imgPage
        .imgView.fileName = imgPath & imgName
        .imgView.IResX = 300
        .imgView.IResY = 300
        '.imgView.AutoSize = ISIZE_ResizeImage
        .imgView.ZoomToFit ZOOMFIT_BEST
    End With
End Sub

Is there any way to make the images lighter? or to resize an image?
Any help will be accepted.
Posted 4-May-13 9:12am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you use Image control[^], you can use simply trick from:[^]
' Load a bitmap.
Image1.Stretch = False
Image1.Picture = LoadPicture("c:\windows\setup.bmp")
' Reduce it by a factor of two.
Image1.Stretch = True
Image1.Move 0, 0, Image1.Width / 2, Image1.Width / 2

Another way to increase performance, is to use AutoRedraw property.
Image1.AutoRedraw = True 'False

For PictureBox control, refer this:[^]
Picture1.AutoSize = True 'False

Have a look here:[^][^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 5 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100