|
Hi, I want to ask a question about bitmap constructor(Image, Int32, Int32).I know that the three arguments 'Image','Int32' and 'Int32' are filled by original image, integer number and integer number respectively. In my application, I write my code like this:
Image image = new Bitmap(originalImage, integer number,integer number)
But after I run the application, the system give me an error like the bitmap first argument where I wrote originalImage should be integer. So can somebody tell why?
Thank you very much~!
|
|
|
|
|
Without a specific error, no one will know...
|
|
|
|
|
specific error?Didn't I describe my problem clearly?The problem I encountered in my program was:
I wrote a code like this:
Image image=new Bitmap(originalImage,originalImage.Width+changedSize,originalImage.Height+changedSize)
When I ran the application, the system gave me an error message like: 'Argument 1' cannot convert 'System.Drawing.Image' to 'int'. 'Argument 3' cannot convert 'int' to 'System.Drawing.Image.PixelFormat'.
Can anybody tell me why?
Thank you~!
|
|
|
|
|
kevinlin_5 wrote: the system gave me an error message like: 'Argument 1' cannot convert 'System.Drawing.Image' to 'int'. 'Argument 3' cannot convert 'int' to 'System.Drawing.Image.PixelFormat'.
Thank you, that is a proper error message, not a vague error description.
But I dont really know why! From what I can deduce, everything looks ok, but I will just make a quick sample when I get to work.
What version of .NET are you using?
|
|
|
|
|
I am using .NET 2.0.
Thank you very much for your kind helping.
|
|
|
|
|
Because you have written something as the second and third parameter that is so incorrect that the compiler can't even determine the type of it, so the compiler is using the overload of the constructor that seems closest, and that happens to be an overload where the first parameter is an integer.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I have reviewed my errors, I think it's because the compiler treat my constructor as (Int32, Int32, PixelFormat), so it gave the error. So can you tell me how did the compiler know what constructor it is?Is there any pre-defined code?
Thank you~!
|
|
|
|
|
The compiler determines what overload to use by the type of the arguments.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi i create a class and i want to create the array of the object but the array would not be fix it can be vary due to some conditions
wasim khan
|
|
|
|
|
Since an array is initialised with a fixed length you want to be looking to use a variable length object. The best way to do this would be to use a generic List which contains instances of your class.
E.g. if your class is called MyClass
using System.Collections.Generic;
List<MyClass> myList = new List<MyClass>();
MyClass c1 = new MyClass();
myList.Add(c1);
HTH
It definitely isn't definatley
|
|
|
|
|
Preview your posts after you post them. Obviously you didnt, as you would have realized the generics got swallowed by the HTML.
|
|
|
|
|
Yeah I always forget about that... Edited to display properly now.
It definitely isn't definatley
|
|
|
|
|
hi all,
actually we developed windows application using (Visual Studio 2008 C# & LINQ and sqlserever 2005 express edition).and i have to create setup and deployment for this project. i was added new project as "setup and Deployment" for my windows project .And i also included all the prerequisites to my project.exe layer.but main problem is "How can i deploy the database in Client machine ".
i tried this in client Machine :
it was installing All the Prerequisites in Client machine ,it was runnig succcesfully ,but it was showing "user is not trusted user" ,How can i solve this ,could u please help me,and i was strucking from last 3 weeks.
i got the below error:
============================
Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.
<configuration>
<system.windows.forms jitDebugging="true"/>
</configuration>
When JIT debugging is enabled any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.
=============================
Thanks in advance.
|
|
|
|
|
Use "Integrated Security = false" in connection string
|
|
|
|
|
i tried this, but it is not working ,it was showing bellow error message
" Login Failed for user .The user is not associated with a trusted Sql Server Connection ",main thing is i want to deploy the database in client Sql server . And how can i do this ,could u please help me .
Thanks in advance
|
|
|
|
|
Hie
I have made an installer package using c# that contains 4 other msi's.I do a chained install whereby after the parent installer finishes installing, the child msi's are installed in sequence.I managed to do this using orca,modified the install custom action that was pointing to a .exe so that it launches after the parent msi has finished installing.I modified the install custom action bit from 1042 to 1234.
When i uninstall the parent msi that contained the 4 child msi's,i would like to also uninstall the child msi's and remove them from the system.
So i tried pointing a .exe to the uninstall custom action (just as i did on the install custom action) so that before the main msi is uninstalled,i first remove the child msi's.If i do this...My uninstall custom action is not launched.Then i tried using an installer class so that i overwrite the uninstall function.If i do a simple thing like,messagebox.show() in my uninstall function,i get a messagebox popping on uninstall,but if i try to execute the code for uninstalling the child msi's in the uninstall function,nothing is executed.
how can i get this to work...
Thank you in advance....
modified on Monday, July 7, 2008 6:00 AM
|
|
|
|
|
hi everyone, this is my first post and i hope that i would find a solution to my problem. I have a textbox called "txtPurpose" in a C# Windows Application in Visual Studio , and i want that the text entered by the user in the textbox should be added to the "PURPOSE" field in a table "TABLE2_HDB1" in Oracle database "HDB1" on clicking a "submit" button. I want the coding to be in C#. plz help
|
|
|
|
|
I want to identify which language is used by current operating system,
for example, in engish or in German.
it is possible to do so?
thanks.
|
|
|
|
|
Check:
Application.CurrentCulture
or
Thread.CurrentThread.CurrentCulture
if de-DE -> german
if en-US -> english
...
|
|
|
|
|
Hi everybody,
Please help me soon.
I have developed a windows application using c#.net 2.0 and Oracle 10g as back end. It works fine on our machine, but it shows error on our client's machine. The error message as below:
"System.Data.OracleClient requires OracleClient software 8.1.7 or later".
I have not installed Oraclient software anywhere instead I have placed Oracle Instant Client dlls in my application folder. What is the reason and its solution.
I found most of the answers on behalf of security. I think it is not security reason because I have not installed oracleclient software.
The answer will be highly appreciated.
|
|
|
|
|
dibya_2003 wrote: System.Data.OracleClient requires OracleClient software 8.1.7 or later
The error message is clear. You need to install it.
|
|
|
|
|
i guess u need to have a version greater than 8 for oracle to work vth c#2.0
|
|
|
|
|
hi i want to Install new Window service but i want to check that Either this service is Exist or not if it Exist then do not install it
How i can check that it Exist
wasim khan
|
|
|
|
|
if you create an installer for your service, it will be detected automatically. you can set to: "warn if service exists" or "replace service with new version".
|
|
|
|
|
In order to check wether your service is exist or not by code not using an installer, you can use the System.Management namespace, in order to do it the following example shall help:
string serviceCaption="My Service Caption";
ManagementObjectSearcher searcher = new ManagementObjectSearcher
("SELECT * FROM Win32_Service WHERE Caption = "+"serviceCaption);
foreach (ManagementObject service in searcher.Get())
{
//Service Exist
}
or you can use the service name instead, notice that the difference between the caption and the name is that caption is as the full length name (short description) while the name is shorty non-alphanumeric:
string serviceName="MyServiceName";
ManagementObjectSearcher searcher = new ManagementObjectSearcher
("SELECT * FROM Win32_Service WHERE Name = "+"serviceName);
foreach (ManagementObject service in searcher.Get())
{
//Service Exist
}
Notice again that you should add a reference to the System.Management dll in your project.
Sincerely Samer Abu Rabie
Software Engineer
modified on Monday, July 7, 2008 8:53 AM
|
|
|
|