The example of this article is about how to judge the mode GRB or CMYK of asp.net when uploading the picture. Share to everyone for your reference, specific as follows:
Bitmap bmp = new Bitmap (allow_filestream); File path
allowupload = Stringhelper.iscmyk (BMP) = = "true"? False:true;//return True string the picture is not a public string in RGB mode
IsCM YK (System.Drawing.Image img)
{
string Iscmyk;
if (Getimageflags (IMG). IndexOf ("YCCK") >-1) | | (Getimageflags (IMG). IndexOf ("Cmyk") >-1))
{
Iscmyk = ' true ';
}
else
{
Iscmyk = ' false ';
}
return Iscmyk;
}
public string Getimageflags (System.Drawing.Image img)
{
imageflags flagvals = (imageflags) enum.parse ( typeof (Imageflags), IMG. Flags.tostring ());
return flagvals.tostring ();
}
More interested readers of asp.net related content can view the site topics: "asp.net operation JSON tips summary", "asp.net string operation tips Summary", "ASP.net Operation XML Skills summary", "asp.net file Operation skills Summary", " asp.net Ajax Skills Summary topic and the "ASP.net cache operation skills Summary."
I hope this article will help you to ASP.net program design.