Solved

Wang Thumbnail Control

Posted on 2000-02-21
11
610 Views
Last Modified: 2011-09-20
I'm new in VB so please bear with me.
How can I populate Wang THumbnail Control? I can't seem to find the right PEM for it.

Thanks,
T50105
0
Comment
Question by:T50105
  • 3
  • 3
  • 3
  • +2
11 Comments
 
LVL 1

Expert Comment

by:georgeman
Comment Utility
Just add Wang Thumbnail OCX control in your project from Project/Components/Wang Image Thumbnail Control

add line in form_load event:
ImgThumbnail1.Image = "C:\My.tif"
 and will all pages of my.tif file if it multiple page.

Good luck
George
0
 

Expert Comment

by:Geo24
Comment Utility
0
 

Author Comment

by:T50105
Comment Utility
I already have similar line in form load like:
thumbnail1.image = "vtools.bmp".
It works for that image but I have more than one image to display, How can I populate with more images in one page?
0
 
LVL 4

Accepted Solution

by:
wqw earned 200 total points
Comment Utility
Use Control Array. In your form select Wang Control and find property Index. Type 0. Set Visible to false.

Sub Form_Load()
    Dim i as long, aNames() as String
    'populate aNames e.g. Dir("*.bmp")
    For i = 0 to 25
        Load WangControl(i+1)
        With WangControl(i+1)
            .Move 500*Fix(i/5), 500*(i Mod 5)
            .Image = aImages(i)
            .Visible = True
        End With
    Next
End Sub

This way you get 25 images on your form. Experiment further with placement, etc!

</wqw>
0
 
LVL 4

Expert Comment

by:wqw
Comment Utility
ooops,
shoud be:

            .Move 500*Fix(i/5), 500*(i Mod 5), 500, 500

to resize it properly

</wqw>
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 4

Expert Comment

by:wqw
Comment Utility
ooops,
shoud be:

            .Move 500*Fix(i/5), 500*(i Mod 5), 500, 500

to resize it properly

</wqw>
0
 
LVL 1

Expert Comment

by:georgeman
Comment Utility
T50105
I tested this code.
Just create new project, add form1, add ImgEdit1, ImgAdmin1, ImgThumbnail1, Command1 controls, place code below in Command1_Click event.
You can populate so many different type of images in Thumbnail control as you need.
Good luck
George

Private Sub Command1_Click()
'
'Load first image
 ImgEdit1.Image = App.Path & "\beany.bmp"
 ImgEdit1.Display
 
'Save 1st image as tiff file so it can be used for multiple image storage
 ImgEdit1.SaveAs App.Path & "\beany.tif", 1

'open saved tiff file
 ImgAdmin1.Image = App.Path & "\beany.tif"
 
'add new image
 ImgAdmin1.Insert App.Path & "\bell.bmp", 1, 1, 1

'add new image how many you need
 ImgAdmin1.Insert App.Path & "\balloon.bmp", 1, 1, 1
' ImgAdmin1.Insert App.Path & "\new1.bmp", 1, 1, 1
' ImgAdmin1.Insert App.Path & "\new2.bmp", 1, 1, 1
' etc.

'show multiple image in thumbnails control
 ImgThumbnail1.Image = ImgAdmin1.Image
'
End Sub


0
 

Author Comment

by:T50105
Comment Utility
Adjusted points to 200
0
 

Author Comment

by:T50105
Comment Utility
georgeman.
Thank you for your time.
0
 

Expert Comment

by:GETTYD
Comment Utility
Georgeman got it right!

You can only show about 40 thumbnails using wqw's method before you run out of memory on a 400MHz, 64Mb machine.

(wqw's method is much faster though, for only a few images)

Any response?
0
 
LVL 1

Expert Comment

by:georgeman
Comment Utility
Thanks GETTYD
You are exactly right
Regards
George
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now