Beruflich Dokumente
Kultur Dokumente
connection
dim rsimage as new adodb.recordset
dim strsql as string
redim chunk(chunksize)
for i = 1 to intchunks
get lngdatafile, , chunk()
rsimage!picimage.appendchunk chunk()
next i
'update
rsimage.update
'close file
close lngdatafile
'show pic in picturebox
call showpic
end sub
rsimage.locktype = adlockoptimistic
rsimage.cursortype = adopenkeyset
cnnimage.provider = "microsoft.jet.oledb.4.0"
strsql = app.path & "\image.mdb"
cnnimage.open strsql
filename = "pictemp"
picture1.picture = loadpicture(filename)
end sub
'*********************************************
' this code was designed by ward jaradat
'
' e-mail & msn messanger handler:
' wardgalactica@bluebottle.com
'
' website:
' http://wardgalactica.blogspot.com
'*********************************************
'---------------------------------------------
' this code's purpose is to scan two given
' images' pixels to find out if they were
' identical or not!
'---------------------------------------------
option explicit
' information:
' this code works on 16bpp format for images, actually i would like
' to make some points clear regarding this issue:
'
' ----------------------------------------------------------------------
'
' * rgb 5:5:5 is the default format so its actually 15bpp where the
' top bit is alwayz empty or not used!
'
' * in this format 16bpp, each of the red, green, & blue
' color components is presented by a 5 bit number giving
' 32 different levels of each and 32786 possible different
' colors in total; which means that the true 16bpp would be
' rgb 5:6:5 where there are 65536 possible colors!
'
' * there is no palette used to define the colors for the 16bpp images
' however the red, green, & blue values in the pixel are used to
' define the colors directly!
'
' ----------------------------------------------------------------------
' however if u like to know more about rgb formats u could do some search
' on google or something... :d
'
public function scanpixels(mypic1 as picturebox, mypic2 as picturebox)
dim x as long
dim y as long
' note that the resolution of mypic1 & mypic2 should be identical
if not (mypic1.height = mypic2.height) then
exit function
elseif not (mypic1.width = mypic2.width) then
exit function
end if
pointx = picture1.point(x, y)
pointy = picture2.point(x, y)
result.t = result.t + 1
loop
end function
public function myrgb(byval mypoint as long, red as long, green as long, blue as
long)
g = int(colorvalue / 65536)
b = int((colorvalue - (65536 * g)) / 256)
r = colorvalue - (65536 * g + 256 * b)
' however, just if u wanna know how to get rgb values in the reverse order
' of bytes u could return the value of the following code:
'
' clng(blue + (green * 256) + (red * 65536)
'
' i did truly find that useful in making other functions regarding rgb :d
end function
program 3
option explicit
' date : 05/10/2006.
' time : 08:10:00 pm.
' created by : amr zakaria zaki.
' work's with vb 0.6 and vb 0.5.
' to read picture and convert it to byte's.
' e-mail : amrzakaria73@gmail.com , amrzakaria73@yahoo.com
'***********************************************************************
' 1 = clsimage
' 1 = function , 2 = sub , 3 = property get , 4 = property let
' 1 = convertrgb => function
' private = 0 , public = 1
'-------- my new udt
' regsvr32 c:\windows\system\cam.dll
'? len("00/00/0000") + len("00:00:00") + len(string$(255," " )) +
len("000.000.000.000") + len("32000")+ len("32000")
' picread.paintpicture piccls.image, 0, 0, pic.width + 200, pic.height + 150
'---------------------
private type bitmap
bmtype as long
bmwidth as long
bmheight as long
bmwidthbytes as long
bmplanes as integer
bmbitspixel as integer
bmbits as long
end type
with vdata
.scalemode = vbpixels
.autoredraw = true
.width = 100
.height = 66
' .paintpicture tmppic, 0, 0, 100, 66
end with
''-------------------------
set pobj.ppicture = vdata
pobj.ppicture.scalemode = vbpixels ' i have to use pixel size for video confronc
if readpixels2() <> true then
err.raise 143, "1.4.3", "can not read pixel from image."
end if
'--------------------------
raiseevent clsmsg("1.4.1.3", "object is passed.")
exit property
errgui_picture:
set pobj.ppicture = nothing
raiseevent clserr("1.4.1.3", err.number, err.description)
err.clear
end property
'588 , 297
'c = 0
'c = 9
'c = 10
'c = 17
'c = 18
'c = 271
'c = 272
'c = 286
'c = 287
'c = 291
'c = 292
'c = 296
c = 0
for l = 0 to ubound(pobj.headerbyte)
if l <= 296 then
redim preserve hb(l)
hb(l) = pobj.headerbyte(l)
else
redim preserve db(c)
db(c) = pobj.headerbyte(l)
c = c + 1
end if
' doevents
next l
'--------------------------
if useheader = true then
pobj.header.idate = readbyte_from_to(pobj.headerbyte(), 0, 9)
pobj.header.itime = readbyte_from_to(pobj.headerbyte(), 10, 17)
pobj.header.msg = trim(readbyte_from_to(pobj.headerbyte(), 18, 271))
pobj.header.myip = readbyte_from_to(pobj.headerbyte(), 272, 286)
exit function
errconvertrgb:
convertrgb.bl = 0: convertrgb.gn = 0: convertrgb.rd = 0
raiseevent clserr("1.1.0.1", err.number, err.description)
err.clear
end function
exit function
errinfoaboutme:
infoaboutme = false
erase th()
erase tb()
dim l as integer
dim c as integer
dim tmp() as byte
dim tp as string
' 297
c = 0
' debug.print "c= "; c
for l = 1 to len(vdate)
redim preserve tmp(c)
tmp(c) = cbyte(asc(mid(vdate, l, 1)))
' debug.print tmp(c), chr(tmp(c)), l, len(vdate)
c = c + 1
next l
' debug.print "c= "; c - 1
'--------------------------------------
' debug.print "c= "; c
for l = 1 to len(vtime)
redim preserve tmp(c)
tmp(c) = cbyte(asc(mid(vtime, l, 1)))
' debug.print tmp(c), chr(tmp(c)), l, len(vdate)
c = c + 1
next l
' debug.print "c= "; c - 1
'--------------------------------------
if len(vmsg) < 254 then
vmsg = vmsg & string$((254 - len(vmsg)), " ")
end if
'----
' debug.print "c= "; c
for l = 1 to len(vmsg)
redim preserve tmp(c)
tmp(c) = cbyte(asc(mid(vmsg, l, 1)))
' debug.print tmp(c), l, len(vmsg)
c = c + 1
next l
' debug.print "c= "; c - 1
'--------------------------------------
if len(vmyip) < 15 then
vmyip = vmyip & string$((15 - len(vmyip)), " ")
end if
'----
' debug.print "c= "; c
for l = 1 to len(vmyip)
redim preserve tmp(c)
tmp(c) = cbyte(asc(mid(vmyip, l, 1)))
' debug.print tmp(c), l, len(vmyip)
c = c + 1
next l
' debug.print "c= "; c - 1
'--------------------------------------
tp = cstr(vportdata)
'-----------
if len(tp) < 5 then
tp = string$((5 - len(tp)), "0") & tp
end if
'-----------
' debug.print "c= "; c
for l = 1 to len(tp)
redim preserve tmp(c)
tmp(c) = cbyte(asc(mid(tp, l, 1)))
' debug.print tmp(c), l, len(tp)
c = c + 1
next l
' debug.print "c= "; c - 1
'--------------------------------------
tp = cstr(vportmsg)
'-----------
if len(tp) < 5 then
tp = string$((5 - len(tp)), "0") & tp
end if
'-----------
' debug.print "c= "; c
for l = 1 to len(tp)
redim preserve tmp(c)
tmp(c) = cbyte(asc(mid(tp, l, 1)))
' debug.print tmp(c), l, len(tp)
c = c + 1
next l
' debug.print "c= "; c - 1
udt_to_byte = tmp()
erase tmp()
raiseevent clsmsg("1.1.0.16", "data type's converted to byte's.")
exit function
errudt_to_byte:
redim tmp(0)
udt_to_byte = tmp()
erase tmp()
raiseevent clserr("1.1.0.16", err.number, err.description)
err.clear
end function
errregsvr32_clsimage:
regsvr32_clsimage = false
raiseevent clserr("1.1.1.19", err.number, err.description)
err.clear
end function