473,386 Members | 1,745 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,386 software developers and data experts.

How to display an image?

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 the image data I want to show and open it
with that file name. No problem about this way. But I don't think it a good
way
Could anybody help me with another solution?
Nov 16 '05 #1
4 4046
Hi Dean,
Create a stream for each image and pass that stream to the Bitmap class'
constructor. I don't know your file format, but if you can't use the
original file stream you probably should create a memory stream then
transfer the image bytes form the file and pass that stream to the Bitmap's
constructor.
"Dean L. Howen" <co*****@hotpop.com> wrote in message
news:eI*************@TK2MSFTNGP15.phx.gbl...
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 the image data I want to show and open it
with that file name. No problem about this way. But I don't think it a
good
way
Could anybody help me with another solution?

Nov 16 '05 #2
Dear Stoitcho Goutsev,
Could I ask one more question?
Q: How could we limite a [stream] just read specific scale in the file
before passing stream to [Bitmap]? As you know, I try to save a "image file"
my file format, so if I pass the stream with no limited, the [Bitmap] could
not read image useful infomation.

For example my file format:

/////////////////////////////////////////
0-255 : Image_name
256-264 : Image_size
265..n : Image_file
/////////////////////////////////////////
(n = 265 + Image_size)

The Bitmap just should read the stream from 265 to n byte. How could we do
that?

Thanks

-------------------------------------------------------
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:uI**************@TK2MSFTNGP11.phx.gbl...
Hi Dean,
Create a stream for each image and pass that stream to the Bitmap class'
constructor. I don't know your file format, but if you can't use the
original file stream you probably should create a memory stream then
transfer the image bytes form the file and pass that stream to the Bitmap's constructor.
"Dean L. Howen" <co*****@hotpop.com> wrote in message
news:eI*************@TK2MSFTNGP15.phx.gbl...
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 the image data I want to show and open it with that file name. No problem about this way. But I don't think it a
good
way
Could anybody help me with another solution?


Nov 16 '05 #3
Hi Dean,

I haven't tested, but I'm pretty sure if you give the Bitmap construcotr a
stream with its pointer set to the 265th byte the bitmap will start reading
form there and will read as many bytes as it needs.
If you read your info part the pointer would be on the right position. If it
is not look at Stream.Seek method.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
"Dean L. Howen" <co*****@hotpop.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Dear Stoitcho Goutsev,
Could I ask one more question?
Q: How could we limite a [stream] just read specific scale in the file
before passing stream to [Bitmap]? As you know, I try to save a "image
file"
my file format, so if I pass the stream with no limited, the [Bitmap]
could
not read image useful infomation.

For example my file format:

/////////////////////////////////////////
0-255 : Image_name
256-264 : Image_size
265..n : Image_file
/////////////////////////////////////////
(n = 265 + Image_size)

The Bitmap just should read the stream from 265 to n byte. How could we do
that?

Thanks

-------------------------------------------------------
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:uI**************@TK2MSFTNGP11.phx.gbl...
Hi Dean,
Create a stream for each image and pass that stream to the Bitmap class'
constructor. I don't know your file format, but if you can't use the
original file stream you probably should create a memory stream then
transfer the image bytes form the file and pass that stream to the

Bitmap's
constructor.
"Dean L. Howen" <co*****@hotpop.com> wrote in message
news:eI*************@TK2MSFTNGP15.phx.gbl...
>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 the image data I want to show and open it > with that file name. No problem about this way. But I don't think it a
> good
> way
> Could anybody help me with another solution?
>
>



Nov 16 '05 #4
Dear Stoitcho Goutsev,
it seems not work.
I try to append the existing image file with some bytes, it still works, but
not if I add some byte in the header although I have seek to the right
position

---------------------------------------------------------

"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:#S*************@TK2MSFTNGP11.phx.gbl...
Hi Dean,

I haven't tested, but I'm pretty sure if you give the Bitmap construcotr a
stream with its pointer set to the 265th byte the bitmap will start reading form there and will read as many bytes as it needs.
If you read your info part the pointer would be on the right position. If it is not look at Stream.Seek method.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
"Dean L. Howen" <co*****@hotpop.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Dear Stoitcho Goutsev,
Could I ask one more question?
Q: How could we limite a [stream] just read specific scale in the file
before passing stream to [Bitmap]? As you know, I try to save a "image
file"
my file format, so if I pass the stream with no limited, the [Bitmap]
could
not read image useful infomation.

For example my file format:

/////////////////////////////////////////
0-255 : Image_name
256-264 : Image_size
265..n : Image_file
/////////////////////////////////////////
(n = 265 + Image_size)

The Bitmap just should read the stream from 265 to n byte. How could we do that?

Thanks

-------------------------------------------------------
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:uI**************@TK2MSFTNGP11.phx.gbl...
Hi Dean,
Create a stream for each image and pass that stream to the Bitmap class' constructor. I don't know your file format, but if you can't use the
original file stream you probably should create a memory stream then
transfer the image bytes form the file and pass that stream to the

Bitmap's
constructor.
"Dean L. Howen" <co*****@hotpop.com> wrote in message
news:eI*************@TK2MSFTNGP15.phx.gbl...
>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 the image data I want to show and open
it
> with that file name. No problem about this way. But I don't think it

a > good
> way
> Could anybody help me with another solution?
>
>



Nov 16 '05 #5

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

Similar topics

2
by: Tyrone Slothrop | last post by:
I am coding a site which involves uploading images. All of the PHP and display is OK but the client wants to be able to display the image thumbnail on the upload page and show the full image on...
4
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
4
by: DoomedLung | last post by:
I have been developing an image gallery which needed to be dynamic as possible. so I have placed the gallery in a div plus a div containing the large image to be displayed. It works by changing...
3
by: DoomedLung | last post by:
I have been developing an image gallery which needed to be dynamic as possible. so I have placed the gallery in a div plus a div containing the large image to be displayed. It works by changing...
3
by: den 2005 | last post by:
Hi everyone, Here is code working on..Trying to insert record with a column with Image or VarBinary datatype in sql database from a existing jpeg image file, then retrieve this image from...
3
by: c676228 | last post by:
Hi everyone, I have a piece of code in sales.aspx.vb like this: Protected WithEvents Message As System.Web.UI.WebControls.Label Try ... ChartImage.ImageUrl = "ChartGenerator.aspx?" + DataStr +...
0
by: adubra | last post by:
Hi there, I am using a device context (DC) and a buffer to successfully draw to screen. However, when I update the DC at very high frame rate and drag the frame containing the image very quickly...
1
by: nanaalwi | last post by:
Hi, Currently I'm developing a software using VB.net that can grab an image using Matrox Morphis card and display it in a PictureBox. The software can grab the image already and display it in the...
1
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.