Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

Encoder Parameters - System.Drawing.Imaging

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Elmo Watson - 17 Jun 2007 04:12 GMT
I found an example on the msdn showing how to save JPG files with a quality:
myEncoderParameter = New EncoderParameter(myEncoder, CType(25L, Int32))
myEncoderParameters.Param(0) = myEncoderParameter
Of course, in a normal application, you'd want the quality to be dynamic,
based on user input. It's easy to hard something like this, but I'm totally
unsure of how to make 25L work dynamically.

It's obviously supposed to be an integer, and I've tried ways to concatenate
25 as a string and "L" - then including that inside the 'ctype' section, but
it never works, since I get an error:

Conversion from string "25L" to type 'Integer' is not valid.

I've even tried:

sQuality = frm.txtQuality.Text & "L"
Dim iQuality As Integer = CInt(sQuality)

Still - the same error, of course - - -

Still - I've tried leaving off the "L", but it gives me the same size file,
no matter what, so I know it's not working correctly.

Any ideas on how to accomplish this?
David Wier - 17 Jun 2007 06:52 GMT
I think it may be looking for a long there
:)

>I found an example on the msdn showing how to save JPG files with a
>quality:
[quoted text clipped - 21 lines]
>
> Any ideas on how to accomplish this?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.