Re: VB6 create image, save image to memory, send image to asp
- From: DigitalHive@xxxxxxxxx
- Date: 2 May 2007 14:09:35 -0700
On May 1, 11:52 am, DigitalH...@xxxxxxxxx wrote:
On May 1, 11:17 am, DigitalH...@xxxxxxxxx wrote:
in VB xDLL, a picture is generated ( GDI, Device Context, etc ) in a
picture box, then save the picture ( raw data? ) to byte array or
stream, and not to disk. then, send the binary data to the ASP to be
handled, which is Response.BinaryWrite or something.
Forget the bytearray/stream to binary, then raw write. Lets do it this
way.
convert the data in a picturebox to a base64 string. All processing
done in memory, nothing to disk.
Here is the .net solutions, but i need it in VB6....
Public Function BitmapToBase64(ByVal image As System.Drawing.Bitmap)
As String
Dim base64 As String
Dim memory As New System.IO.MemoryStream()
image.Save(memory, Imaging.ImageFormat.Bmp)
base64 = System.Convert.ToBase64String(memory.ToArray)
memory.Close()
memory = Nothing
Return base64
End Function
Public Function BitmapFromBase64(ByVal base64 As String) As
System.Drawing.Bitmap
Dim oBitmap As System.Drawing.Bitmap
Dim memory As New
System.IO.MemoryStream(Convert.FromBase64String(base64))
oBitmap = New System.Drawing.Bitmap(memory)
memory.Close()
memory = Nothing
Return oBitmap
End Function
Ok, I'll make it even more simple.
1. Create a mapped I/O buffer in memory ( binary )
2. Save data in a picturebox or textbox to the buffer.
3. Binary data is converted to base64
4. Read data into a varable, save the varable as a text file on the
local hard disk.
.
- References:
- Re: VB6 create image, save image to memory, send image to asp
- From: DigitalHive
- Re: VB6 create image, save image to memory, send image to asp
- From: DigitalHive
- Re: VB6 create image, save image to memory, send image to asp
- From: DigitalHive
- Re: VB6 create image, save image to memory, send image to asp
- Prev by Date: Re: Controls don't change when tab selected (WM_NOTIFY ???)
- Next by Date: getfocus() to log file?
- Previous by thread: Re: VB6 create image, save image to memory, send image to asp
- Next by thread: Re: CommonDialog to return Directory Path
- Index(es):
Relevant Pages
|