| |

VerySource

 Forgot password?
 Register
Search
View: 1380|Reply: 11

How to output a binary stream of pictures to the CELL of the HtmlTable control?

[Copy link]

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 LAN

Post time: 2020-3-15 21:30:01
| Show all posts |Read mode
I am taking an image from the database and want to output this image to the CELL of the HtmlTable control of the page.
But the following method is to output the picture to the front page. How can I achieve the effect I want, thank you

byteBLOBData = (byte []) ds.Tables [0] .Rows [0] .ItemArray [0];
MemoryStream stmBLOBData = new MemoryStream (byteBLOBData);
System.Drawing.Image image = System.Drawing.Image.FromStream (stmBLOBData, true);
image.Save (Response.OutputStream, ImageFormat.Jpeg);
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-6-15 20:30:01
| Show all posts
There are two pages.
HtmlTable's Cell.Text="<img src='showimages.aspx?id=12313'>";

Another page. showimage.aspx is used to display pictures.

Output bytes
Reply

Use magic Report

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-15 21:15:01
| Show all posts
main page:
<Table><tr><td><img src="b.aspx"></td></tr></table>

b.aspx: Just like what you wrote above.
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 LAN

 Author| Post time: 2020-6-16 14:00:01
| Show all posts
This method is not good
If I want to display dozens of pictures in HtmlTable, should I make dozens of pages?
Reply

Use magic Report

0

Threads

17

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-6-16 14:15:01
| Show all posts
There are two pages.
HtmlTable's Cell.Text="<img src='showimages.aspx?id=12313'>";

Another page. showimage.aspx is used to display pictures.
Response.BinaryWrite() comes out on another page
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-6-16 19:30:02
| Show all posts
If I want to display dozens of pictures in HtmlTable, should I make dozens of pages?
============
showimages.aspx only has one page, it is just called dozens of times
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-16 23:45:01
| Show all posts
Do not need dozens of pages
showimages.aspx?id= Isn't it possible to pass parameters?
Pass different values ​​to display different pictures.
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-17 20:15:01
| Show all posts
Use one page for image output. Then set the img src to this page.
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 LAN

 Author| Post time: 2020-6-18 16:45:01
| Show all posts
Thank you
However, when you save the image in the main page in IE, it saves a showimages.aspx
Instead of pictures, how can this problem be solved?
Reply

Use magic Report

1

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 LAN

 Author| Post time: 2020-7-30 23:30:01
| Show all posts
However, when you save the picture in the main page as in IE, what is saved is a showimages.aspx
Instead of pictures, how can I solve this problem?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list