-
September 29th, 2000, 08:53 PM
#16
Re: i have a lib can help you
Could you send me the AxtiveX... to convert any image to another
Thanks
qualite@broadband.hu
TZs
-
February 4th, 2002, 02:19 PM
#17
Re: i have a lib can help you
Can you please send it to me too at
mitikavuma@hotmail.com
Thanks
-
February 4th, 2002, 02:33 PM
#18
Re: Convert Graphics Format
Convert BMP to JPG with this code. (Note: Requires vic32.dll available from
http://www.catenary.com/)
Code:
'PLACE ALL THIS IN A new MODULE
Const NO_ERROR=0
Declare Function bmpinfo Lib "VIC32.DLL" (byval Fname as string, bdat as BITMAPINFOHEADER) as Long
Declare Function allocimage Lib "VIC32.DLL" (image as imgdes, byval wid as Long, byval leng as Long, byval BPPixel as Long) as Long
Declare Function loadbmp Lib "VIC32.DLL" (byval Fname as string, desimg as imgdes) as Long
Declare Sub freeimage Lib "VIC32.DLL" (image as imgdes)
Declare Function convert1bitto8bit Lib "VIC32.DLL" (srcimg as imgdes, desimg as imgdes) as Long
Declare Sub copyimgdes Lib "VIC32.DLL" (srcimg as imgdes, desimg as imgdes)
Declare Function savejpg Lib "VIC32.DLL" (byval Fname as string, srcimg as imgdes, byval quality as Long) as Long
' Image descriptor
Type imgdes
ibuff as Long
stx as Long
sty as Long
endx as Long
endy as Long
buffwidth as Long
palette as Long
colors as Long
imgtype as Long
bmh as Long
hBitmap as Long
End Type
Type BITMAPINFOHEADER
biSize as Long
biWidth as Long
biHeight as Long
biPlanes as Integer
biBitCount as Integer
biCompression as Long
biSizeImage as Long
biXPelsPerMeter as Long
biYPelsPerMeter as Long
biClrUsed as Long
biClrImportant as Long
End Type
'PLACE THIS IN YOUR FORM DECLERATIONS
private Sub ConvertToJPEG(bmp_fname as string, jpg_fname as string, optional quality as Long)
Dim tmpimage as imgdes ' Image descriptors
Dim tmp2image as imgdes
Dim rcode as Long
'Dim quality as Long
Dim vbitcount as Long
Dim bdat as BITMAPINFOHEADER ' Reserve space for BMP struct
'Dim bmp_fname as string
'Dim jpg_fname as string
'bmp_fname = "test.bmp"
'jpg_fname = "test.jpg"
If quality = 0 then quality = 75
' get info on the file we're to load
rcode = bmpinfo(bmp_fname, bdat)
If (rcode <> NO_ERROR) then
msgbox "error: Unable to get file info"
Exit Sub
End If
vbitcount = bdat.biBitCount
If (vbitcount >= 16) then ' 16-, 24-, or 32-bit image is loaded into 24-bit buffer
vbitcount = 24
End If
' Allocate space for an image
rcode = allocimage(tmpimage, bdat.biWidth, bdat.biHeight, vbitcount)
If (rcode <> NO_ERROR) then
msgbox "error: Not enough memory"
Exit Sub
End If
' Load image
rcode = loadbmp(bmp_fname, tmpimage)
If (rcode <> NO_ERROR) then
freeimage tmpimage ' Free image on error
msgbox "error: Cannot load file"
Exit Sub
End If
If (vbitcount = 1) then ' If we loaded a 1-bit image, convert to 8-bit grayscale
' because jpeg only supports 8-bit grayscale or 24-bit color images
rcode = allocimage(tmp2image, bdat.biWidth, bdat.biHeight, 8)
If (rcode = NO_ERROR) then
rcode = convert1bitto8bit(tmpimage, tmp2image)
freeimage tmpimage ' Replace 1-bit image with grayscale image
copyimgdes tmp2image, tmpimage
End If
End If
' Save image
rcode = savejpg(jpg_fname, tmpimage, quality)
freeimage tmpimage
Kill bmp_fname
msgbox "picture saved: " & jpg_fname
Iouri Boutchkine
iouri@hotsheet.com
Last edited by Cimperiali; December 11th, 2003 at 10:08 AM.
-
December 11th, 2003, 09:43 AM
#19
I have a lib that can help you
Can you please send me the ActiveX as I don't have Delphi.
Many thanx
-
December 11th, 2003, 09:43 AM
#20
I have a lib that can help you
Can you please send me the ActiveX as I don't have Delphi.
Many thanx
-
December 11th, 2003, 10:04 AM
#21
To enielezi
enielezi:
you should email (or send a private message) to kingwgl or to any other that asked for it, not post a new thread all alone in vb forum with a request that seems really cryptic if not related to this thread...
Regards,
Cesare I.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
May 17th, 2005, 04:22 PM
#22
Re: i have a lib can help you
Originally Posted by Surrendermonkey
Two words and a URL will solve all your woes.
Twisted Pixel.
(bananasoft.tripod.com)
I heartily recommend it, and rest assured I am not connected in any way commercially or otherwise blah blah etc.
how reliable is it ? It doesn't seem to be very well known.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|