c# EncoderParameter
C#
private void VaryQualityLevel()
{
// Get a bitmap.
Bitmap bmp1 = new Bitmap(@"c:\TestPhoto.jpg");
ImageCodecInfo jpgEncoder = GetEncoder(ImageFormat.Jpeg);
// Create an Encoder object based on the GUID
// for the Quality parameter category.
System.Drawing.Imaging.Encoder myEncoder =
System.Drawing.Imaging.Encoder.Quality;
// Create an EncoderParameters object.
// An EncoderParameters object has an array of EncoderParameter
// objects. In this case, there is only one
// EncoderParameter object in the array.
EncoderParameters myEncoderParameters = new EncoderParameters(1);
EncoderParameter myEncoderParameter = new EncoderParameter(myEncoder, 50L);
myEncoderParameters.Param[0] = myEncoderParameter;
bmp1.Save(@"c:\TestPhotoQualityFifty.jpg", jpgEncoder, myEncoderParameters);
myEncoderParameter = new EncoderParameter(myEncoder, 100L);
myEncoderParameters.Param[0] = myEncoderParameter;
bmp1.Save(@"c:\TestPhotoQualityHundred.jpg", jpgEncoder, myEncoderParameters);
// Save the bitmap as a JPG file with zero quality level compression.
myEncoderParameter = new EncoderParameter(myEncoder, 0L);
myEncoderParameters.Param[0] = myEncoderParameter;
bmp1.Save(@"c:\TestPhotoQualityZero.jpg", jpgEncoder, myEncoderParameters);
}
Also in C#:
- Title
- how to stream video from vlc in c#
- Category
- C#
- Title
- c sharp exit while loop
- Category
- C#
- Title
- c# ref
- Category
- C#
- Title
- unity ui change sprite
- Category
- C#
- Title
- rotatearound unity
- Category
- C#
- Title
- mysql executeScalar only if successful
- Category
- C#
- Title
- c sharp check if list contains
- Category
- C#
- Title
- what is type unity
- Category
- C#
- Title
- C# for
- Category
- C#
- Title
- how to record number of times using application in c#
- Category
- C#
- Title
- how to use K2 games Games parallax background
- Category
- C#
- Title
- unity rotate vector
- Category
- C#
- Title
- c# reverse string
- Category
- C#
- Title
- c# ?
- Category
- C#
- Title
- c# get executable path
- Category
- C#
- Title
- list with two values c#
- Category
- C#
- Title
- toggle unity c#
- Category
- C#
- Title
- c# windows forms draw pixel
- Category
- C#
- Title
- list contains type c#
- Category
- C#
- Title
- c# storing value in session
- Category
- C#
- Title
- c sharp comments
- Category
- C#
- Title
- array copy c#
- Category
- C#
- Title
- prefab gets character transform
- Category
- C#
- Title
- C# Into To Tring Debug.Log
- Category
- C#
- Title
- c# random string
- Category
- C#
- Title
- list of vectors c#
- Category
- C#
- Title
- c# resize image keep aspect ratio
- Category
- C#
- Title
- unity how to move an object to another object
- Category
- C#
- Title
- pop up element from specific index in array
- Category
- C#
- Title
- Request.Form
- Category
- C#
- Title
- c# try catch error
- Category
- C#
- Title
- check connection c#
- Category
- C#
- Title
- wpf c# select folder path
- Category
- C#
- Title
- wpf binding ancestor codebehind
- Category
- C#
- Title
- c# get binary array from int
- Category
- C#
- Title
- c# arrays of arrays
- Category
- C#
- Title
- c# length 2d array
- Category
- C#
- Title
- c# push numbers to array
- Category
- C#
- Title
- unity clamp rotation
- Category
- C#
- Title
- how to get odd saturday in a month in c#
- Category
- C#
- Title
- c# ^ operator
- Category
- C#
- Title
- unity to integer
- Category
- C#
- Title
- ping with c#
- Category
- C#
- Title
- using serial port in c#
- Category
- C#
- Title
- system.io.directorynotfoundexception c#
- Category
- C#
- Title
- mongodb custom IIdGenerator
- Category
- C#
- Title
- c# filesystemwatcher double events
- Category
- C#
- Title
- public enum c#
- Category
- C#
- Title
- unity try get component
- Category
- C#
- Title
- C# get object property name
- Category
- C#
- Title
- c# keyboard enter
- Category
- C#
- Title
- unity round
- Category
- C#
- Title
- c# initialize empty array
- Category
- C#
- Title
- No context type was found in the assembly
- Category
- C#
- Title
- freeze rotation in code c#
- Category
- C#
- Title
- unity print to console
- Category
- C#
- Title
- c# create dynamic object
- Category
- C#
- Title
- read xml file c#
- Category
- C#
- Title
- MVC creating a counter for products
- Category
- C#
- Title
- open link c#
- Category
- C#
- Title
- navigate to another page with an object uwp c#
- Category
- C#
- Title
- fieldconverter c#
- Category
- C#
- Title
- no entity framework provider found for the ado.net provider with invariant name
- Category
- C#
- Title
- iterate through xpdictionary devexpress
- Category
- C#
- Title
- foreach syntax c#
- Category
- C#
- Title
- flip boolean c#
- Category
- C#
- Title
- C# Cast double to float
- Category
- C#
- Title
- how to convert from hexadecimal to binary in c#
- Category
- C#
- Title
- degree to radians c#
- Category
- C#
- Title
- how to edit a c# list
- Category
- C#
- Title
- c# pull request
- Category
- C#
- Title
- firefoxoptions setpreference to trust certificates
- Category
- C#
- Title
- razor: show editable list
- Category
- C#
- Title
- c# exit console
- Category
- C#
- Title
- get set c#
- Category
- C#
- Title
- c# combobox datasource enum
- Category
- C#
- Title
- c# char array to string
- Category
- C#
- Title
- c# list append
- Category
- C#
- Title
- c# delay
- Category
- C#
- Title
- transform object according to its parent unity
- Category
- C#
- Title
- stop unity editor playing
- Category
- C#
- Title
- ubuntu: how to open the terminal from c#
- Category
- C#
- Title
- what is the namespace for textmesh pro
- Category
- C#
- Title
- c# implement ienumerable t
- Category
- C#
- Title
- c# how to sort a list
- Category
- C#
- Title
- c# switch statement
- Category
- C#
- Title
- create new object from generic c#
- Category
- C#
- Title
- asign only common fields in c# object
- Category
- C#
- Title
- POST http://localhost:5001/api/v1/identity/login 500 (Internal Server Error) LoginForm.jsx:39 Error: Request failed with status code 500 at createError (createError.js:16) at settle (settle.js:17) at XMLHttpRequest.handleLoad (xhr.js:61)
- Category
- C#
- Title
- dynamically add rows to datagridview c#
- Category
- C#
- Title
- c# linq to get most recent item from IList
- Category
- C#
- Title
- comments unity c#
- Category
- C#
- Title
- BCrypt c#
- Category
- C#
- Title
- onmouseover unity
- Category
- C#
- Title
- disable button in android studio
- Category
- C#
- Title
- c# thread sleep
- Category
- C#
- Title
- format float to time c#
- Category
- C#
- Title
- razor preview
- Category
- C#
- Title
- xamarin forms alarm
- Category
- C#
- Title
- for each property in object c#
- Category
- C#