473,320 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

creat image from stream.

I have a bimap picuture saved in an access file. the table column type is
OLE object. In VB.Net I am trying to load this image and show it on the
form. I use following code.

Dim pitbyte() As Byte

pitbyte = drCurrent("pic")

Debug.WriteLine(drCurrent("pic"))

Dim ms As MemoryStream = New MemoryStream(pitbyte)

Dim streamedBitmap As Bitmap

streamedBitmap = Bitmap.FromStream(ms) '******** this line cause problem

Me.methodpic.Image = streamedBitmap

then"An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll

Additional information: Invalid parameter used."

Could anybody tell me why I get Invalid parameter used exception?
Nov 21 '05 #1
3 1349
David,

No guarantees, however you can try this one.
\\\
Dim ms As MemoryStream = New MemoryStream(pitbyte, 78, pitbyte.Length-78)
///
I hope this helps?

Cor
Nov 21 '05 #2
I tried. It still doesnot work
have you encount same problem?
"Cor Ligthert" <no************@planet.nl> wrote in message
news:#W**************@TK2MSFTNGP12.phx.gbl...
David,

No guarantees, however you can try this one.
\\\
Dim ms As MemoryStream = New MemoryStream(pitbyte, 78, pitbyte.Length-78)
///
I hope this helps?

Cor

Nov 21 '05 #3
David,

AFAIK It seems that there are 2 Ole formats and a normal format of a blob.
You used the normal and 1 of the OLe's now, I do not know the thirth

Cor
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: CanyonJ | last post by:
I've been running into a frustrating problem for a while now. I use image.FromStream to open a tif, then perform some drawstring methods, and then save the file again. The tiffs are in 1 bit per...
1
by: John Scott | last post by:
I am storing an image in an SQL database and have one field as an image datatype. I am also using a webservice to transport data. I want to be able to resize the image and pass back a thumbnail...
4
by: Dean L. Howen | last post by:
I create my own file format that could content many image files (jpg, ico, ....) . I can get the data of each image, and I want to display it on the form. How can? I've tried to create a file with...
7
by: Robert W. | last post by:
I think I'm going insane, but thought I'd check with you all first before I get myself commited! Here's a method I've built to retrieve an image: public static Image GetImage(string...
1
by: Fahad Aijaz | last post by:
Hi, I am trying to display a Png image via ASP .NET. I get the image from the stream, creates the Bitmap, set the content type to Image/Png, but it give an error. If I set the content type to...
9
by: Tom John | last post by:
Hi I am storing images in an access database, based on an MSDN article. The code i use to store is as follows: <code> 'Create the command object Dim command As New...
4
by: Michael C | last post by:
It seems that no matter how I load a bitmap into memory it remains attached to whatever I used to create it. If I obtained the bitmap from a file the file stays locked or if it came from a stream I...
4
by: Lopamudra | last post by:
Hi, I am displaying thumbnails of images in the way Google does in its Image Search. i.e along with the details on the image height, width, size in KB and file type. I am using a http handler...
2
by: Adam Teale | last post by:
hey guys Is there a builtin/standard install method in python for retrieving or finding out an image's dimensions? A quick google found me this:...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.