|
its not what i ment.
I want to add another references, besides the control dll.
for example,
when the developer adding my control to his form,
i want to add 3 more references to my other dlls.
do u know how to do that ?
|
|
|
|
|
What is/are the cell events that are fired After _cellformatting?
Thanks
|
|
|
|
|
i have a tiff image with multipule pages in it.its size is 2650 x 3300 and i want to reduse it to 1728 x 2200. is there any way that i can reduse its size. please help me.
|
|
|
|
|
One way to do this could be:
public Bitmap ResizeBitmap(Bitmap b, int width, int height )
{
Bitmap result = new Bitmap( width, height );
using( Graphics g = Graphics.FromImage((Image) result ))
{
g.DrawImage( b, 0, 0, width, height );
}
return result;
}
|
|
|
|
|
This code is working but there is no change in the file size. so how it will effect the file size and where it will be save the file with new size?
|
|
|
|
|
You would have to save the new version to change the file size.
|
|
|
|
|
yes. it changes the size and in result file there is only one image while in original file there is a lot of images. so all the others are discard. what should i do to save them? how i can resize the file with all images?
|
|
|
|
|
 Load current tiff.
Iterate over every frame of your loaded tiff image and resize each frame.
private Image ScaleImage(Size desiredSize, Image originalImage)
{
if (desiredSize.Height != originalImage.Height || desiredSize.Width != originalImage.Width) {
Bitmap bm = new Bitmap(desiredSize.Width, desiredSize.Height);
bm.SetResolution(originalImage.HorizontalResolution, originalImage.VerticalResolution);
Image scaledImage = bm;
using (Graphics g = Graphics.FromImage(scaledImage)) {
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.SmoothingMode = SmoothingMode.HighQuality;
g.CompositingQuality = CompositingQuality.HighQuality;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
try {
g.DrawImage(originalImage, 0, 0, desiredSize.Width, desiredSize.Height);
}
catch (OverflowException oe)
{
WriteLogMessage(LogLevel.Information, "OverflowException on Graphics.DrawImage - trying InterpolationMode with less quality.");
g.InterpolationMode = InterpolationMode.Bicubic;
g.DrawImage(originalImage, 0, 0, desiredSize.Width, desiredSize.Height);
}
g.Flush();
}
return scaledImage;
}
return originalImage;
}
Save this frame.
Now create a multipage tiff from all saved resized images. Depending on your needs (mixed color/bw frames) you might need different code. You could use a function like this one:
public static void CreateMultiPage (string[] inputFiles, string targetFileName, bool useCCITT4Compression)
{
ImageCodecInfo codec = Helpers.GetEncoder (ImageFormat.Tiff);
EncoderParameters encoderParams = useCCITT4Compression ? new EncoderParameters(2) : new EncoderParameters(1);
encoderParams.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.SaveFlag, (long)EncoderValue.MultiFrame);
if (useCCITT4Compression)
encoderParams.Param[1] = new EncoderParameter(System.Drawing.Imaging.Encoder.Compression, (long)EncoderValue.CompressionCCITT4);
EncoderParameters encoderParamsAddFrame = useCCITT4Compression ? new EncoderParameters(3) : new EncoderParameters(2);
encoderParamsAddFrame.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.SaveFlag, (long)EncoderValue.MultiFrame);
encoderParamsAddFrame.Param[1] = new EncoderParameter(System.Drawing.Imaging.Encoder.SaveFlag, (long)EncoderValue.FrameDimensionPage);
if (useCCITT4Compression)
encoderParamsAddFrame.Param[2] = new EncoderParameter(System.Drawing.Imaging.Encoder.Compression, (long)EncoderValue.CompressionCCITT4);
using (Image multipageTIFF = Image.FromFile(inputFiles[0]))
{
multipageTIFF.Save(targetFileName, codec, encoderParams);
for (int i = 1; i < inputFiles.Length; i++)
{
using (Image img = Image.FromFile(inputFiles[i]))
{
multipageTIFF.SaveAdd(img, encoderParamsAddFrame);
}
}
EncoderParameters ep = new EncoderParameters(1);
ep.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.SaveFlag, (long)EncoderValue.Flush);
multipageTIFF.SaveAdd(ep);
}
}
|
|
|
|
|
I've been trying to implement the IDocHostShowUI interface in order to intercept requests to show dialogs and pop-ups etc.
However, my implementation is not working. The ShowMessage method does not get called. I'm navigating the browser to a page that causes pop-ups to be displayed. Here's the code i've used:
public class ExtendedWebBrowser : System.Windows.Forms.WebBrowser, IDocHostShowUI
{
#region IDocHostShowUI Members
int IDocHostShowUI.ShowMessage(IntPtr hwnd, string lpstrText,
string lpstrCaption, uint dwType,
string lpstrHelpFile, uint dwHelpContext, ref int lpResult)
{
return 1;
}
public int ShowHelp(IntPtr hwnd, string pszHelpFile, uint uCommand, uint dwData, tagPOINT ptMouse, object pDispatchObjectHit)
{
throw new Exception("The method or operation is not implemented.");
}
#endregion
}
[ComImport, ComVisible(true)]
[Guid("C4D244B0-D43E-11CF-893B-00AA00BDCE1A")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDocHostShowUI
{
[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int ShowMessage(
IntPtr hwnd,
[MarshalAs(UnmanagedType.LPWStr)] string lpstrText,
[MarshalAs(UnmanagedType.LPWStr)] string lpstrCaption,
[MarshalAs(UnmanagedType.U4)] uint dwType,
[MarshalAs(UnmanagedType.LPWStr)] string lpstrHelpFile,
[MarshalAs(UnmanagedType.U4)] uint dwHelpContext,
[In, Out] ref int lpResult);
[return: MarshalAs(UnmanagedType.I4)]
[PreserveSig]
int ShowHelp(
IntPtr hwnd,
[MarshalAs(UnmanagedType.LPWStr)] string pszHelpFile,
[MarshalAs(UnmanagedType.U4)] uint uCommand,
[MarshalAs(UnmanagedType.U4)] uint dwData,
[In, MarshalAs(UnmanagedType.Struct)] tagPOINT ptMouse,
[Out, MarshalAs(UnmanagedType.IDispatch)] object pDispatchObjectHit);
}
I put a breakpoint on the ShowMessage method but it doesn't get called. Can anyone see what i've done wrong?
Thanks
|
|
|
|
|
I want to keep the entered text in text box .Entered Text is as password format.
but wrong password entry(after button event) or after postback event the entered text is automatically erased from that field .How can I stop such erasing from that text field.I am using version 2003 edition and 1.1 frame work.
|
|
|
|
|
|
I think it is a web application !!!
u can use ViewState To retain the value for onClick event or Postback
|
|
|
|
|
Hi,
How is it possible to disable the check option of a checkbox inside a datagridview control.
It seems the cellclick event of the datagridview control has no affect.
Please let me know if you would like more information.
Thanks
|
|
|
|
|
Hi,
My aim is to get the mac address of my machine thru C# code .....my code is given below ....my problem is i am getting some other things with the mac address.....plz tell me why...n one more thing can i get all the mac address of the systems which r connected in a particular network.....if any one knows how to do this .. then please do let me know
R E G A R D S
S I N D H U T I W A R I
ManagementObjectSearcher query = null;
ManagementObjectCollection queryCollection = null;
query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration");
queryCollection = query.Get();
// the below code returns the mac address of the computer
foreach (ManagementObject mo in queryCollection)
{
if (mo["MacAddress"] != null)
{
richTextBox1.Text = richTextBox1.Text + mo["MacADDress"].ToString() + "\n";
}
}
its me sid
|
|
|
|
|
|
Thats the same code which i have mentioned ...sir plz do read once before sending any message ..my aim is to know all the mac address of the pc's connected in lan ....the code which i have given ..gives me the correct output but wid two other address ..my question is why these are coming ...... REGARDS
SINDHU TIWARI
its me sid
|
|
|
|
|
sindhutiwari wrote: Thats the same code which i have mentioned
So why didn't you mention where you got it? Then you might have got a different answer.
sindhutiwari wrote: sir plz do read once before sending any message
I'm sure he did - But was not aware of where you copied your code from in the first place.
If you are going to copy stuff, at least have the decency of citing its source.
|
|
|
|
|
my question is why i am getting extra things from this code apart from the mac address
its me sid
|
|
|
|
|
well maybe there's more than one networkadapter in your box..
|
|
|
|
|
|
Sketchs.Add(new SKETCH(SketchWorkSheet.Cells[i, 3].ToString(),
SketchWorkSheet.Cells[i, 4].ToString(),
SketchWorkSheet.Cells[i, 5].ToString(),
SketchWorkSheet.Cells[i, 6].ToString(),
SketchWorkSheet.Cells[i, 7].ToString(),
SketchWorkSheet.Cells[i, 8].ToString(), Convert.ToDouble(SketchWorkSheet.Cells[i,9])));
when i run this i get an error as
Input string was not in a correct format
Can any one help me in this
RamyaNaidu
|
|
|
|
|
ramyanaidu wrote: Sketchs.Add(new SKETCH(SketchWorkSheet.Cells[i, 3].ToString(),
SketchWorkSheet.Cells[i, 4].ToString(),
SketchWorkSheet.Cells[i, 5].ToString(),
SketchWorkSheet.Cells[i, 6].ToString(),
SketchWorkSheet.Cells[i, 7].ToString(),
SketchWorkSheet.Cells[i, 8].ToString(), Convert.ToDouble(SketchWorkSheet.Cells[i,9])));
when i run this i get an error as
Input string was not in a correct format
Can any one help me in this
Yep, we may be able to. But we need a clue - like what is in each of these cells. What parameter types SKETCH is expecting.
Try expanding your code to
string cell3 = SketchWorkSheet.Cells[i, 3].ToString();
string cell4 = SketchWorkSheet.Cells[i, 4].ToString();
Then pass cell3 and cell4 etc as parameters to the main call. Your debugger, and as a result, you, will have far more chance of seeing what is going on.
The problem, at a guess is with the conversion to double
Convert.ToDouble(SketchWorkSheet.Cells[i,9]));
Convert Cells[i,9] to a string, look at the value in a debugger and I imagine you will see the problem.
Small angry dogs
modified on Monday, December 17, 2007 6:28:14 AM
|
|
|
|
|
Dear all,
I am converting an application into C#that is written in VB so for that i have to first write the classes .......
can anybody tell me what should be the criteria i need to employ to write the classes..
that VB code contains sevral modules...
so please help me here....
T@SU
|
|
|
|
|
Try this link
Similar Problem[^]
You mentioned in your other thread a couple of comments :-
1) It will take time. <code>-- what doesn't, if it is worth doing?</code>
2) It is some paid thing <code>-- what isn't - if it does the job you want?</code>
Welcome to the real world, where you get what you pay for, and also have to pay for what you get. You'll get all the help you need on here - TOTALLY FREE OF CHARGE - if, and this is the big if for a lot of people, if you are prepared to have a go yourself, hit a problem, and then ask.
Small angry dogs
|
|
|
|
|
Malcolm Smart wrote: Malcolm Smart
Hay u r really smart !!!
but anyway i want to finish my task since i dont have much idea about Visual basic thats why i am here... to get the help from you guys...
so please help me....
vikas da
|
|
|
|
|