|
Then you might want to check the return value.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
I found the main problem but not the solution.
The byte[] 'b' size is alwase 446, and all of the numbers are 0.
Thanks for helping.
|
|
|
|
|
ThinkingCapProductions_MrFluffy wrote: I found the main problem but not the solution.
Might want to pay attention to what i'm trying to point out then.
Look, when you have problems like this, the first step is to break it down. You have a bunch of things that can go wrong, narrow down to the one that is going wrong. If the length of b is 446, then s_length is also 446, and there are 446 bytes stored in your MemoryStream (s ). If all bytes in b have the value 0 , then either the call to Read() is failing or s actually contains nothing but 0 s - so find out: the documentation for Read() specifies that the return value will be the number of bytes read - if that return value is 446... or anything greater than 0... you're successfully reading the contents of the stream into b , and the failure is prior to that. If it's 0, then the call to Read() is failing to read anything and you need to find out why (hint: Seek() back to the start of the stream before trying to read it).
BTW - why are you bothering to write to a MemoryStream rather than just writing directly to your FileStream ?
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
I feel stupid.
'MemoryStream s = new MemoryStream();
k.Save(s);'
The streams position was at the end when I start to read from it, so all I did to fix it was put s.Position=0; to fix it.
Thanks a lot for all the help.
|
|
|
|
|
ThinkingCapProductions_MrFluffy wrote: The streams position was at the end when I start to read from it, so all I did to fix it was put s.Position=0; to fix it.
Ah, good.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
In C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include , there is ddraw.h ,
but where is the correspond .lib file?
There is no ddraw.lib in C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib .
system
|
|
|
|
|
|
system
|
|
|
|
|
Hello ...
i need help with the sample code given by windows SDK.
there is this AMCAP code they provide.
but there seems to be 5 errors of the same type...
C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\ctutil.h(278): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
and the line 278 of ctutil.h displays;
private:
COARefTime (LONG);
operator = (LONG);
};
anyone could help me to solve the error.. or any guidance?
please.
thanks in advance.
-sue.
|
|
|
|
|
|
I have created an application in win32 in VS2005.net framework using direcx 9.0 sdk.The application is also using MFC in shared dll. But this application(created in release mode) is no running to another pc where VS2005.net framework is not available.It gives some dll missing.How can I solve this problem.I also provided all the supported dll.
|
|
|
|
|
You need to install vcredist_x86.exe[^] on the target machine. This will install the C-runtime library and the MFC libraries. If you have the VC service pack 1 installed, you should use this one[^] instead.
|
|
|
|
|
Thank you for your reply
I have already solved the problem.
|
|
|
|
|
I want to display different bitmaps those have different color keys.Suppose I have 3 bitmaps respectively black, red and gray color keys.I have to detect from the bitmap what is its color key.I think pixel 0,0 is its color key.How can I do this? I am new in Directx programming. I have already used CreateTextureFromFileEx function. In this function I have to fix the color key.But I don't know what is the actual color key.I have to take decision from the bitmap file.How is it possible? Please help me.
|
|
|
|
|
What you are trying to do is simple, but DirectX does not have an appropiate function for you to call. The simplest approach would be to just read from memory. Have a look at the MSDN GDI Bitmap Reference[^]
The concept is to load the bitmap into memory (this should exist as one continuous block of memory), by creating a DIB Section (see, Create DIB Section[^]), or similar technique. Then you locate the the pointer value for the actual bitmap bits (this is provided in the header structure), and read the appropiate value.
If all of this is new territory for you, you should probably begin with, Bitmap Creation[^], or, Device Independent Bitmaps[^]
|
|
|
|
|
This is jia.I want to have code in C++ of a human like robot.
Features of the Robot character
Your 3D robot character should have all of the following features and body parts:
1. Torso: Should have at least two parts torso. Upper torso and lower torso.
2. Left and Right leg: Each leg should have at least two parts, upper leg (above knee) and lower leg.
3. Left and Right Arm: Each arm should have at least two parts, upper (above elbow) and lower arm
4. Left and Right Feet
5. Left and Right Hand
6. Neck
7. Head
To make your Robot character look good, you should include the following features for your Robot character:
1. Each body part should have its own OpenGL lighting material property.
2. Each body part should have its own texture.
Features of the program
Your program must contain all of the following features:
1. The scene should also include a floor and a visualized 3D coordinate system.
2. You should be able to use the mouse to change the view angle.
|
|
|
|
|
do your own homework you > on
and try reading the forum rules before you waste our time
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
I could find topic on applying skins in applications developed in .Net Framework 3.0 and higher using the WPF. But i need to apply it in .Net Framework 2.0 using C#. Can anyone give me hint or some sort of sample code on how to apply skin.
Ur help will be really appreciated.
Thanx in advance.
|
|
|
|
|
|
Mr. Adams,
First of all thank you for the quick reply. I will definitely go though ur articles and try to learn as much as I can. I am hopeful that they are going to be of great help for me in trying to skin desktop application.
I also hope it helps .
Regards Sudyp
|
|
|
|
|
Mr. Adams,
I went through the article in the link you posted in reply to my query. The article is great. May be it will be helpful for me in the future.
I could only see things about WPF and its uses in data visualization.
Currently I need to skin application in .Net Framework 2.0. So, I guess, I need to keep on looking further on other articles to get some help on it.
Thank you
Regards Sudyp
|
|
|
|
|
Goto http://www.skinengine.com
|
|
|
|
|
I'm trying to figure some memory issues with wglUseFontBitmaps .
When setting the "hardware acceleration" to none in the display settings:
In our legacy software, when using wglUseFontBitmaps there is a lot of "Virtual Memory" (in the task manager) being eaten up (600megs!).
When doing the same thing in a test program, I get around only 40 megs for the same fonts (size and pitch and weight, ... ).
Are there factors that can affect the virtual memory footprint of my application in regards of OpenGL bitmap fonts ?
Here is our pixel format of OpenGL (simple, basic and straightforward)
bool bErrFound = false;
PIXELFORMATDESCRIPTOR pixelDesc;
pixelDesc.nSize = sizeof(PIXELFORMATDESCRIPTOR);
pixelDesc.nVersion = 1;
pixelDesc.dwFlags = dwFlags;
pixelDesc.iPixelType = PFD_TYPE_RGBA;
pixelDesc.cColorBits = 24;
pixelDesc.cRedBits = 0;
pixelDesc.cRedShift = 0;
pixelDesc.cGreenBits = 0;
pixelDesc.cGreenShift = 0;
pixelDesc.cBlueBits = 0;
pixelDesc.cBlueShift = 0;
pixelDesc.cAlphaBits = 0;
pixelDesc.cAlphaShift = 0;
pixelDesc.cAccumBits = 0;
pixelDesc.cAccumRedBits = 0;
pixelDesc.cAccumGreenBits = 0;
pixelDesc.cAccumBlueBits = 0;
pixelDesc.cAccumAlphaBits = 0;
pixelDesc.cDepthBits = 16;
pixelDesc.cStencilBits = 0;
pixelDesc.cAuxBuffers = 0;
pixelDesc.iLayerType = PFD_MAIN_PLANE;
pixelDesc.bReserved = 0;
pixelDesc.dwLayerMask = 0;
pixelDesc.dwVisibleMask = 0;
pixelDesc.dwDamageMask = 0;
int iPixelIndex = ::ChoosePixelFormat( hDC, &pixelDesc );
if( iPixelIndex == 0 )
{
iPixelIndex = 1;
}
if( ::DescribePixelFormat( hDC, iPixelIndex, sizeof(PIXELFORMATDESCRIPTOR), &pixelDesc) != 0 )
{
if( !::SetPixelFormat( hDC, iPixelIndex, &pixelDesc ) )
bErrFound = true;
}
else
bErrFound = true;
and the fonts are created like this (one of 6 font)
strcpy(logfont.lfFaceName, "Arial");
logfont.lfHeight = 24;
logfont.lfWidth = 0;
logfont.lfEscapement = 0;
logfont.lfOrientation = logfont.lfEscapement;
logfont.lfWeight = FW_NORMAL;
logfont.lfItalic = FALSE;
logfont.lfUnderline = FALSE;
logfont.lfStrikeOut = FALSE;
logfont.lfCharSet = ANSI_CHARSET;
logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
logfont.lfQuality = DEFAULT_QUALITY;
logfont.lfPitchAndFamily = FF_DONTCARE | DEFAULT_PITCH;
hBigFont = CreateFontIndirect(&logfont);
if ( hBigFont == NULL)
{
glLargeFontBitmapListBase = 0;
}
else
{
HFONT oldHFont = (HFONT) SelectObject(hDC, hBigFont);
glLargeFontBitmapListBase = ::glGenLists(224);
IW_ASSERT(IsNoGLError());
if ( glLargeFontBitmapListBase)
{
::wglUseFontBitmaps(hDC, 32, 224, glLargeFontBitmapListBase);
}
else
{
}
SelectObject(hDC, oldHFont );
}
Thanks for any tips, hints or anything I could have forgotten.
Max.
|
|
|
|
|
Maximilien wrote: Thanks for any tips, hints or anything I could have forgotten.
Your best bet for fonts is to build a texture font. Bitmap fonts exchange memory with real-memory as needed, often at higher frame rates, thus increasing memory footprint, and preventing higher frame rates -- ironically. Your 3D card is designed for texture mapping, not for bit-blitting.
|
|
|
|
|
El Corazon wrote: texture font
Thanks.
Yeah, but I would need to have bitmaps for all the fonts I need in my application; unfortunately not a good short term solution.
|
|
|
|