|
if that handle is really a pointer to a DIB, then it's a pointer to an BITMAPINFOHEADER, with the pixel bytes immediately following.
|
|
|
|
|
It's most unlikely that you would want to convert it to a char* array. If it is really a pointer to some form of bitmap then there should be a function that will return the actual bitmap structure or byte array for you, but without knowing anything about the SDK you are using it's impossible to know what.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thank you all for your response i have been able to create a
HBITMAP from my DIB
HANDLE DIB by using info header and filling it using GDI . I also have been able to save it to my disk and to draw it on screen by using
StretchDIBits method of the same library.Conversion of DIB to char* was not a good option.Now i want to know that is there any other good API or C++ library which can be used to draw DIB directly on
tagRect in an MFC application.
|
|
|
|
|
StretchDIBits() already performs that function; what do you mean by tagRect ?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
It is a structure which draws a rectangle in windows applications.
The problem with that method is that when i minimize my application and again restore it. The image disappears. I have also used the function
FillRect() but the problem still persists.
Kindly help me in this regard
|
|
|
|
|
AhmdAxf wrote: when i minimize my application and again restore it. The image disappears. So, you are probably doing something wrong, quite possibly drawing in the wrong place. You must put all your drawing code inside the function that handles the WM_PAINT message.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Actually it is not a MFC application which does have a method which contains WM_PAINT message.
Rather it is a java applet and I'm drawing through AWT native Interface.
|
|
|
|
|
So why was this posted in the C/C++/MFC forum and titled "Conversion of image Handle hDib to Char* array in C++"?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
There is no separate forum for c++ or AWT native interface or JNI. So I have to post it here
|
|
|
|
|
Please Let me know if there is any useful forum for this particular technology
|
|
|
|
|
There are clearly marked forums here for Java and for C++; choose the one that is most appropriate to your problem and describe the problem in detail.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
how to creat a R-Tree based on GIS.spatial object,if I know the MBR of each spatial object.how I can Know when to merge some MBR together?
|
|
|
|
|
Google and Wikipedia are fantastic tools, you know.
For instance, the R-Tree page[^] at Wikipedia looks promising.
Veni, vidi, vici.
|
|
|
|
|
|
You are welcome.
Veni, vidi, vici.
|
|
|
|
|
Hi everybody,
This is for the more advanced people!
I know that the DirectX9 D3DXIntersect function has the ability to gives the exact coordinates of the intersecting ray-to-polygon, and can give the distance from the ray’s starting point to the intersection point.
Now my question is, how do I retrieve that information of the exact coordinates of the ray’s intersecting point?
I think the information if I’m not mistaken is found in the LPD3DXBUFFER * ppAllHits, but I’m not sure as to how to setup the buffer, nor access the information.
Please help… Thanks!
HRESULT D3DXIntersect(
LPD3DXBASEMESHpMesh,
CONST D3DXVECTOR3 * pRayPos,
CONST D3DXVECTOR3 * pRayDir,
BOOL *pHit,
DWORD * pFaceIndex,
FLOAT * pU,
FLOAT * pV,
FLOAT * pDist,
LPD3DXBUFFER * ppAllHits,
DWORD * pCountOfHits);
____________________________________________
My variables and code:
Note: My code works great.
I just need help with getting and returning the exact coordinates of my ray’s intersection with the mesh.
____________________________________________
float XBegin, float YBegin, float ZBegin; float XEnd, float YEnd, float ZEnd; sMesh *LevelMesh;
BOOL Hit;
float u, v, Dist;
float XDiff, YDiff, ZDiff, Radius;
DWORD FaceIndex;
D3DXVECTOR3 vecDir;
while(LevelMesh != NULL) {
D3DXIntersect(LevelMesh->m_Mesh, \
&D3DXVECTOR3(XBegin,YBegin,ZBegin), &vecDir, \
&Hit, &FaceIndex, &u, &v, &Dist, NULL, NULL);
if(Hit == TRUE) {
if(Dist < Radius)
return TRUE; }
return FALSE; }
|
|
|
|
|
Hmm, I know there are some smart coders out there! anyone?
|
|
|
|
|
First of all, i am new to c++. I am using Netbeans IDE with mingw compiler (as i am familiar with it in java development). I want to add a new library (some thing like port audio). I have copied the include files in the port audio to mingw's include library. Code suggest in netbeans is showing the headers and functions of port audio, But the build process showing erros like
undefined reference to `Pa_Initialize'
On the whole, what ever may be the IDE or what every may be the library to add, What to do inorder to add a library to build process??
|
|
|
|
|
This is really not a C++ question, rather one of how to use NetBeans. You should look at the project settings section of your project, where there should be some way of adding the reference to the library you are trying to use. Failing that you could try the NetBeans forum (if such a thing exists).
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
C++ has to parts.
- Compiling
- Linking
Header files are using in compiling.
Libraries are used in linking.
If you are getting a compile error then there is something wrong with your includes.
If you are getting a link error then there is something wrong with your libraries OR something wrong with the way in which you used the includes. The latter is often caused by incorrectly using C code (from the library) in C++ code.
For the most part it should never matter what order libraries are in.
|
|
|
|
|
@jschell
Thanks for your response, And i just want to know one more thing. So, to add a library to build path, we must have the header files (.h) and also library files(.dll on windows)of that library. isn't it ?
|
|
|
|
|
You must specify both somewhere. And it will be in different locations.
|
|
|
|
|
hi,
i am using multiple Check Boxes in my GUI and i wanted that only one gets checked at a time i.e when one Check Box gets checked by user the others should automatically get unchecked.
i can't use Radio Buttons since i don't find its "Auto" check and uncheck from "Behavior" in its "Properties" in vs2008.
any help in this regards please.
Regards
Jawad
|
|
|
|
|
OnBnClickedCheckXXX() -> uncheck all checkboxes programtically and check "CheckBoxXXX" .
Or write new function and pass control handle of check box to be checked, then inside that function uncheck all , then check passed check box.
|
|
|
|
|
thank you sanjaylk. it really helped.
Regards
Jawad
|
|
|
|