| |

VerySource

 Forgot password?
 Register
Search
View: 1420|Reply: 15

How does Solve Image display pictures in memory?

[Copy link]

2

Threads

22

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-1-9 12:40:01
| Show all posts |Read mode
Brothers, in the .NET WEB program, how does the Image control display pictures in memory because the pictures are encrypted and decrypted in memory. Or there are other good solutions, thank you!
Reply

Use magic Report

2

Threads

22

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

 Author| Post time: 2020-1-13 17:00:01
| Show all posts
Where have all the masters gone?
Reply

Use magic Report

3

Threads

29

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-1-14 14:00:01
| Show all posts
Image's ImageUrl is connected to an a.aspx.
A.aspx's Page_Load uses Response.BinaryWrite (bys); where bys is the byte sequence of the image in memory.

It should be noted that you need to save the decrypted picture as a memory file and then take the bytes, that is, the bytes of the memory file are exactly the same as the bytes of the hard disk file we usually use.

By the way, what's the use of such encryption? The client is Base64, and it can be restored as a memory file after testing it out.
Reply

Use magic Report

0

Threads

21

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 United States

Post time: 2020-1-23 10:36:01
| Show all posts
create a memory stream from byte [], and pass the stream to the image
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-1-23 11:27:01
| Show all posts
byte [] bytes = null; //
// At this time, the code to get bytes
System.IO.MemoryStream ms = new System.IO.MemoryStream ();
ms.Write (bytes, 0, bytes.Length);
Bitmap bmp = new Bitmap (ms);
bmp.Save (Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
Reply

Use magic Report

2

Threads

22

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

 Author| Post time: 2020-1-24 16:18:02
| Show all posts
I have tried all these methods, thanks!
Reply

Use magic Report

2

Threads

22

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

 Author| Post time: 2020-1-24 17:27:01
| Show all posts
But I want to display the picture on the Image control or ImageButton, not directly output to the webpage, because I also want to layout and display many small pictures, and then click on the small picture to zoom in.
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-1-24 23:27:01
| Show all posts
But I want to display the picture on the Image control or ImageButton, not directly output to the webpage, because I also want to layout and display many small pictures, and then click on the small picture to zoom in.
=====================

If you don't want to save it on the hard disk, make a separate page and display the picture

<img src = "showimg.aspx">

Write in showimg.aspx

byte [] bytes = null; //
// this time
Get bytes code
System.IO.MemoryStream ms = new System.IO.MemoryStream ();
ms.Write (bytes, 0, bytes.Length);
Bitmap bmp = new Bitmap (ms);
bmp.Save (Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
Reply

Use magic Report

2

Threads

22

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

 Author| Post time: 2020-1-25 00:27:01
| Show all posts
I just do n’t want to save it on the hard disk. I do n’t know if there is any other way?
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Invalid IP Address

Post time: 2020-1-25 01:18:02
| Show all posts
Get bytes code
System.IO.MemoryStream ms = new System.IO.MemoryStream ();
ms.Write (bytes, 0, bytes.Length);
Bitmap bmp = new Bitmap (ms);
ImageButton.Image = bmp;
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