|
Each pixel is COLORREF value. sizeof(COLORREF) is 24.
24/3=8. It means, that you can describe each pixel with three 8-bit values. So, naturally, you have only 24-bit dib in bitmap pixel array. And it is true.
yiy
|
|
|
|
|
8-bit and 16-bit dibs are indexed, they are not rgb values. Read all about them in the Petzold.
|
|
|
|
|
I do not works with DIB,
just need correctly proceed 24 and 32 bit BITMAPS only.
Do you think despite all samples did for bitmap,
DIB much better dor speed and suitability?
|
|
|
|
|
just need correctly proceed 24 and 32 bit BITMAPS only.
Well yeah but you mentioned 16-bit bitmaps so I figured I'd correct that...
As for ddb vs dib, I find it easier to work with ddb's (they're faster too) but when you have a very large bitmap you may run out of video memory... It all depends on your application, basically.
|
|
|
|
|
Hi everyone,
I wanted to know if someone could help me. I have a project with three different classes for three different dialogs(3 .cpp files). I have a variable that the user enters, which is in one of the classes (dialogs). I want to use that same variable with the stored information in my other dialog(class). How do I do that?
Someone told me to pass a pointer, but i don't know how to exactly do that cause i get some error when i run the program.
Thanks for helping me.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
1) You can declare your variable in global scope.
2) You can use pointer to the variable in the first class in the last two classes.
yiy
|
|
|
|
|
How would I use a pointer to the variable in the class so that the other classes could use it? Can you help me with this. I am new to programming, and am trying to teach myself with a book. (i'm only 15)
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
I think, that the better way to do this is declare m_var as static variable. After that you can use this variable as CL1::m_var.
------------------------------------------------------------
class CL1
{
public:
CL1(); //constructor
virtual ~CL1(); //destructor
public:
static int m_var; //your variable
public:
void SetVariable(int value)
};
CL1::m_var=0; //linking will fail without this.
CL1::Cl1()
{
}
CL1::~CL1()
{
}
void CL1::SetVariable(int value)
{
m_var=value;
}
#include <iostream.h>
using namespace std;
int main()
{
CL1 myclass;
int user_val;
cin>>user_val;
myclass.SetVariable(user_val);
cout<<"After input "<
|
|
|
|
|
Hello,
the following should work:
In the dialog class add the following:
private:
VarType m_Var;
public:
VarType GetVar() {return m_Var;}
In the other classes at a point where you want to use the var add
VarType var = YourClass.GetVar();
this should do the trick!
Good luck!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Hi,
I have a list of _bstr_t, and I'm trying to sort it using the cool features of STL ( this pred method, to make the sort I need an special compare, first removing two characters), my code looks something like:
Definition:
<br />
typedef std::list<bstr_t> CList;<br />
<br />
CList m_Files;<br />
<br />
bool pred(const bstr_t &x, const bstr_t &y);<br />
Predicate: ( just some silly test first)
<br />
bool pred(const bstr_t &x, const bstr_t &y)<br />
{<br />
return true;<br />
}<br />
Call:
<br />
std::sort(m_Files.begin(), m_Files.end(), pred);<br />
And the error that it gives me:
error C2784: '_Distance __cdecl _STL::operator -(const class _STL::reverse_iterator<_RandomAccessIterator,_Tp,_Reference,_Pointer,_Distance> &,const class _STL::reverse_iterato
r<_RandomAccessIterator,_Tp,_Reference,_Pointer,_Distance> &)' : could not deduce template argument for 'const class _STL::reverse_iterator<_RandomAccessIterator,_Tp,_Reference,_Pointer,_Distance> &' from 'struct _STL::_List_iterator<class _bstr_t,s
<="" small="">
, I know... all the thing that only have three letters are not compatible between them... ATL ... STL ... MFC... COM
Thanks in advance, greetings
|
|
|
|
|
If CP hasnt filtered out your template parameters, then you need to do something like this:
typedef std::list<CString> CList;
Apologies if this is what you entered initially!
|
|
|
|
|
Hi,
Sorry.. but I'm using ATL... son not CString
|
|
|
|
|
std::list has its own sort() function, since std::sort() uses a random access iterator (and random access in a list is expensive).
- Mike
|
|
|
|
|
|
Please tell me how to rename the "OK" and "Cancel" button in a property sheet dialog and also how to rename the property pages in the sheet.
|
|
|
|
|
You could try OK or Cancel
CPropertySheet oProp("Title");<br />
CWnd *pWnd = oProp.GetDlgItem(IDOK);<br />
<br />
if(::IsWindows(pWnd))<br />
pWnd->SetWindowText("button text");
you could rename the property page by changing the properties page resource's properties - caption. Or you could try .SetWindowText(..);
By the way, you need to set your propertypage to be premature exist by
CPropertyPage.m_psp.dwFlags |= PSP_PREMATURE;
I did not test the codes. Hope it works.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
- Create a class derived from CPropertySheet.
- Override the virtual function OnInitDialog()
<br />
BOOL CMyPropertySheet::OnInitDialog() <br />
{<br />
BOOL bResult = CPropertySheet::OnInitDialog();<br />
<br />
CWnd *pWndOk = this->GetDlgItem(IDOK);<br />
if (pWndOk != NULL)<br />
{<br />
pWndOk->SetWindowText("&Save");<br />
}<br />
<br />
pWndOk = this->GetDlgItem(IDCANCEL);<br />
if (pWndOk != NULL)<br />
{<br />
pWndOk->SetWindowText("&Quit");<br />
}<br />
<br />
return bResult;<br />
}
|
|
|
|
|
I've got a problem for CTabCtrl display
I created a CTabCtrl and let the tabs be shown at the bottom, it has problem to display visual styles in Windows XP. The Tabs won't be drawn correctly... anyone can help me out?
Thanks a lot
Kyle Chen
|
|
|
|
|
I have applied XP visual styles to CTabCtrl by using "*.manifest" file. The tab control has same look in the top of window and in the bottom of window.
Ask me more detailed, please, probably I can help you.
yiy
|
|
|
|
|
Thanks to Babayan. Maybe I should describe the problem in detail.
I can show the Visual Style to the Tab Ctrl and it works fine when the tab is on the top position. However I'd like display the tab at the bottom, in which case, the tab should be turn over (up to down from the top tab). But actually it still the same as when it's on the top - the highlight organge bar is still on the top.
You've got it?
PS. Can I past image here?
Kyle Chen
|
|
|
|
|
and maybe see links (and sometimes links into links) into
http://www.codeguru.com/forum/showthread.php?s=&threadid=260836
t!
|
|
|
|
|
Thank you, Tibor. I've read the post there but didn't find the treatment to my problem.
Kyle Chen
|
|
|
|
|
oops, rereading your question my sorry, i mixed it with my old z-order problem
t!
|
|
|
|
|
can anyone help me in image processing project that is thumb recoginition
Faizi
|
|
|
|
|
See GDI+ graphic library from Platform SDK. I remember, I have seen some such code here.
yiy
|
|
|
|