This is a discussion on Advanced Programming in Visual Basic 6.0 within the VB.NET Programming forums, part of the Software Development category; About Microsoft Windows Image Acquisition Automation Layer The Microsoft Windows - Image Acquisition (WIA) Automation Layer version 2.0 is a ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| About Microsoft Windows Image Acquisition Automation Layer The Microsoft Windows - Image Acquisition (WIA) Automation Layer version 2.0 is a high-quality, full-featured image manipulation component that provides end-to-end image processing capabilities for Microsoft Visual Basic® 6.0, Active Server Pages (ASP), and scripting languages. The WIA Automation Layer exposes features in Windows XP Service Pack 1 or later to make it easy to acquire images on digital cameras, scanners, or web cameras, and to rotate, scale, and annotate your image files. Earlier versions of Windows are not supported. Other new features include the ability to:
Follow the steps to make use of WIA
Dim pic As ImageFile While (prcs.Filters.Count > 0) prcs.Filters.Remove 1 Wend prcs.Filters.Add prcs.FilterInfos("RotateFlip").FilterID thanks
__________________ Karpagarajan. R Necessity is the mother of invention |
| Sponsored Links |
| |||
| Visual Basic 6.0 is very good development tool for windows applications. I am very much interested in doing system oriented programming in VB. For system operations, we should be aware of Windows API’s(Application Programming Interface). The API is nothing but, we can use the system functions by simply calling the functions from the system dlls. I have given the following API and the windows system dll GetVersionEx - kernel32.dll I have given the following example to make use of API functions in VB How to get the Windows version Example : Place the following code in the form declaration part Option Explicit Private Type OSVERSIONINFO ' 148 bytes dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 End Type Private Declare Function GetVersionEx Lib "kernel32" Alias _ "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long Place the following code in the form command1 click event Dim os_Version As OSVERSIONINFO Dim nWinOsMajorVersion As Long, nWinOsMinorVersion As Long Dim nWinOsBuild As Long, sWinOs As String os_Version.dwOSVersionInfoSize = 148 Call GetVersionEx&(os_Version) nWinOsMajorVersion = os_Version.dwMajorVersion nWinOsMinorVersion = os_Version.dwMinorVersion nWinOsBuild = os_Version.dwBuildNumber Select Case nWinOsMajorVersion Case 4: 'Could be Windows 95, 98, ME or NT 4 If nWinOsBuild = 1381 Then sWinOs = "Windows NT 4" Else Select Case nWinOsMinorVersion Case Is < 10: sWinOs = "Windows 95" Case Is < 90: sWinOs = "Windows 98" Case Else: sWinOs = "Windows ME" End Select End If Case 5: 'Could be Windows 2000, XP, 2003 Select Case nWinOsMinorVersion Case Is < 1: sWinOs = "Windows 2000" Case Is < 2: sWinOs = "Windows XP" Case Else: sWinOs = "Windows 2003 Server" End Select End Select Print sWinOs thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
| |||
| GDI+ in Visual Basic 6.0 About GDI+ Purpose Microsoft Windows GDI+ is a class-based API for C/C++ programmers. It enables applications to use graphics and formatted text on both the video display and the printer. Applications based on the Microsoft Win32 API do not access graphics hardware directly. Instead, GDI+ interacts with device drivers on behalf of applications. GDI+ is also supported by Microsoft Win64. Where Applicable GDI+ can be used in all Windows-based applications. GDI+ is new technology that is included in Windows XP and the Windows Server 2003. It is required as a redistributable for applications that run on the Microsoft Windows NT 4.0 SP6, Windows 2000, Windows 98, and Windows Millennium Edition (Windows Me) operating systems. Developer Audience The GDI+ C++ class-based interface is designed for use by C/C++ programmers. Familiarity with the Windows graphical user interface and message-driven architecture is required. Here we can use the GDI+ API in Visual Basic also. I have given the sample program to load a picture through GDI+. Run-time Requirements Gdiplus.dll is included with Windows XP. For information about which operating systems are required to use a particular class or method, see the More Information section of the documentation for the class or method. GDI+ is available as a redistributable for Windows NT 4.0 SP6, Windows 2000, Windows 98, and Windows Me. Before start working on GDI+. We must do the following things properly • Start the Gdiplus Session by calling GdiplusStartup API • Donot forget to shutdown the GDI+ in application exit/close by simply calling the GdiplusShutdown Declare the following APIs in your General declaration part in VB6. Option Explicit Private Type GdiplusStartupInput GdiplusVersion As Long DebugEventCallback As Long SuppressBackgroundThread As Long SuppressExternalCodecs As Long End Type 'This function is used to start the GDI+ session Private Declare Function GdiplusStartup Lib "gdiplus" ( ByRef rToken As Long, ByRef rInput As GdiplusStartupInput, ByRef pvOutput As Any) As Long 'This function is used to close the GDI+ session Private Declare Sub GdiplusShutdown Lib "gdiplus" ( ByVal Token As Long) 'To load the Image to the picture1 Private Declare Function GdipLoadImageFromStream Lib "gdiplus" ( ByVal pStream As IUnknown, ByRef rImage As Long) As Long 'To Clear the image from the memory Private Declare Function GdipDisposeImage Lib "gdiplus" ( ByVal pImage As Long) As Long 'Create the hdc for the picture1 Private Declare Function GdipCreateFromHDC Lib "gdiplus" ( ByVal hDC As Long, ByRef rGraphics As Long) As Long 'Delete the picture hdc from the memory Private Declare Function GdipDeleteGraphics Lib "gdiplus" ( ByVal pGraphics As Long) As Long 'Load the image to picture1 Private Declare Function GdipDrawImage Lib "gdiplus" ( ByVal pGraphics As Long, ByVal pImage As Long, ByVal X As Single, ByVal Y As Single) As Long 'Create the image from the image data Private Declare Function CreateStreamOnHGlobal Lib "ole32" ( ByRef hGlobal As Any, ByVal fDeleteOnRelease As Long, ByRef ppStream As IUnknown) As Long 'To Store the image file data as binary for creating the GDI+ image handle Private m_ImageData() As Byte Private m_GdipSession As Long Private m_GdipImage As Long 'Loading the sample image to the picture box using GDI+ Private Sub Command1_Click() Dim sFilename As String Dim hFile As Integer Dim iImageStream As IUnknown sFilename = "samplefile.JPG" hFile = FreeFile Open sFilename For Binary Access Read Shared As #hFile ReDim m_ImageData(0 To LOF(hFile) - 1) Get #hFile, , m_ImageData Close #hFile If (CreateStreamOnHGlobal(m_ImageData(0), 0, iImageStream) = 0) Then If (GdipLoadImageFromStream(iImageStream, m_GdipImage) <> 0) Then Debug.Print "Couldn't Load Image" End If Set iImageStream = Nothing End If LoadPic Picture1 End Sub 'Start GDI+ session Private Sub Form_Initialize() Dim tGdiplusStartupInput As GdiplusStartupInput With tGdiplusStartupInput .GdiplusVersion = 1 .DebugEventCallback = 0 .SuppressBackgroundThread = 0 .SuppressExternalCodecs = 1 End With If (GdiplusStartup(m_GdipSession, tGdiplusStartupInput, ByVal 0&) <> 0) Then Debug.Print "GDI+ Initialization Failed" End If End Sub 'Load picture function for loading image by GDI+ API Private Sub LoadPic(picCtrl As PictureBox) Dim pGraphics As Long If (GdipCreateFromHDC(picCtrl.hDC, pGraphics) = 0) Then GdipDrawImage pGraphics, m_GdipImage, 20, 20 GdipDeleteGraphics pGraphics End If End Sub 'Unload the image from memory Private Sub Form_Unload(Cancel As Integer) If (m_GdipImage) Then GdipDisposeImage m_GdipImage End If End Sub 'Shutdown the GDI+ session Private Sub Form_Terminate() If (m_GdipSession) Then GdiplusShutdown m_GdipSession End If End Sub thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
| |||
| Multithreadded Programming In VB6 Hi Here I am going to give technics about how to implement the multi threadding in VB6. It is not easy to implement the multi threadding in Visual Basic. You can implement the multi threadding by using Timer controls. But for that you have to maintain flags to separate the process and also it will be a tedious work.thanks
__________________ Karpagarajan. R Necessity is the mother of invention |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/vb-net-programming/528-advanced-programming-visual-basic-6-0-a.html | |||
| Posted By | For | Type | Date |
| Digg / Programming / Upcoming | This thread | Refback | 07-20-2007 06:58 AM |
| Digg / Programming / Upcoming | This thread | Refback | 07-20-2007 04:20 AM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Difference of Visual Basic over a VB.net | chocoguy | VB.NET Programming | 1 | 08-06-2008 03:56 AM |
| Visual Basic | chocoguy | Other Web Programming Languages | 2 | 01-10-2008 05:16 PM |
| What is the difference between Windows programming and database programming? | Arun | VB.NET Programming | 0 | 07-18-2007 08:58 AM |
| HTML Basic Programming | spid4r | HTML, CSS and Javascript Coding Techniques | 2 | 04-23-2007 08:19 AM |
| Visual Basic At The Movies | Gopisoft | VB.NET Programming | 1 | 03-05-2007 10:58 AM |