Re: VB6 create image, save image to memory, send image to asp

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.

.



Relevant Pages

  • Re: Rapid gfx display Qs
    ... 1280x720 BMP files into a picture box with autoredraw off. ... disk into memory because ... However, if I do this for 2000 random images in a row, the ...
    (microsoft.public.vb.general.discussion)
  • Re: Vista BSOD
    ... Nothing to take a picture of. ... My 20" intel iMac simply locked up, ... Crucial memory in, instead of Apple? ... written to disk, it would theoretically be stored in the dump file. ...
    (comp.sys.mac.advocacy)
  • Not enough memory to display pictures.
    ... I keep getting a error message saying there is not enough memory or disk ... space to display some picture in my document. ...
    (microsoft.public.word.docmanagement)
  • Proposed Assembler Commands
    ... ACM Automatically Clear Memory ... BKCRDR Backspace Card Reader ... BKSPD Backspace Disk ... EIAO Execute In Any Order ...
    (sci.electronics.design)
  • Re: Att. Alex Nichol -VM cont.
    ... I find documentation that says a 4kb page in memory is written to the hard ... manner that a 4kb memory page is equal to a 4kb cluster written on the disk". ... So where is the basis for saying since 4kb paging in memory that 4kb clusters ...
    (microsoft.public.windowsxp.general)