Monday 15 June 2015

.net - issue with saved image in a particular location in c# -


I am able to convert the base64 string into the image and the base64 string. And I'm saving the image in a particular place. If I run for the first time, then I'm getting the correct image file, which I gave as input. But from the second part, whatever the input image can be, I'm only getting the first input image.

Desired output: I need to bring the input image back I passed.

Conversion code:

  public string ImageToBase64 (image image, ImageFormat format) {using (MemoryStream ms = new MemoryStream ()) {/ / Convert image byte [] image. Save (MS, Format); Byte [] imageBytes = ms.ToArray (); // Convert Byte [] to base 64 string string base 64 string = convert toBase64String (imageBytes); Return base64String; }} Public Image Base 64 Toymase (string base 64 string) {// Convert base 64 string to byte [] byte [] imageBytes = Convert.FromBase64String (base64String); Memorystream ms = new memorystream (imagebits, 0, imagebites lang); // convert byte [] image ms.Write (imageBytes, 0, imageBytes.Length); Image image = image.freamstream (ms, true); Return image; }   

Save the file code:

  Public Zero Retrieval and Source IMgFile (string base64formofstr) {Console.WriteLine (" String:: "+ Base64formofstr.length); / * Bitmap bitmap = new bitmap (Base64ToImage (base64formofstr)); Bitmap newBitmap = new bitmap (bitmap); NewBitmap.SetResolution (150, 150); // The resolution of the original image for which the zone template is newly created. Save ("D: \\ Suraya \\ Testogate CorporatePoint \\ MICR_SAMPLE.tif", ImageFormat.Tiff); * / Base64ToImage (base64formofstr) Save ("D: \\ Suraya \\ TesttogetCorrectPutput \\ MICR_SAMPLE.tif"); }   

Please help me solve this problem.

I is not smart with everyone, but until I understand that you have trouble caching Because ... As you are using the same name all the time, it shows the output from the cache instead of the conversion.

The first option is on the name of the image One time ticket is to be added ..
Second Optional Browser is forced to reload the full page instead of showing it From ..

No comments:

Post a Comment