|
Thanks for the suggestion!
|
|
|
|
|
Frames in many animated gif files don't have transparent color, that is, transparent color index of the frames is not valid (Transparent Color Flag is zero).
In the case, I guess, the frames use default transparent color : white - rgb=(255,255,255).
But I can not find docs on google to confirm it.
If you have knowledge about animated gif format, please let me know if my guess is true.
BTW:
all gifs of this kind found by me have white background, that is why I think there is default transparent color for this kind gifs.
|
|
|
|
|
here is the GIF Spec[^].
there is no default transparent color, AFAIK. typically the rendering code just picks a color like white or black, or the app lets the user choose a color when rendering transparent images, of any format, when there is no background.
|
|
|
|
|
I am new to DirectDraw,I found it hard to find DirectDraw document on MSDN, it's all about D3D stuff which I don't really want to learn by now. So How should I start with DirectDraw? Any book/way recommended? thanks in advance.
|
|
|
|
|
From MSDN http://msdn.microsoft.com/en-us/library/gg426115(v=VS.85).aspx[^]
DirectDraw is no longer recommended for use. With the release of Direct3D 9.0, all two-dimensional functionality is contained within Direct3D, its associated helper functions in D3DX, and the DirectX 11 technology Direct2D. However, the DirectDraw reference documentation is still available in this section.
While I'm sure there are books that cover the older DirectDraw, you might as well start learning 2D drawing within the context of Direct3D.
/* Charles Oppermann */
http://weblogs.asp.net/chuckop
|
|
|
|
|
meh. don't bother. MS will come out with yet another API which will obsolete all the others, in the next two or three months. like they always do.
|
|
|
|
|
Considering that DirectDraw was part of DirectX in 1995, and was superceeded in 2001 with Direct3D. So the API the original poster wanted to use is 16 years old, and was replaced 10 years ago.
Considering the advances in video rendering, having a the same basic API for the past decade isn't bad.
/* Charles Oppermann */
http://weblogs.asp.net/chuckop
|
|
|
|
|
Thanks, I think I am stick with DirectDraw7.0.
|
|
|
|
|
I tryid to read every file from MRU ( registry ) with follow code :
void CFileSourcePage::GetKey(HKEY hKey, LPCTSTR lpSubKey, CStringArray& saResult)
{
if(RegOpenKeyEx(hKey,lpSubKey,0,KEY_READ,&hKey) != ERROR_SUCCESS)return;
DWORD dwType;
BYTE bData[4096];
DWORD cbData = 4096;
TCHAR achKey[MAX_KEY_LENGTH]; DWORD cbName; TCHAR achClass[MAX_PATH] = TEXT(""); DWORD cchClassName = MAX_PATH; DWORD cSubKeys = 0; DWORD cbMaxSubKey; DWORD cchMaxClass; DWORD cValues; DWORD cchMaxValue; DWORD cbMaxValueData; DWORD cbSecurityDescriptor; FILETIME ftLastWriteTime;
DWORD i, retCode;
TCHAR achValue[MAX_VALUE_NAME];
DWORD cchValue = MAX_VALUE_NAME;
retCode = RegQueryInfoKey(
hKey, achClass, &cchClassName, NULL, &cSubKeys, &cbMaxSubKey, &cchMaxClass, &cValues, &cchMaxValue, &cbMaxValueData, &cbSecurityDescriptor, &ftLastWriteTime);
if(cSubKeys)
{
TRACE1("\nNumber of subkeys: %d\n", cSubKeys);
for(i = 0;i < cSubKeys;++i)
{
cbName = MAX_KEY_LENGTH;
retCode = RegEnumKeyEx(hKey, i,
achKey,
&cbName,
NULL,
NULL,
NULL,
&ftLastWriteTime);
if(retCode == ERROR_SUCCESS)
{
TRACE2("(%d) %s\n",i + 1, achKey);
}
}
}
if(cValues)
{
TRACE1("\nNumber of values: %d\n", cValues);
for(i = 0,retCode = ERROR_SUCCESS;i < cValues;++i)
{
cchValue = MAX_VALUE_NAME;
retCode = RegEnumValue(hKey, i,
achValue,
&cchValue,
NULL,
&dwType,
bData,
&cbData);
if(retCode == ERROR_SUCCESS)
{
LPSTR pszValue = reinterpret_cast<LPSTR>(bData);
saResult.Add(pszValue);
}
}
}
RegCloseKey(hKey);
}
and in OnInitDialog() I try :
CStringArray saMRU;
CString sFile = theApp.GetProfileString(_T("Settings"),_T("File"));
GetKey(HKEY_CURRENT_USER,_T("Software\\MyPlace\\Application\\Recent File List"),saMRU);
but altought I have 3 files there :
C:\eeeeeeeeeeeeeee.xyz
E:\Flaviu\VC++\MDI\Application\aaaaaaaaaaaaaa
E:\Flaviu\VC++\MDI\Application\gbdhfdfgf
is reading only first and last file in CComboBox .... why ? What I'm doing wrong ? Thank you.
|
|
|
|
|
Flaviu2 wrote: if(cValues)
{
TRACE1("\nNumber of values: %d\n", cValues);
What is the value of cValues ?
Flaviu2 wrote: is reading only first and last file in CComboBox...
So is the problem with reading from the registry or reading from the combobox?
What is the value of retCode each iteration of the second loop?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
The number of cValues is 3. Of course, the is registry reading, not combo vales. I didn't test retCode ... my mistake.
modified on Tuesday, August 9, 2011 11:29 AM
|
|
|
|
|
When you enumerate the key-values you need to reset the value of cbData to 4096 after each call. This is because each time a value is returned its length is stored in this field, so any values larger than a previous one will not be returned as the RegEnumValue() function thinks that the buffer is not large enough.
|
|
|
|
|
Thank you all guys, you help me a lot ! Richard, that was the problem. Best wishes ! You do a great think here !
modified on Tuesday, August 9, 2011 1:43 PM
|
|
|
|
|
Hi all,
I'm developing an application which helps to manage car park by recognizing the car's plate number. I use VC++, OpenCV, Windows SDK and DirectX in this app. But I am now having a little trouble with it.
Let me introduce a bit about how my system works so that you guys can understand about it:
When a car enters the park, we scan one card with a card reader. Right after the card is read, our camera will take a picture of the car's plate and our system will recognize the plate number and assign it to the scanned card's id. And the car will then be allowed to get into the park.
When the car gets out of the park, the same process happens. If the plate number of the car and the card's id are the same with those in database, the car will be allowed to get out.
Here is my trouble: When I start the application, it works fine and no errors happen like the below picture.
_http://s1.postimage.org/266bl4fsy/image.jpg[^]
But the "Debug assertion failed" error happen when I scan a card with our card reader. The specific error is in the below image.
_http://s2.postimage.org/270yeip2a/image.jpg[^]
Can any one help me to fix this annoying error? Many thanks to you all.
|
|
|
|
|
Click 'Retry', check the comments around the ASSERT and the call stack. We won't be able to tell you much more without actually seeing some code and/or knowing in more detail what you are doing.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Nguyen Huy Tuan wrote: But the "Debug assertion failed" error happen when I scan a card with our card reader. So have you looked at line 906 of wincore.cpp ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
In my opinion, there might be some wrong environment configurations with DirectX, or Window SDK, or ActiveX Control, not somthing which relates to wincore.cpp or any source code file of the project, since the project worked fine before, but I don't know what exactly it is. I'm getting crazy with this. It's messing me up....
|
|
|
|
|
Hi all,
i am create a html file with text color,background color and other image formatting.
now i want to extract only text information of this page without any html tags.
please help me how can i do this.
thanks in advance.
|
|
|
|
|
Le@rner wrote: i am create a html file with text color,background color and other image formatting.
now i want to extract only text information of this page without any html tags.
please help me how can i do this.
thanks in advance.
If you are aware of IHTMLElement interface, it might able to help you read more here[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
how can i use this?
there is any example for this.
|
|
|
|
|
Le@rner wrote: there is any example for this
clickit[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I have been trying to hunt down the reason my program compiles fine, but has a problem in runtime with bitmaps. The program has been tracked down to a pointer that seems to have its value changed to NULL at some point during this call:
void CWinSTMView::OnImageAutoPlane()
{
CWinSTMDoc *pDoc = CreateNewDoc(GetDocument()); and
pDoc->CopyDoc(pNewDoc,m_MyChannel);
CATCH_ALL(e)
{
lResult = AfxProcessWndProcException(e, &pThreadState->m_lastSentMsg);
TRACE(traceAppMsg, 0, "Warning: Uncaught exception in WindowProc (returning %ld).\n",
lResult);
DELETE_EXCEPTION(e);
}
I have set breakpoints all around the location where the problem seems to be happening, but I keep stepping into what seems to be windows libraries and code that I probably shouldn't change (it is write protected). The bitmap also loads fine (and initializes) when I first open the file, it is only after I try the 'autoplane' function above that it encounters the exception. Any ideas on how I can go about fixing this? I have no problems with using the debugger and stepping through the code if more information is needed. (Please ask, I am not sure what would be helpful)
solved here:Debug Assertion Error Visual Studio 2010[^]
modified on Thursday, August 25, 2011 3:44 PM
|
|
|
|
|
Which pointer had its value changed to NULL? What exception is thrown? Are you getting an ASSERT() exception or something else?
|
|
|
|
|
The pointer is called m_bitmap and I think it holds the memory location to the saved bitmap since it is called in the following
bool CWinSTMBmp::Init(int sizex, int sizey, RGBQUAD* Pal)
{
if (m_Bitmap != 0)
DeleteObject(m_Bitmap);
if (m_Bitmap == NULL)
{
ZeroMemory ( &m_ImageInfo, sizeof (BITMAPINFO) );
m_ImageInfo.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
m_ImageInfo.bmiHeader.biWidth = sizex;
m_ImageInfo.bmiHeader.biHeight = -sizey;
m_ImageInfo.bmiHeader.biPlanes = 1;
m_ImageInfo.bmiHeader.biBitCount = 32;
m_ImageInfo.bmiHeader.biCompression = BI_RGB;
m_ImageInfo.bmiHeader.biSizeImage = 0;
m_Bitmap=CreateDIBSection ( NULL, &m_ImageInfo, DIB_RGB_COLORS, (void **)&m_BmpBits, NULL, NULL );
}
memcpy(m_RGB,Pal,sizeof(RGBQUAD)*256);
m_SizeX = sizex;
m_SizeY = sizey;
return true;
} I have verified the this is called in the program and the bitmap is initialized when I open the file (does it need to initialize again?). The only information I can give on the exception is that it says DEBUG ASSERTION FAILED! and when I continue to try to debug it causes a break at this line
ENSURE(SUCCEEDED(hr));
Add(psi, strAppID);
#endif
does this help at all?
|
|
|
|
|
AndrewG1231 wrote: does this help at all?
Not really, you don't seem very sure about the usage of m_bitmap , and you fail to indicate exactly where the assertion occurs, and what variables and values cause it. Try to gather all information and copy any messages word for word.
|
|
|
|
|