|
Richard Perrine wrote: example code that analyzes the colors in a bitmap
Define 'analyze'. To just gather colours, I'd probably go through the bitmap a pixel at a time and store the RGB triplet for each pixel into a std::set . That would make it easy enough to get a list of the unique colours in the bitmap.
To cull the colours to a smaller number (as required if you want to define a fixed palette for the image), you'd use some form of colour quantisation[^].
Richard Perrine wrote: code that organizes the colors sampled into a palette of 16x16 or 32x32
Maybe you can get some ideas from this color picker control[^]? The source is available.
|
|
|
|
|
|
|
Hi,
I want to use an explorer in my program (it's a C++ program) which is under Windows CE platform. I want to know that is it applicable or not? If yes, does any body know how can I do it?
(If here is not a right forum, Sorry, I don't know under which topic I should write my question)
Thanks a lot
Sincerely Yours
Miss_F
|
|
|
|
|
Miss_F wrote: an explorer
What do you mean by 'an explorer'? If you mean manipulating the filesystem/namespace using explorer interfaces like IFolderView [^], then I suspect you're out of luck. If you mean a treeview, then you should be OK[^].
|
|
|
|
|
I mean adding Internet browsing (using browser) functionality to my application.
|
|
|
|
|
|
|
A trackBar->Value in a form has to be read out from a thread. I read so many articles, but still I got a problem.
I use a delegate which should return me the value of the trackBar position:
delegate int DelegateTrackBarCallBack(System::Object ^object);
I started the Thread by a ParametriziedThreadStart after a Button-Click
Thread^ oThread = gcnew Thread(gcnew ParameterizedThreadStart(&ProcessCANMessage::CAN_Thread::CANThread));
In CANThread I do
target_velocity=Get_TrackBar1_Value(object);
with
int ProcessCANMessage::CAN_Thread::Get_TrackBar1_Value(System::Object^ object)
{
CAN_Anbindung::Form1^ form;
form = (CAN_Anbindung::Form1^)object;
int trackBar_Value;
if (form->trackBar1->InvokeRequired==false)
{
trackBar_Value=form->trackBar1->Value;
}
else
{
CAN_Anbindung::Form1::DelegateTrackBarCallBack ^d = gcnew CAN_Anbindung::Form1::DelegateTrackBarCallBack(Get_TrackBar1_Value);
form->Invoke(d, gcnew array<system::object^>{form});
}
return (trackBar_Value);
}
During debugging the correct value is assigned to trackBar_Value. But when leaving Get_TrackBar1_Value trackBar_Value is set to "0".
Any ideas what to do?
|
|
|
|
|
Member 3919138 wrote: Any ideas what to do?
Post to the C++/CLI[^] forum, as that's what you're using?
From what I can understand of your message, you're expecting trackBar_Value to keep its value in two different invocations of Get_TrackBar1_Value ? Nope - local variables don't do that unless they're static. However - doesn't Invoke return the return value of the delegate? So you could do something like this?
trackBar_Value = form->Invoke(d, gcnew array<system::object^>{form});
You might need some casting to convert Invoke 's return value from System::Object to int - wouldn't know - I've never really used .NET, never mind C++/CLI.
|
|
|
|
|
I tried this befor
I got an error
1>.\ProcessCANMessage.cpp(74) : error C2440: '=': 'System::Object ^' kann nicht in 'int' konvertiert werden
|
|
|
|
|
Did you convert as shown in this article[^]?
int z = 44;
Object^ o = z;
int y = *reinterpret_cast<int^>(o);
|
|
|
|
|
I will try that. Thanks for your answers and help!
I used a code which shown in one of the articles from this forum which helps to control 4 Progressbars in a Form from 4 Threads.
See: http://www.codeproject.com/KB/mcpp/managedsafethreads.aspx[^]
It works fine, since the delegate function seems to be recalled until the InvokeRequired-property is false. in this case the progressbars can be controlled directly in the thread by "form->progressBar1->PerformStep();"
In my case I want to get the Value (Position) of the trackBar-component. So if the delegate function is called 2 times we have a recursive calling of the same function. I assumed that the return value is then overwritten by the previous call of my function "Get_TrackBar1_Value(object)".
I will let you know about the result.
|
|
|
|
|
Everything is working fine...
Thanks again!
|
|
|
|
|
Hi,
i m taking help from
http://www.codeproject.com/KB/dialog/wizard2000.aspx[^]
article its very gud article of wizard.
i m having 8 pages,there are no. of controls present.
if i run the application than its works fine but after some its look like hang or its not responding.
i m checking the memory usage from task manager than i have noticed that in thisapplication when i reached the last page of wizard the the memory of application constant.
but in my application after reached on last page,if i coninously click on back or next button than memory is still increase i think thats why it becomes not responding and looks like hang the applicaton.
please help me for this.
i m waiting for your reply.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Seems you have the problem mentioned here[^]
|
|
|
|
|
In this example property sheet not use to add property pages.
here the class is used for add pages is derived from CDialog base type class.
now what can i do.
please help me for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
|
AnithaSubramani wrote: Is it possible the listener for menu bar in MFC?
Listener??? What do you mean?
|
|
|
|
|
Are you wantig to write a hook? That's the closest thing I can imagine...
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Do you mean you want to handle user clicks on menu entries?
|
|
|
|
|
Hello,
I'm writing an add-in in for Visual Studio in C++ and need to get access to the DebuggerEvents in Visual Studio. See here for a description: http://msdn.microsoft.com/de-de/libr...s_members.aspx . Especially I need to receive events from "OnEnterBreakMode". Unfortunately all these methods are marked as "internal use only". There is also no definition in the headers.
The interesting part is, that I can access and get notification from all these events within C# without any problem. (C# reference on DebuggerEvents: http://msdn.microsoft.com/de-de/libr...us,VS.71).aspx) So how can I manage to access the DebuggerEvents in C++?
thanks for your help in advance!
Peter
modified on Saturday, January 24, 2009 4:53 AM
|
|
|
|
|
hi,
i am trying to transparent the dialog with color using this code. I included the windows.h and winuser.h
<pre>
SetLayeredWindowAttributes(GetSafeHwnd(),RGB(10,34,56),10,(LWA_COLORKEY|LWA_ALPHA));
</pre>
But it gives following error.
\\ITD254\VCC\Notes\NotesDlg.cpp(168) : error C2065: 'SetLayeredWindowAttributes' : undeclared identifier
\\ITD254\VCC\Notes\NotesDlg.cpp(168) : error C2065: 'LWA_COLORKEY' : undeclared identifier
\\ITD254\VCC\Notes\NotesDlg.cpp(168) : error C2065: 'LWA_ALPHA' : undeclared identifier
what i have to do
Ganesh
|
|
|
|
|
Which version of visual studio are you using? Have you set win version (_WIN32_WINNT ) to 0x0501 ?
|
|
|
|
|
vc 6.0 and i tried #define WINVER 0x0500
Os- winxp
|
|
|
|