Click to See Complete Forum and Search --> : Visual Basic Menus


erikoler
August 18th, 2001, 01:29 AM
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

Tower
August 19th, 2001, 10:59 PM
Maybe you can help Image or Picture control?

Iouri
August 20th, 2001, 07:07 AM
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
iouri@hotsheet.com