473,474 Members | 1,310 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

vb6 program like windows picture and fax viewer..help

228 New Member
happy new year to you all,

i have a program that views pictures. The pictures could have different sizes. Some are bigger than the screen size, some are smaller than that. I want to display the entire content of the picture in image control or picture control like windows pic and fax viewer does:

i tried this but it failed to work:

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Private Sub Form_Load()
  3. Dim scrw As Double
  4. Dim scrh As Double
  5. Dim imgw As Double
  6. Dim imgh As Double
  7.  
  8. scrw = Screen.Width / Screen.TwipsPerPixelX
  9. scrh = Screen.Height / Screen.TwipsPerPixelY
  10.  
  11. imgw = Image1.Width / 15
  12. imgh = Image1.Height / 15
  13.  
  14. MsgBox Image1.Width
  15.  
  16. If imgw > scrw Then
  17. Image1.Width = Screen.Width
  18.  
  19. Me.Move 0, 0
  20. Else
  21. Me.Width = Image1.Width
  22. End If
  23.  
  24. If imgh > scrh Then
  25. Image1.Height = Screen.Height
  26.  
  27. Me.Move 0, 0
  28. Else
  29. Me.Height = Image1.Height
  30. End If
  31.  
  32. Me.Width = Image1.Width
  33. Me.Height = Image1.Height
  34. Me.Top = 0
  35. Me.Left = 0
  36. End Sub
  37. Private Sub Image1_Click()
  38. Unload Me
  39. End Sub
  40.  
  41.  
NB: picture is added to image1 from database application.
Jan 3 '11 #1
2 2395
debasisdas
8,127 Recognized Expert Expert
your code never refers to the source of the image !
Jan 4 '11 #2
samvb
228 New Member
what do you mean? please clarify a lil bit.
Jan 4 '11 #3

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

Similar topics

2
by: ~dr-sci-fi | last post by:
hi all, i want to use "Windows Picture Viewer and Fax Viewer" in my c# app to manipulate images, picture viewer is found as a DLL (shimgvw.dll) in System32 folder of WinXP. can some one tell...
4
by: Dean Poling | last post by:
Hello, all... I am attempting to write a managed c++ dll that will open a crystal report in the windows form viewer. For various reasons, I need to be able to write this in C++ w/MFC as opposed...
1
by: Dean Poling | last post by:
Hi, all... I posted this in the Crystal Decisions user forums with no solution, so here goes: I have created a managed c++ dll that contains a crystal reports viewer constructed with the...
5
by: Dean Slindee | last post by:
I have looked everywhere I can think of for the .exe name of the Windows Picture and Fax Viewer. Anybody know what it's named? Thanks, Dean Slindee
0
by: dr | last post by:
Is there any activex or .net control for embedding the Windows Picture and Fax Viewer into my application?
1
by: james 125877 | last post by:
Hi ! I tried compiling my script and it comes up with an error: The type or namespace name 'fclsViewer' could not be found (are you missing a using directive or an assembly reference? and...
1
by: BHEEMA VAMSHI KRISHNA | last post by:
HI to everyone I got a small problem here actually i am opening one image D:\x.jpg in one window using windows picture and fax viewer. whenever i overwrite d:\x.jpg with c:\x.jpg it using...
1
by: selvaraman | last post by:
I need to Open an Image via Windows Fax Viewer. I have tried with the following types of codes. But, None of them giving the answer. iOpenImageResult = ShellExecute(0&, "open", "mspview",...
0
by: John Shaw | last post by:
Is there a way to see if Windows Picture and Fax Viewer is running in C#? I don't know the process name . I have tried the following : processes = Process.GetProcessesByName(procName); I need...
10
by: aeris | last post by:
Hello, sorry for disturbing. I have a pictureBox on my form. May i know how to open the image from the pictureBox in Windows Picture and Fax Viewer? I've tried the code below, but it failed...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
1
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...
0
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...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.