473,545 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

view the image in VB

4 New Member
Hi,

I want to view the image in my form. It relates to a combo box. Whenever i change the Form_no in the combo box. The image in the form should change accordingly. And the image viewer should have Scroll bars to view it up and down, left and right. I want to have Shortcut Keys by using Function Keys. I want to zoom in and zoom out the image to view it properly. Is it possible.

If anyone knows the answer please let me know.
Mar 26 '07 #1
5 2305
SammyB
807 Recognized Expert Contributor
Note -- All of the properties below assume that you are using VB.NET. If you are using VB6 or VBA, the property names may not be the same, but the principles are the same.

> I want to view the image in my form.
Use a PictureBox.

>Whenever i change the Form_no in the combo box. The image in the form should change accordingly
Use the PictureBox.Load method

>And the image viewer should have Scroll bars to view it up and down, left and right.
set the Form's AutoScroll property to true

>I want to have Shortcut Keys by using Function Keys
Use the form's KeyPress event & check for the function key.

>I want to zoom in and zoom out
Before you load a picture, set the PictureBox's SizeMode to AutoSize. After loading the picture, save the width & height of the PictureBox. Then to Zoom, set the SizeMode to StretchImage and change the size of the PictureBox (ie double the size for a 2X zoom). The form will automatically create scroll bars if needed (and automatically remove them if you make the form large enough)

>Is it possible.
I did it. HTH --Sam
Mar 26 '07 #2
billaiqur
4 New Member
Hi,

Thanks for your reply. I still seen some difficulties to work on it.

My Question : And the image viewer should have Scroll bars to view it up and down, left and right.
Your Reply: set the Form's AutoScroll property to true
My Ques: I couldn't find any property based on this.

My Ques: I want to have Shortcut Keys by using Function Keys
Your Reply : Use the form's KeyPress event & check for the function key.
My Ques: I tried but i don't know how to do this.

My Ques: I want to zoom in and zoom out
Your Reply: Before you load a picture, set the PictureBox's SizeMode to AutoSize. After loading the picture, save the width & height of the PictureBox. Then to Zoom, set the SizeMode to StretchImage and change the size of the PictureBox (ie double the size for a 2X zoom). The form will automatically create scroll bars if needed (and automatically remove them if you make the form large enough)
My Ques: Still i couldn't get this.

Can you send me some example codes for me which is related to this if possible. So that i can easily got the idea. I send you the code which i did with this mail. Please check it out and alter it if there is a need.

*************** *************** *************** *************** *
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. ConnString = "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=""DSN=MS Access Database;DBQ=" & App.Path & "\bckauto.mdb;DefaultDir=" & App.Path & ";DriverId=25;FIL=MS Access;"""
  3. SQLtwoString = "SELECT tblformname.Form_Name FROM tblformname;"
  4. DbAdo.Open ConnString
  5.     Set RsAdo = DbAdo.Execute(SQLtwoString)
  6.     If RsAdo.BOF = False Or RsAdo.EOF = False Then
  7.     Do While Not RsAdo.EOF
  8.         Me.Form_nobox.AddItem (RsAdo("Form_Name").Value)
  9.         RsAdo.MoveNext
  10.     Loop
  11.     End If
  12.  
  13. End Sub
  14.  
  15. Private Sub Form_nobox_LostFocus()
  16. Form_Picturebox = LoadPicture("F:\Myprojects\Automobile\Images\" & Form_nobox & ".jpg")
  17. End Sub
*************** *************** *************** **************
Mar 31 '07 #3
Killer42
8,435 Recognized Expert Expert
Looks like VB6 - is that right? SammyB was talking about VB.Net, which is different in many ways.

The code looks alright - what problem do you have with it?
Apr 1 '07 #4
billaiqur
4 New Member
Hi,

Yeah this is VB.

I need to know how to Set the Shortcut Key to zoom the image. Please provide me some example code's. Even its VB.net, its ok for me.

In that Code, i load the picture. But i don't know how to use the scroll bar inside the picture box. I can't see any options in the properties of Picture Box. The image is large in size. So we need a scroll to view it.
Apr 1 '07 #5
Killer42
8,435 Recognized Expert Expert
Hi,

Yeah this is VB.

I need to know how to Set the Shortcut Key to zoom the image. Please provide me some example code's. Even its VB.net, its ok for me.

In that Code, i load the picture. But i don't know how to use the scroll bar inside the picture box. I can't see any options in the properties of Picture Box. The image is large in size. So we need a scroll to view it.
I think you can probably ignore most of what SammyB said, because (I believe) he was referring to enhanced capabilities in VB.Net.

I believe the usual technique in VB6 is to place an ImageBox control inside the picture box. Then you load your image into the ImageBox. You zoom and scroll the image by resizing and moving the ImageBox.

Have a play with it - once you've got the concept, it's actually pretty simple to set up.
Apr 1 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2600
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical) stuff. The class will behave like a std::vector (copy constructor and assignment create a deep copy), but with 2D indexing. Now I also need a 'view'...
18
2528
by: Lorem Ipsum | last post by:
interesting! I just found a page in which Explorer's View Source does nothing! How did they do that?
1
2877
by: Kanaiya | last post by:
hello i want to show thumbnail image view control which display captured images on this control but in small size. it is possible to add any no. of images in that control. and aslo possible to add event on it. -- With regards, Gangani Kanaiya.
3
3454
by: Arun | last post by:
Hi, I have simple question to ask. How to write multiple Binary files to the Browser using Asp.Net and Visual C#.net I have seen examples where single binary file is written to browser. -Regards Arun
0
1348
by: | last post by:
We have developed a free image-viewer for testing .Net and GDI+ capabilityes. e-View supports a lot of raster and vectorial image formats: -Bitmap (BMP) -Graphics Interchange Format (GIF) -Joint Photographic Experts Group (JPG) -Portable Network Graphics (PNG) -Tag Image File Format (TIFF)
0
1233
by: beartrax | last post by:
I am using Windows Mobile 2003 SE and trying to change the menu selectable VIEW mode by using javascript or any other programming method within an html page. The menu view modes I would like to be able to change with a page's html code are (VIEW, LAYOUT, DEFAULT) and (VIEW, LAYOUT, DISPLAY) I have one page that displays a large scrollable...
0
2390
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile View I want the form populated from there profile on the sql server. The code to save the profile works fine. But when the user logs back in they data...
0
1476
by: Axeman | last post by:
I have an ASP.NET webapp that needs to view and print several different image formats (JPG, TIFF, BMP, etc.). In addition, it also needs to view/print PDF files. I have successfully implemented the Response.WriteFile(FileName) method to render the various image formats to an Image web control. But, printing this image isn't too slick, as the...
8
4682
by: Arno R | last post by:
Hi all. When I need to search for pictures, I always have too choose thumbnail-view manually. Is it possible to open the common dialog in thumbnail-view programmatically? Example ?? At the moment I am using Ken Getz' code. at http://www.mvps.org/access/api/api0001.htm Thanks Arno R
0
7502
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7692
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7791
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
744
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.