|
if you need quick access to all pixels, you'll need to use GetDIBits . that will give you a DIB, which is a BITMAPINFOHEADER struct followed by the pixel data - vertically flipped, probably stored in BGR order (maybe BGRA depending on your video driver), with pixel rows padded to multiples of four bytes.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
Look for [GetDIBits] api!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ANother way would be to select the bitmap into a DC and use GetPixel()
If you vote me down, my score will only get lower
|
|
|
|
|
Roger Allen wrote:
DC and use GetPixel()
How?? I believe we first have to paint the Bitmap into Window then we can use GetPixel() method!
is there is any direct method to do so!if yes please tell!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
A bitmap only needs to be selected into a DC for you to access it. Here is some example code extracted from my OD menu class:
COLORREF backgroundColour = 0;
{
CDC dcCopy;
dcCopy.CreateCompatibleDC(NULL);
dcCopy.SaveDC();
dcCopy.SelectObject(&toolbarBitmap);
backgroundColour = dcCopy.GetPixel(0, 0);
dcCopy.RestoreDC(-1);
dcCopy.DeleteDC();
}
If you vote me down, my score will only get lower
|
|
|
|
|
thanks i am looking for it quite long time!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hello everybody, i have a simple questions i think, but i don't know the answers:
Before all, i have to say that i have create a andministrator and an limited user account.
But my questions are:
1) If we add a shortcut to the Start Menu | Programs | Start Up of our application but in the administrator account. It will starts to work if for example we log in in the WXP with the limited account. And if it starts to run, we can prohibite to the limitate account to don't stop the application?
2) If we add a entry in the registry to start our application, how we can stop to the user to don't delete this entry in the registry?
Thank u for the possible help.
|
|
|
|
|
Hi,
My SDI program was opening all saved files , that was saved by it ( in its Extension).
Error Message displayed by program is "Unexpected file format"
I made a Change in Serialize variables ( i added one more)
Now the Program is not opeing old Saved Files.
But it can open Newly made and saved files after changing.
Any suggestion?
Regards.
|
|
|
|
|
you need to find a way to distinguish old-format files from new-format files.
one way is to use the version info in the Serialization object:
IMPLEMENT_SERIAL (CFoo, CObject,VERSIONABLE_SCHEMA|XXXXX)
void CFoo::Serialize( CArchive& ar )
{
CObject::Serialize( ar );
if ( ar.IsStoring() )
{
...
}
else
{
int nVersion = ar.GetObjectSchema();
switch(nVersion)
{
case 2:
read new version data
break;
case 1:
read data for that version
break;
case 0:
}
}
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
But i have the following
IMPLEMENT_SERIAL (CFoo, CObject, 1)
For both Old one and for new one that has the add one more serialize vriable.
Will not it return same for
int nVersion = ar.GetObjectSchema();
If it will , then how can i handle it.
thanx
Regards.
|
|
|
|
|
zahid_ash wrote:
For both Old one and for new one that has the add one more serialize vriable
you have to change the version number when you change the schema.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
thanx i understand it. i will try on it
one more thing In
IMPLEMENT_SERIAL (CFoo, CObject,VERSIONABLE_SCHEMA|XXXXX)
is it neccesry to write VERSIONABLE_SCHEMA or only an integer is enough
as i did
IMPLEMENT_SERIAL (CFoo, CObject, 1)
thanx
Regards.
|
|
|
|
|
according to the MSDN on GetObjectSchema:
A CObject-derived class may use VERSIONABLE_SCHEMA combined (using bitwise OR) with the schema version itself (in the IMPLEMENT_SERIAL macro) to create a “versionable object,” that is, an object whose Serialize member function can read multiple versions. The default framework functionality (without VERSIONABLE_SCHEMA) is to throw an exception when the version is mismatched.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
HI
In my IMPLEMENT_SERIAL is as follows for both old and new versions:
IMPLEMENT_SERIAL (CFoo, CObject, 1)
then
int nVersion = ar.GetObjectSchema();
is returning -1 that means version is unknown .
now how can i distinguish the versions..
thanks
Regards.
|
|
|
|
|
|
|
How do I make use of the Microsoft Excel class from my C++ class component to dynamically load and process an excel sheet?
|
|
|
|
|
The Fun begins! LOL
You need to use the Excel Object model.
Search the MSDN for these KB's.
KB309301
KB194906
KB308407
KB307473
Just to name a few. These should help get you started. You can also search on "Excel Object Model".
Good Luck!
Larry J. Siddens
|
|
|
|
|
Hello
Can any one tell me how i can change my console display mode to full screen mode in a dos based c++ program.
We Believe in Excellence
|
|
|
|
|
You will have to use the SetConsoleWindowInfo function to set the size. But before that you have to use functions like GetConsoleWindow, GetConsoleScreenBufferInfo for the actual effect to take place.
|
|
|
|
|
Hi all,
I want to get through a proxy server which needs NTLM authentication.
I want to know the following:
1) Username and password (IE and FF can do this without interacting with the user)
2) How to set up the headers
I am using WinInet (CInternetSession).
Thanks!
Geert
Want to spread the newest version of your software automatically? Use Updater!
Visit my website: http://geert.yoki.org
|
|
|
|
|
Greetings,
I am getting the following warnings. I have some classes whch overide the Create function, but with very different arguement lists. Somehow though the compiler thinks they might be meant to be the same.The arguement lists look very different to me, how can it be assuming they are smiliar?
thanks in advance,
Aristotel
<br />
BOOL Create(CWnd* pParentWnd, const RECT& rect, UINT nID, DWORD dwStyle , int nMinVal, int nMaxVal);<br />
warning #1125: function "CWnd::Create(LPCTSTR={LPCSTR={const CHAR={char} *}}, LPCTSTR={LPCSTR={const CHAR={char} *}}, DWORD={unsigned long}, const RECT &, CWnd *, UINT={unsigned int}, CCreateContext *)" is hidden by "CLevelMeter::Create" -- virtual function override intended?
BOOL Create(CWnd* pParentWnd, const RECT& rect, UINT nID, DWORD dwStyle /*=WS_VISIBLE*/, int nMinVal, int nMaxVal);
<br />
BOOL Create(CWnd *pParentWnd, const RECT &rect, UINT nID, DWORD dwStyle);<br />
warning #1125: function "CWnd::Create(LPCTSTR={LPCSTR={const CHAR={char} *}}, LPCTSTR={LPCSTR={const CHAR={char} *}}, DWORD={unsigned long}, const RECT &, CWnd *, UINT={unsigned int}, CCreateContext *)" is hidden by "CMultitapControl::Create" -- virtual function override intended?
BOOL Create(CWnd *pParentWnd, const RECT &rect, UINT nID, DWORD dwStyle);
Edit/Delete Message
|
|
|
|
|
Try putting virtual in front of the declaration.
EX:
virtual BOOL Create(CWnd* pParentWnd, const RECT& rect, UINT nID, DWORD dwStyle /*=WS_VISIBLE*/, int nMinVal, int nMaxVal);
Hope this helps.
Larry J. Siddens
|
|
|
|
|
Hi Larry,
Unfortunately that didn't do it. Very strange...such a different arguement list yet it thinks its meant to be an over ride...hmmm...
Do let me know if any other ideas come arround. I will keep looking as well.
Thanks,
Aristotel
|
|
|
|
|
Email me your code (all that I need is for compiling) and I will take a look.
Larry J. Siddens
|
|
|
|