Note that there are some explanatory texts on larger screens.

plurals
  1. POImage.GetThumbnailimage method and quality
    primarykey
    data
    text
    <p>I'm having an issue with Getthumbnailimage. The problem is that file sizes of a certain size display very blurry and grainy. Over at <a href="http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx" rel="noreferrer">msdn</a>, it says </p> <blockquote> <p>The GetThumbnailImage method works well when the requested thumbnail image has a size of about 120 x 120 pixels. If you request a large thumbnail image (for example, 300 x 300) from an Image that has an embedded thumbnail, there could be a noticeable loss of quality in the thumbnail image. It might be better to scale the main image (instead of scaling the embedded thumbnail) by calling the DrawImage method.</p> </blockquote> <p>The problem is that drawimage seems to be in windows forms. Is there any way to do this in Webforms? Here's the part of my code. Note: I don't want to get a thumbnail, somebody else wrote this and I just want the actual size displayed, that's all. </p> <pre><code>protected void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here ad a=(ad)Session["a"]; DataView dv=a.AdData.Tables[0].DefaultView; dv.RowFilter="ad_nbr=" + Request.QueryString["l"].Trim(); byte[] MyData= new byte[0]; MyData = (byte[])dv[0]["image"]; System.Web.HttpContext.Current.Response.ContentType = "image/jpeg"; System.Drawing.Image _image = System.Drawing.Image.FromStream(new stem.IO.MemoryStream( (byte[])dv[0]["image"]) ); System.Drawing.Image _newimage = _image.GetThumbnailImage(_image.Width, _image.Height, null, new System.IntPtr() ); _newimage.Save( System.Web.HttpContext.Current.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg ); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload