Search Results

Search found 640 results on 26 pages for 'overload'.

Page 11/26 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Preserving Bitmap values when creating a new Bitmap from System.Drawing.Image

    - by Otaku
    I'm trying to create a resized image from a bitmap, set a new height/width and a new resolution and save it to PNG. I can do this either from directly A) Image.FromFile(filename) or B) New Bitmap(imageSource) to create the the A Bitmap to be passed to B. Both work okay schmokay, but A does not allow me to set a new width/height on creation (but it does allow me to preserve values with useIcm=True) and B does not allow me to preseve values. Okay, now on to some code and examples: Dim sourceBitmap As New Bitmap(imagePath & myImage1Name) <-not good at all (#1 overload). Doesn't preserve things like HorizontalResolution or PixelFormat on .Save Dim sourceBitmap2 As Bitmap = Image.FromFile(imagePath & myImage1Name, True) <-not good (#5 overload). it does preserve things like HorizontalResolution or PixelFormat on .Save, but it doesn't allow me to initialize image at a new size. Dim targetBitmap As New Bitmap(sourceBitmap2, newWidth, newHeight) <-not good. Even though sourceBitmap2 (see #2 above) was initialized with useIcm=True, it doesn't matter once I've passed it in as the source in targetBitmap. Basically, I'm looking for a way to contruct a New Bitmap with both something like useIcm=True and set the width/height at the same time (Width/Height are read-only properties once it's created). I've gone down the Graphics.DrawImage route as well and it's the same - Graphics.FromImage(sourceBitmap) does not preserve values. Why do I need these values to be preserved? Because I need to convert these pictures to PNG (for file size) with a new resolution and keep the same physical dimensions (w/h in inches) for printing. I know the new pixel width/height needed based on the resolution values I'll pass in with .SetResolution(xDpi,yDpi) to preserve physical dimensions, so that's not the problem. The issue is things like the PixelFormatSize need to remain unchanged (yes, I've tried EncoderParameters - they don't work. I can give you the gory details if you like, but suffice it to say for now, they just don't work). Whew, got that off my chest! Okay, anyone who really knows how all this works can help?

    Read the article

  • Recommended way to perform Lucene search without limit

    - by Thomas
    The Lucene documents tell me that "Hits" will be removed from the API in Lucene 3.0. Deprecated. Hits will be removed in Lucene 3.0. Use search(Query, Filter, int) instead. The proposed overload limits the number of documents returned to the value of the int. So my question is: what is the recommended way to perform a search in Lucene with no limit on the number of documents to be returned?

    Read the article

  • How do you make cin typesafe?

    - by cactusbin
    It is well known that cin is not typesafe (e.g. cin integer; and entering "fifty five" will cause it to flip out). I have seen many not-so-elegant ways to hand this, such as getlining a string and using sstream to convert it to a number, or looping with cin.fail() and clearing the stream and reentering it, etc. Is there any library or anyway to overload the inserter operator to make cin automatically typesafe?

    Read the article

  • c# eventhandling error

    - by bragin.www
    i have method private void getValues(object sender, EventArgs e) { int id = int.Parse(dgvTable.Rows[dgvTable.CurrentRow.Index].Cells[0].Value.ToString()); var values = from c in v.db.TotalDoc where c.TotalID == id select c.TotalAmount; dgvValues.DataSource = values; } and datagridview "dgvTable" error at this line dgvTable.CellClick += new EventHadler(getValues); error text is: No overload for 'getValues' matches delegate 'System.EventHandler' please help!

    Read the article

  • How to avoid fast rate page refresh in ASP.NET ?

    - by eugeneK
    I have a page that shows statistics for users, this cannot be cached because each user has different statistics and there are many thus the real time query must be made. What the way to avoid database server overload when user will click F5's to refresh or to ask different queries in short time intervals ?

    Read the article

  • FormsAuthentication, can I create a custom cookie?

    - by Blankman
    When the browser closes, I want the session to end = logged out. The FormAuthenticationTicket class doesnt' have a overload that is suitable for me. I don't want to set the expires property, so when the user closes the browser it logs him out. But I need: version, Name, UserData So I guess I have to create my own cookie? is there a way to create a custom cookie, but still uses forms authentication to encrypt and decrypt things?

    Read the article

  • Problem in converting ToDictionary<Datetime,double>() using LINQ(C#3.0)

    - by Newbie
    I have written the below return (from p in returnObject.Portfolios.ToList() from childData in p.ChildData.ToList() from retuns in p.Returns.ToList() select new Dictionary<DateTime, double> () { p.EndDate, retuns.Value } ).ToDictionary<DateTime,double>(); Getting error No overload for method 'Add' takes '1' arguments Where I am making the mistake I am using C#3.0 Thanks

    Read the article

  • Enterprise Library--Validator.cs How Abstract Class having definition??

    - by Soham
    Consider this piece of code: public abstract class Validator { protected Validator() { } protected abstract void ValidateCore(object instance, string value, IList<ValidationResult> results); public void Validate(object instance, string value, IList<ValidationResult> results) { if (null == instance) throw new ArgumentNullException("instance"); if (null == results) throw new ArgumentNullException("results"); ValidateCore(instance, value, results); } } TAKE a look at Validate() overload, how can an abstract class have definitions like this?

    Read the article

  • Operator overloading in C++

    - by user265260
    If you overload - like operator-(), it is to be used to the left of the object, however overloading () like operator()() it is used to the right of the object. How do we know which operator is to be used on the left and which ones to be used on the right?

    Read the article

  • How can an object not be compared to null?

    - by ProfK
    I have an 'optional' parameter on a method that is a KeyValuePair. I wanted an overload that passes null to the core method for this parameter, but in the core method, when I want to check if the KeyValuePair is null, I get the following error: Operator '!=' cannot be applied to operands of type System.Collections.Generic.KeyValuePair<string,object>' and '<null>. How can I not be allowed to check if an object is null?

    Read the article

  • Silverlight - round doubles away from zero

    - by Cornel
    In Silverlight the Math.Round() method does not contain an overload with 'MidpointRounding' parameter. What is the best approach to round a double away from zero in Silverlight in this case? Example: Math.Round(1.4) = 1 Math.Round(1.5) = 2 Math.Round(1.6) = 2

    Read the article

  • Overloading + to add two pointers

    - by iAdam
    I have a String class and I want to overload + to add two String* pointers. something like this doesn't work: String* operator+(String* s1, String* s2); Is there any way to avoid passing by reference. Consider this example: String* s1 = new String("Hello"); String* s2 = new String("World"); String* s3 = s1 + s2; I need this kind of addition to work. Please suggest.

    Read the article

  • Rvalues in C++03

    - by DeadMG
    How can you tell whether or not a given parameter is an rvalue in C++03? I'm writing some very generic code and am in need of taking a reference if possible, or constructing a new object otherwise. Can I overload to take by-value as well as by-reference and have the rvalue returns call the by-value function? Or do I have a very sickening feeling that this is why rvalue references are in C++0x?

    Read the article

  • Automatically download files in Ruby

    - by Obinna
    I'm trying to write a ruby script which automatically downloads some files from some server ever 30-45 minutes (to prevent overload) as long as my computer is turned on. It's possible that my computer might be turned off at some point, but the download should resume (probably re-download the current file). I already have the file list but I can't figure out how to make such a script to run autonomously. What are some ways I can do this?

    Read the article

  • How do I specify attributes for a Html.TextBox helper while maintaing the value retreival from ViewD

    - by BigJoe714
    I am using the Html.TextBox helper to create textboxes. I want to set attributes on the textbox, which I understand is done using the following overload: Html.TextBox (string name, object value, object htmlAttributes) However, I want to maintain the functionality where the html helper automatically uses the value from either ViewData or ViewData.Model and I do not see a way to just specify the name and the htmlAttributes. Is this possible?

    Read the article

  • Problem in converting ToDictionary<Datetime,double>() usinh LINQ(C#3.0)

    - by Newbie
    I have written the below return (from p in returnObject.Portfolios.ToList() from childData in p.ChildData.ToList() from retuns in p.Returns.ToList() select new Dictionary<DateTime, double> () {p.EndDate, retuns.Value }).ToDictionary<DateTime,double>(); Getting error No overload for method 'Add' takes '1' arguments Where I am making the mistake I am using C#3.0 Thanks

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >