|
hai there,
Sreejith S S Nair
|
|
|
|
|
Dear Sir/Madam,
I'am trying to rotate an image in a picture box control in C#.Along with that i'am drawing a rectangle on to the image for highlighting certain parts of the image.While rotating the image is getting rotated properly but the drawing which i have made on the image is not getting rotated.I have tried with rotate and rotateat methods but they just rotate the drawing but not with respect to the image.
My requirement is that while i'am rotating the image, the drawn rectangle highlighting certain parts also should get rotated and highlight the very same area in the rotated form.
Kindly help me,
Regards,
mmx
|
|
|
|
|
|
Drawing on the image is not the issue...That is done using the graphics object only...But while the image is rotated the drawings position is not changed or rotated.It lies in the same place...while image is rotated...
Also while creating graphics from image an exception is popping 'coz it is saying "creating graphics object from image that has indexed pixel format is not possible "
I need some mapping modes equivalent to MM_HIENGLISH,MM_HIMETRIC in VC++ in C#.NET...Also help me a bit with code...
Kindly help me out Barry...
Regards,
MMX
|
|
|
|
|
A quick search for "image rotation" on CodeProject turns up several articles, including a pretty good one, Image Rotation in .NET[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am faced with a problem and dont know where to begin. I am required to write a bot (automated program) in C# (preferably). Right now we have a website where a user has to enter some information and depending upon the options selected, a number representing that particular client with the options selected is generated and given back.
This website is working perfectly fine. But now what we want to do is instead of entering all the inforamtion again and again everytime we want to generate that number, we want to automate it. That is, write a class which will get the inforamtion from the database and accesses the already existing website, provide it with all the information and get the number generated.
The details of the existing website are as follows:
1. It is a form based website.
2. It has two web pages. i.e., on the fist page after entering the information and submitting it, the next page comes up and after entering the information on this one and submitting it will generate the required number.
3. Both these pages are passwrord protected. i.e., have to provide a user name and password before accessing them.
I am really confused how to begin and where to begin. I am not even sure if something like this can be done? Any help would be greatly appreciated.
Thanks in advance
Kashif
|
|
|
|
|
Filling the web page with information is pointless - just post the data yourself using a HttpWebRequest and using the GetRequestStream method, which - if you look at the documentation for that method in the .NET Framework SDK - includes an example. You can also use the WebClient.UploadData for this, but you don't have quit as much control over the HTTP headers that are sent.
As far as pulling information from a database, that's easy. Use ADO.NET. See the System.Data namespace in the .NET Framework SDK, and use whichever child namespaces (like System.Data.SqlClient for SQL Server or System.Data.OleDb for any data source with an OLE DB provider). There is plenty of examples in the class library documentation for members of those namespaces and you can always ask this forum if you have specific questions.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Mr.Heath Stewart
I use the way that you describe for me .
this way only safe for graphic based on Win App.
but when i use from that file generated in web, black color appear in background.
i will make transparent background area (alpha channel)
if you know how i can resolve this problem , please describe for me .
thank's
---------------
Bitmap b = new Bitmap(100,20);<br />
Graphics g = Graphics.FromImage(b);<br />
g.Clear(Color.Orange);<br />
g.DrawString("Test",new Font("Tahoma",8),new SolidBrush(Color.Green),0,0);<br />
b.MakeTransparent(Color.Orange);<br />
b.Save("test.gif",System.Drawing.Imaging.ImageFormat.Gif);<br />
|
|
|
|
|
There is a bug in the .NET Framework when it comes to transparency. Head over to dotnet247 for lots of info on this plus some complicated workarounds.
regards,
Paul Watson
Bluegrass
South Africa
Chris Maunder wrote:
"I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly."
Jon Sagara replied:
"I think we've all been in that situation before."
Crikey! ain't life grand?
|
|
|
|
|
ON top of that, .GIF files don't support an alpha channel. Just a transparency key...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
...which is what I told him.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I know! Sometime you just need a bigger hammer to drive the point home! Like making TABs in VS.NET...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi! anybody can assist me in developing a simple blob analysis program via C# -GDI+. The idea is I would want to do some image processing on a captured images (in this example, it'll be few coins). The picture of these coins are taken via digital camera. I would really much appreciate it somebody can help me in the blob analysis program.
M
|
|
|
|
|
I have a class that I access from my main form to get all my class data. I created a thread to do a particular task (first time using threads), only it seems to have a new instantiation of my class, and all the class data is off. How can I get these two synchronized so that my thread can access the same data my form gets?
|
|
|
|
|
Post the code that spawns the work thread, assuming that this work thread is used to read in data or whatever and set a form's data member in the main thread.
In general, read in the data in the work thread. Invocate an event to update the main thread.
Kuphryn
|
|
|
|
|
Heres what the code looks like:
static void Main()
{
//making a new instance of this class to run outside of main
Form1 f = new Form1();
f.startScheduler();
Application.Run(new Form1());
}
public void startScheduler()
{
//get this thread goin
Thread t1 = new Thread(new ThreadStart(ripper));
t1.Start();
}
public void ripper()
{
//infinite loop
for ( ;;)
{
if (hc.getNumThemes() >= 1)
{
MessageBox.Show("calling riptheme");
hc.rip_Theme();
}
Thread.Sleep(4000);
}
}
during the application, hc.getNumThemes gets bumped from 0 to 1,2,3. But the thread always remains at 0.
|
|
|
|
|
Dear CPians,
I am in need of customized PropertyGrid component(.NET Compatable) with look and feel like the link below
http://www.visualhint.com/propertygrid.php
If you know any of such controls, Please let me know.
I would appreciate your help in this regard.
Thanks in advance.
Regards,
Jay.
|
|
|
|
|
As I mentioned to you before[^], you can use either the IL Disassembler (ildasm.exe that comes with the .NET Framework SDK) or a decompiler to find out how the PropertyGrid works. I also told you how it uses the System.ComponentModel namespace members to provide it with functionality (which leppie also mentioned), which is what that namespace (and a few related namespaces) are for. The .NET FCL provides a designer with almost everything it needs to design components.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Actually, I was referring to how you let the UITypeEditor s and what-not "do their job". That was the point I was trying to make.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
here is a C++ function:
LRESULT CALLBACK GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
{
// Do we have to handle this message?
if (nCode == HC_ACTION)
{
// Process the hook only if the WinVNC thread id is valid
if (vnc_thread_id)
{
MSG *msg = (MSG *) lParam;
// Only handle application messages if they're being removed:
if (wParam & PM_REMOVE)
{
// Handle the message
if (m_ddihook)
HookHandleddi(msg->message, msg->hwnd, msg->wParam, msg->lParam);
else HookHandle(msg->message, msg->hwnd, msg->wParam, msg->lParam);
}
}
}
// Call the next handler in the chain
return CallNextHookEx (hGetMsgHook, nCode, wParam, lParam);
}
////////////////////////////////////////////////
according to an article on MSDN, i write a Hook code in C#.
how to convert this code to C# counterpart:
MSG *msg = (MSG *) lParam;
i declare lParam as IntPtr type. How about *msg ?
should i write it as this :
System.Messaging.Message msg = (System.Messaging.Message)lParam
???
|
|
|
|
|
MSG is a simple struct:
[StructLayout(LayoutLind.Sequential)]
public struct MSG
{
public IntPtr hwnd;
[MarshalAs(UnmanagedType.SysUInt)] public IntPtr message;
public IntPtr wParam;
public IntPtr lParam;
[MarshalAs(UnmanagedType.U4)] public int time;
public System.Drawing.Point pt;
} The second field is an IntPtr because the unmanaged type UINT is a processor-dependent bit width: 32 bits on a 32-bit CPU and 64 bits on a 64-bit CPU. To pass a value, just use new IntPtr(someNum);
If you need a pointer to this struct (MSG* ), you can either use the Marshal.StructureToPtr to marshal it to an IntPtr or - even easier - declare the method that accepts the MSG* as ref MSG msg . Here's an example:
[DllImport("user32.dll")]
private static extern bool SomeExampleFunc(ref MSG msg); This automatically marshals the MSG struct (that you simply instantiate and fill the fields) as a MSG* .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Ok, i have a DataTable with some columns, and i have a DataGrid.
The DataGrid DataSource is my DataTable.
So, how i color some elements?
I want to color all elements in the Table = "F" and "I"
Thanks.
|
|
|
|
|