|
A picture box is NOT a picture. It DOES have a property that exposes the bitmap it's displaying. I presume you can call a getpixel method on that.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Ok, now I see,
I have done it as follows:
I load the image in the picturebox:
pictureBox->Load("C:\\image.png");
and after I load it like a bitmap in the event that I want, in my case pictureBox_MouseUp
<br />
Point^ Point1;<br />
Bitmap^ Bitmap1;<br />
Color pixelColor;<br />
<br />
Point = e->Location::get()<br />
Bitmap1= gcnew Bitmap( "C:\\image.png",true );<br />
pixelColor = Bitmap1->GetPixel(Point1->X,Point1->Y);
This is the way that I did it,
Thanks for your help
|
|
|
|
|
I'm not sure how this is a C++/CLI question ?
Christian Graus - C++ MVP
|
|
|
|
|
I wana make so many lines appear randomly (like heat beat rate) depend on the base line ..while I run the program .
How can i make that works . pls give me some hints or code ,,
|
|
|
|
|
Which bit are you stuck on ? Are you really using C++/CLI, or are you in the wrong forum ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I recently downloaded Visual C++ Studio and when I try to compile my project, I get error messages such as these below. I made sure to follow the instructions on setting the VC++ Directories option but I still keep getting errors such as this one
c:\Pam 2\Headers\afxwin.h(19) : fatal error C1083: Cannot open include file: 'AFX.h': No such file or directory
and the problem is that most of these include files happen to be in the Windows Platform SDK / Include/MFC folder. How do I get my the compiler to look in there for these files please.
|
|
|
|
|
First of all, you're in the wrong forum.
You set the paths in the options for VC2005.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You have downloaded Visual C++ Studio? I think it is VC++ Express edition, which does not support MFC. (Afx.h). You need to retail version to do MFC programming. The express edition only supports Managed c++.
|
|
|
|
|
Hello
I am very new to managed c++, i have to start the codeing which needs many MFC features. I have done the same in VC++ 6.0. Now i must port it onto VC++.net.
Can anyone please confirm me wheather, i can start my project in VC++.net version (Managed C++) and also use the features of MFC.
Kindly give me the method i need to follow.
Thank you
Kind Regards
Sandy
|
|
|
|
|
Yes, you can create an MFC project and add the ( from memory ) /clr compiler switch to allow you to use managed code.
However, MFC doesn't offer anything that .NET doesn't offer, are you sure you want to rely on both ?
Christian Graus - C++ MVP
|
|
|
|
|
Thanks Christain, i think you have really made my work light. I am still in a dilama where i need to communicate with a firmware and also use some of the OCX for graphs and sliders. can my .net VC++ work in the same mannar as that of the MFC.
since MFC is strong on these concepts(like sending and reciving data from any other device) and also very mush usefull in system programming.
Kindly help me, I have to make a decision betwenn VC++.net and VC++.Net MFC.
Is vc++.Net same as MFC?
Sorry if i am bugging you up. I am deseprate for some support.
Kind Regards
Sandy
|
|
|
|
|
ksandy45 wrote: Is vc++.Net same as MFC?
No, it's not even close. .NET is newer, less supported, but certainly does more. If you have the choice, I'd take C# over C++/CLI.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hmmmm.....
I am bit confused, i don't mean that way. Can i achieve my things like communicating with Firmware, via VC++.net. Is it functionality wise Same(.net & MFC)?
Kind Regards
Sandy
|
|
|
|
|
ksandy45 wrote: Can i achieve my things like communicating with Firmware, via VC++.net.
Yes. There is *nothing* you can do in MFC that you can't do in C++/CLI ( or Win32, for that matter ). But, C++/CLI has a more modern framework, so it offers all sorts of stuff that vanilla C++ and MFC do not.
ksandy45 wrote: Is it functionality wise Same(.net & MFC)?
No. Like I said, the .NET framework offers a lot of stuff that MFC does not.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thank you Christian. I have clear picture now. I can start my project using Managed C++ and still do all the functionalists that i have done using MFC.
I hope what i predict is right?
Kindly help me for my further queries.
Thanks a lot.
Kind Regards
Sandy
|
|
|
|
|
MFC is just a Win32 wrapper. .NET is a whole new framework. C++/CLI will allow you to do any Win32 call you like.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thank you very much. I am really very much satisfied with your help. I shall start implementing the same using C++/CLI.
Kindly keep in touch. I shall be into trouble again...
Thanks a lot
Kind Regards
Sandy
|
|
|
|
|
Does anyone have any good articles on doing these 2 things with c/c++? I see many articles for c# and VB. I would like to do simple everyday tasks but faster without the need of accessing AD Users and computers everytime.
Thanks
|
|
|
|
|
Hi Everyone,
I have created a .Net User control which includes reference to a C++ /CLI component developed with /clr . Since there are some unmanaged resoucrces, i am calling the disposing the C++ /CLI in the dipose method of the user control. If we drag and drop this control in to a Windows form and then try to delete it,it is throwing an exception that the "C++ / CLI " dll could not be located.... however it is working fine while running the application
can anyone help me out.The sample code is
///
/// Clean up any resources being used.
///
/// true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
if (unmanagedComponent != null)
{
unmanagedComponent = null;
}
}
|
|
|
|
|
C++/CLI does not allow you directly access or override the Dispose method. You use a destructor (dtor) and a finalize destructor in your C++/CLI code. You explicitly dispose of the object's resources by using "delete". Since the finalize destructor does not get called if you use "delete", you should call the finalize destructor explicitly from the destructor if you have clean up code in the finalize destructor.
ref class Test
{
public:
~Test()
{
// free all managed and unmanaged resources and memory
}
protected:
!Test()
{
// free all unmanaged resources and memory only
}
};
|
|
|
|
|
I don't know how to window form in C++, because i never lernt @ college. I want to make an application where i create some textbox in windo form, it will display an result for e.g text1 = text2 * text3 . just the basic idea to make so that I can understand little bit of it
|
|
|
|
|
Do you want to use managed C++, or did you want to use MFC ? What version of the C++ compiler do you have ?
Christian Graus - C++ MVP
|
|
|
|
|
not to sure what is the diffrence is I thing MFC, I am using visual C++.net platform
|
|
|
|
|
If you have VC++2005 Express Edition, MFC is not an option, and really .NET is the only option you have.
Christian Graus - C++ MVP
|
|
|
|
|
i don't have VC2005 but i have vc2003
|
|
|
|