Bosch HXR390H20T
                      -
                    
Bosch HXR390H20T fırın Bosch'un 2019 yılı için çıkardığı özellikleri biraz 
daha yükseltilmiş bir fırın görüntüsü veriyor. Seçimimizi bu fırından yana 
kulla...
6 yıl önce
İçerikler özgün değildir. Sadece sık sık lazım olan işime yarayacak olan notları almış olduğum kişisel bloğumdur.
<canvas id="canvas" width="850" height="350"></canvas>
<a onClick="resimeklegeometri();">Tamam</a>function resimeklegeometri() {
     // generate the image data
    var Pic = document.getElementById("canvas").toDataURL("image/png");
    Pic = Pic.replace(/^data:image\/(png|jpg);base64,/, "");
    var ResimAdi="resimeverecegimizad.png";
     // Sending the image data to Server
    $.ajax({
        type: 'POST',
        url: 'Save_Picture.aspx/UploadPic',
        data: '{"imageData":"' + Pic + '","ResimAdi":"' + ResimAdi + '"}',
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        success: function (msg) {
            alert("Resim Kaydedildi"); 
        }
    });
 
using System;
using System.Web;
using System.IO;
using System.Web.Script.Services;
using System.Web.Services;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
[ScriptService]
public partial class Save_Picture : System.Web.UI.Page
{
        [WebMethod()]
    public static void UploadPic(string imageData, string ResimAdi)
    {
                    string Pic_Path = HttpContext.Current.Server.MapPath(ResimAdi);
        using (FileStream fs = new FileStream(Pic_Path, FileMode.Create))
        {
            using (BinaryWriter bw = new BinaryWriter(fs))
            {
                byte[] data = Convert.FromBase64String(imageData);
                bw.Write(data);
                bw.Close();
            }
        }
       
    }
}<system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="1000000"></jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions> [WebMethod()] içerisinde bazen response ve server.mappath gibi fonksiyonlara izin vermiyor onun için şu şekilde kullanmamız gerekiyor HttpContext.Current.Server.MapPath("~/") HttpContext.Current.Response.ContentType = "image/jpeg"; HttpContext.Current.Response.Write("deneme");© Arif Erzin Bloğu-Kendime Notlar 2013 . Powered by Bootstrap , Blogger templates and RWD Testing Tool
Hiç yorum yok :
Yorum Gönder