 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
Many people have pointed this out: you must dispose of your streams. The failure to update your article accordingly, and the fact that there are better solutions, explains my vote.
|
|
|
|
 |
|
 |
It's a good start to convert, but you should always dispose your stream. Why always use Gif instead of native format?
|
|
|
|
 |
|
 |
i have andorid client which uploads image to server via WCF. as this client call my method having signature
public string InsertImage(string byteStream). now i am converting this string in array of byte and using yr imageconvertor class to render image by following code
public System.Drawing.Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms.ToArray());
Response.Write(returnImage);
return returnImage;
}
but m getting exception. can you solve this issue or help me out right approach .
|
|
|
|
 |
|
 |
awsome.
|
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
imageIn.Save(ms,System.Drawing.Imaging.ImageFormat.Gif);
The Save() Method will make the quality lower or not?
Should I set the "EncoderParameter" to keep the quality?
y or n?
|
|
|
|
 |
|
 |
Hi, first of all, I want to say thank you for share this code.
It is really help me in my final project.
But, I want to know about the byte that are produced by this code are represent the RGB or YUV or any other else?
thanks
|
|
|
|
 |
|
 |
Hi Guys,
I've been working on this for about a week and this seems to be not working please can you assist.
Please can you view the code below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script src="https://pcmchatproxy3.valueactive.eu/js/MgsLiveChatControl.js" type ="text/javascript"></script>
<script type ="text/javascript">
function nav()
{
var w = document.jump.menu.selectedIndex;
var url_add = document.jump.menu.options[w].value;
// nav1(url_add);
//
// }
//
// function nav1(url_add)
// {
if (url_add == 0)
{
LoadPromotions();
}
else if (url_add == 1)
{
LoadBanking();
}
else if (url_add == 2)
{
LoadFAQS();
}
else if (url_add == 3)
{
LoadSupport();
}
}
function LoadSupport()
{
try
{
var CasinoId = "322";
var BrowserLanguage = "En";
var SessionLanguage = "En";
var TopPosition = "350";
var LeftPosition = "300";
var Resource = "Website: Contact US";
var AutoLogin = true;
var DisableProxyPopUp = false;
var ProxyPageURL = " ";
var TrackingGuid = "";
var PlayerLoginName = "";
var SystemType = "2";
var SessionId = "";
var SessionType = "";
var NotificationURL = ""
var PSLLoginName = "";
var stepId = "1420";
MgsLiveChatControl.InitializeMgsLiveChatControl(CasinoId, BrowserLanguage, SessionLanguage, TrackingGuid, PlayerLoginName, SystemType, SessionId, SessionType, AutoLogin, TopPosition, LeftPosition, Resource, DisableProxyPopUp, ProxyPageURL, PSLLoginName,NotificationURL,CasinoId, stepId);
}
catch(Error)
{
}
}
function LoadPromotions()
{
try
{
var CasinoId = "322";
var BrowserLanguage = "En";
var SessionLanguage = "En";
var TopPosition = "350";
var LeftPosition = "300";
var Resource = "Website:Promotions";
var AutoLogin = true;
var DisableProxyPopUp = false;
var ProxyPageURL = " ";
var TrackingGuid = "";
var PlayerLoginName = "";
var SystemType = "2";
var SessionId = "";
var SessionType = "";
var NotificationURL = ""
var PSLLoginName = "";
var stepId = "1438";
MgsLiveChatControl.InitializeMgsLiveChatControl(CasinoId, BrowserLanguage, SessionLanguage, TrackingGuid, PlayerLoginName, SystemType, SessionId, SessionType, AutoLogin, TopPosition, LeftPosition, Resource, DisableProxyPopUp, ProxyPageURL, PSLLoginName,NotificationURL,CasinoId, stepId);
}
catch(Error)
{
}
}
</script>
</head>
<body>
<form name="jump">
<select name="menu" onchange = "javascript:nav()">
<OPTION VALUE="javascript:LoadPromotions()">Promotions</OPTION>
<OPTION VALUE="javascript:LoadBanking()">Banking</OPTION>
Please can you assist?
Thanks,
Monde
|
|
|
|
 |
|
 |
Hello, i am looking for one function. which extend the function FromStream(), so i can create one image from 32 bpp image stream. Do you have any idear?
|
|
|
|
 |
|
 |
its simple and its useful .
|
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Thanks a lot! So obvious, but still couldn't get the idea
|
|
|
|
 |
|
 |
Even if you call all your friends to vote for you 5 points, the code quality remains 0 (zero).
The function how it should've look:
public byte[] ImageToByteArray( System.Drawing.Image p_ImageIn )
{
byte[] aRet = null;
using ( System.IO.MemoryStream oMS = new System.IO.MemoryStream() )
{
p_ImageIn.Save( oMS, System.Drawing.Imaging.ImageFormat.Gif );
aRet = oMS.ToArray();
}
return aRet;
}
|
|
|
|
 |
|
 |
This worked great bro ...
Add the below lines also to get image from a server folder...
System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath("~/Images/no_image_icon2_100.gif"));
byte[] b = ImageToByteArray(image);
love to be a jerk....COMPUTER JERK ....
|
|
|
|
 |