|
Thanks. It is a lot easier than it seems.
-Matt Newman
-Matt Newman
|
|
|
|
|
I have a DIB where I need to access the pixel values so I can read and write to them. I have tried using CreateDIBSection but that doesn't seem to give me a pointer to the original image but rather an entirely new image. Is there some way to get create a pointer to the pixel data of the original DIB?
Please Help,
Clint
|
|
|
|
|
Is it a DIB or a DIBSection ? If the latter, just use GetObject.
DIBSECTION dib;
GetObject(hBitmap, sizeof(DIBSECTION), dib);
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
What I have is a DIB that I get back from a third party DLL. It takes a raw buffer, decompresses it and sends back a 24-bit dib. I want to be able to now go in and access the original bits so I can modify them ( sharpen/ motion detection) as quickly as possible. Then draw them on the screen quickly afterwards.
Please Help,
Clint
|
|
|
|
|
see the MSDN for BITMAPINFOHEADER . you have to understand how DIBs are setup, in order for you to be able to get at the pixels.
here it is in a nutshell:
a 24 bit DIB (one of the simplest of the DIBs) is usually a chunk of memory that starts with a BITMAPINFOHEADER structure. immediately after that struct are the pixel bytes.
pixel rows are generally stored in a bottom-up order, so the first pixel byte is the bottom-left pixel. (top-down DIBs have a negative height).
pixel rows are always a multiple of four bytes wide; they have padding bytes at the end, if necessary, to make the total number of row bytes equal to a multiple of four.
pixels are stored BGRBGRBGR... (Blue, Green, Red). three pixels per byte, no padding between pixels (except at row ends, when necessary).
-c
http://www.smalleranimals.com
|
|
|
|
|
I know some programs automatically start when the Windows OS is launched, but they are not in the Startup menu. The best I've been able to figure out so far is that it is a registry addition you must make to load your program. Where should I be looking for more information about this?
Thanks,
-Jason
|
|
|
|
|
There's two - Run and RunOnce ( which runs the program then deletes the entry ). I dunno where they are, I always find them by searching for 'RunOnce'.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
"Don't belong. Never join. Think for yourself. Peace"
- Victor Stone
|
|
|
|
|
Put it in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run if you want it for all users
Nish
|
|
|
|
|
Hello. Thanks for responding so quickly. I've got a followup question:
<br>
CRegKey key;
<br>
key.Open(HKEY_LOCAL_MACHINE, "\\Software\\Microsoft\\Windows\\CurrentVersion\\Run");
key.SetKeyValue("Igloo", "foo");
key.Close();
This tends to ASSERT. Do you immediately spot anything wrong with the method I'm using to add a Name "Igloo" and a value "foo" (which will be the program's filespec.)
-Jason
|
|
|
|
|
I'd say the \\Software\\... should be just Software\\.....
A vast majority of our imports comes from outside the country.
George W. Bush
|
|
|
|
|
In Win2000 in the control panel there is Scheduled Tasks. You can set this up there. It may just make the registery entry for you... but it is easy.
|
|
|
|
|
Not so much of a problem, since i've fixed it now with a workaround. But i am interested as to exactly why it happened.
I created a custom button, derived from cbutton (obviously). I overrode the drawitem function and a few others to do some mouseover effects. The button was drawn to look exactly the same as a standard windows 9x button. I wanted to create a highlight when the user clicked on the button. So, before drawing the rectangle for the border of the button, i created and selected a lighter grey brush for the highlight;
if(lpDrawItemStruct->itemState & ODS_SELECTED)
{
Create and select much lighter gray brush
Draw rectangle
Delete the brush
}
The problem is, when i release the mouse button, the lighter gray brush is still drawn, even though the button isn't selected. It stays there until the cursor moves out of the button's rectangle. Therefore, when drawitem is called, it can't be going through the above if since itemState is not going to contain ODS_SELECTED . I also checked this using TRACE . Anyone know why? It's probably blindingly obvious, but it's getting late and my head hurts.
My workaround was to invalidate the button during OnLButtonUp().
Simon
|
|
|
|
|
When I call CRichEditView::InsertFileAsObject, I can't figure out how to resize the file icon that appears in the rich edit control. I've tried overriding such things as COleContainerItem::OnGetItemPosition and calling COleContainerItem::SetItemRects, but either they do nothing or cause assertions. Thanks for the Help.
|
|
|
|
|
Does anyone know where I can download the Debug symbols for Windows XP? Or is it part of the platform SDK? If so, is there a way to download that information independent of the other information on the SDK?
Thanks in advance for any answer. Sorry if this sounds all dicombobulated, had too much coffee trying to figure out a problem I'm having. :-|
Sam C
----
Systems Manager
Hospitality Marketing Associates
|
|
|
|
|
What's the easiest way to get IE browser version? I'm using: The "Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++" called CWebBrowser2, and the IWebBrowser2 interface.
|
|
|
|
|
I think the most reliable way is to read the version resource (or call DllGetVersion) in shdocvw.dll. 4.71.* is IE 4, 4.72.* is IE 4.01, 5.* is IE 5, and 6.* is IE 6.
--Mike--
http://home.inreach.com/mdunn/
This posting is provided "as was" with no warranties, guarantees, lotteries, or any of those little bags of peanuts you get on planes. You assume all risk for crossing the street without holding mommy's hand. © 2001 Mike's Classy Software. Member FDIC. If rash develops, discontinue use.
your with and
|
|
|
|
|
My program uses OpenGL to animate in a window. But when that window is minimized the pictures still remain on screen and still animate. Does anyone know how to get rid of this problem.
|
|
|
|
|
You need the CS_OWNDC flag when you create the opengl window.
Todd Smith
|
|
|
|
|
do you know were to place the CS_OWNDC
|
|
|
|
|
the reason I ask is because I placed it at the precreatewindow() and it does not work
|
|
|
|
|
struct a
{
double Val1;
double Val2;
double Val3;
}
how do I overload the operator (+,-,*,/) and (+=,-=,*=,/=,=)
I know that I will be something like
a a::operator + (a paramA1,a paramA2)
{
paramA1.Val1 += paramA2.Val1;
paramA1.Val1 += paramA2.Val1;
paramA1.Val1 += paramA2.Val1;
return paramA1;
}
but for the X= (+=,-=...)
I want it clean... and I was'nt able to find the ABC of overloading operator's the rules and the basis.
thanks
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
I was'nt able to find the ABC of overloading operator's the rules and the basis.
Where did you search?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
in msdn...
I've found that I can overload many operator, += << etc.
and I cannot overload . :: ?:
but no example, for a struct, a class, they said that we can define them as global but when I tried to do it with the = operator.. it didn't work (I've uderstand that I need "this->data"). So, what I want it's the philosophy, my overloaded operator work but I don't think it's the way to do that...
struct AStruct
{
double data[100];
AStruct &AStruct::operator= (AStruct paramA);
};
It's a very beginner info I know but "overloading operator" I'm Ok, but do it well... it's may be an other thing
Remi Morin
Rmorin@Operamail.com
Remi.Morin@Lyrtech.com
|
|
|
|
|
You should read some good C++ book first - 'C++ Language' by Stroustrup or 'Effective C++' by Meyers.
You should pass AStruct by const reference. It's much more effective than passing by value, which involves calling a copy constructor. This applies to all operators and 'normal' functions as well.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|