CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Posts
    60

    Visual Basic Menus

    Hi, i've created a visual basic application program. I've include menus such as file, edit, setup, measure1, measure2, measure3, view, clip, help. Under the file menu, i have sub menus such as open image, save image...etc. Can i know how to write the vb codes for opening image files and saving image files.

    Under the measure menus, i have submenus like median filter and averaging filter. Can i know how to write codes for both of that?
    Please help me. Thanks alot!

    Regards,
    Michelle


  2. #2
    Join Date
    May 2001
    Location
    Russia
    Posts
    200

    Re: Visual Basic Menus

    Maybe you can help Image or Picture control?

    Andy Tower

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Visual Basic Menus

    To save picture to DB

    Const MAX_PATH = 255
    private Const CHUNK_SIZE = 1000
    private Declare Function GetTempPath Lib "kernel32" _
    Alias "GetTempPathA" (byval nBufferLength as Long, _byval lpBuffer as string) as Long
    public Function SavePictureToDB(PictControl as Object, _
    RS as Object, FieldName as string) as Boolean

    'PURPOSE: SAVES PICTURE IN IMAGEBOX, PICTUREBOX, OR SIMILAR
    'CONTROL to RECORDSET RS IN FIELD NAME FIELDNAME
    'FIELD TYPE MUST BE binary (OLE OBJECT IN ACCESS)

    'SAMPLE USAGE
    'Dim sConn as string
    'Dim oConn as new ADODB.Connection
    'Dim oRs as new ADODB.Recordset''
    'sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.MDB;Persist Security Info=false"'
    'oConn.Open sConn
    'oRs.Open "SELECT * FROM MYTABLE", oConn, adOpenKeyset, _
    adLockOptimistic
    'oRs.AddNew
    'SavePictureToDB Picture1, oRs, "MYFIELD"
    'oRs.Update
    'oRs.Close


    'To load picture from DB
    public Function LoadPictureFromDB(PictControl as Object, _
    RS as Object, FieldName as string) as Boolean
    'PURPOSE: LOADS PICTURE, SAVED as binary DATA IN RECORDSET RS,
    'FIELD FieldName to PICTUREBOX, IMAGEBOX (OR CONTROL'WITH SIMILAR INTERFACE)

    'SAMPLE USAGE
    'Dim sConn as string
    'Dim oConn as new ADODB.Connection
    'Dim oRs as new ADODB.Recordset'
    ''sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDb.MDB;Persist Security Info=false"'
    'oConn.Open sConn'oRs.Open "SELECT * FROM MyTable", oConn, adOpenKeyset, adLockOptimistic
    'LoadPictureFromDB Picture1, oRs, "MyFieldName"
    'oRs.Close

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured