|
hey...
my drawing applications plots a graph for input received after 1 second....the drawing area(picture box treated as a bitmap)needs to be refreshed so that graphs appers moving...
i am using Invalidate() to refresh...plotting is fine but the drawing area flickers...
how to get rid of it?
thanks
|
|
|
|
|
The standard solution to this problem is to use "Double Buffering". There are heaps of articles on the subject.
Kakan
|
|
|
|
|
Try using double buffering by drawing directly into memory.
After you finish drawing into memory you can transfer the contents of memdc back to your drawing area.
For this you will have to follow the following steps:
Just a sample...
CDC dc;
dc.Attach(this->GetDC()->m_hDC);
CDC memDC;
memDC.CreateCompatibleDC(&dc);
CBitmap memBmp;
memBmp.CreateCompatibleBitmap(&dc, 100, 100);
CBitmap *oldBmp = memDC.SelectObject(&memBmp);
dc.BitBlt(0, 0, 100, 100, &memDC, 0, 0, SRCCOPY);
memDC.SelectObject(oldBmp);
dc.Detach();
This is just a sample of double buffering. This will prevent flickering.
Happy programming
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I use 'IShellFolder2'
It's Ok before declaration
but using member function then complie error C2027
what's the problem?
I don't know.
and It's All Ok from downloaded sources include 'IShellFolder2'
but It's not Ok my source what typing myself.
please help me.
and so sorry about my little English.
Thanks.
|
|
|
|
|
redefine _WIN32_WINNT, WINVER, _WIN32_IE to target win2k or later
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
hi ,
i used GDI+ in my application in VC++ 6.0.
i include the GDI+ files in directory,
and i added the both lib & dll files to my application
but it through the ERROR as
E:\12\mahadlg\mahadlgDlg.cpp(75) : error C2065: 'Image' : undeclared identifier
E:\12\mahadlg\mahadlgDlg.cpp(75) : error C2146: syntax error : missing ';' before identifier 'image'
E:\12\mahadlg\mahadlgDlg.cpp(75) : error C2065: 'image' : undeclared identifier
E:\12\mahadlg\mahadlgDlg.cpp(75) : error C2061: syntax error : identifier 'Image'
E:\12\mahadlg\mahadlgDlg.cpp(76) : error C2065: 'Graphics' : undeclared identifier
E:\12\mahadlg\mahadlgDlg.cpp(76) : error C2146: syntax error : missing ';' before identifier 'graphics'
E:\12\mahadlg\mahadlgDlg.cpp(76) : error C2065: 'graphics' : undeclared identifier
E:\12\mahadlg\mahadlgDlg.cpp(76) : error C2061: syntax error : identifier 'Graphics'
E:\12\mahadlg\mahadlgDlg.cpp(78) : error C2143: syntax error : missing ';' before '}'
send reply
|
|
|
|
|
Hello.
Include the GDI+ headers in your source file mahadlgDlg.cpp
(AFTER #include <stdafx.h>)
I.e:
using namespace Gdiplus;
#include "GdiPlusBitmap.h"
#include "GdiPlusHeaders.h"
And
#pragma comment(lib, "gdiplus.lib")
That should do the trick.
Kakan
|
|
|
|
|
maharaja pandian wrote: Is it possible to use GDI+ in VC++ 6.0
yes!, why not
maharaja pandian wrote: but it through the ERROR as
Since above class are defined under namespace Gdiplus, so you have to make call for
using namespace Gdiplus
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi, there
Can anyone teach me how to make the digital clock 'bigger' as in the number size ? I tried the whole day still failed. pls help.
C++ noob
Many thanks in advanced.
|
|
|
|
|
and why don't you ask its author on the forum ot the bottom on the article[^] ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
how to print a .bmp or .png file in dialog based applicatio
Regards.
sachin gupta
-- modified at 23:46 Friday 18th November, 2005
i gota program for printing .txt file ,
but how i can print a image that is stored in a predefined path.
|
|
|
|
|
Hi,
I have a file that i want to associate it with my program. Then, if i double click it in explorer, it should automatically open in my program.
What event should i handle? How to do this?
Usman
|
|
|
|
|
i thing using ShellExecute function this could be done
|
|
|
|
|
uus99 wrote: I have a file that i want to associate it with my program. Then, if i double click it in explorer, it should automatically open in my program.
you have to associate the file extention with your program... for that you have to change entry in HKEY_CLASSES_ROOT in registry
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
once i associate the the file extension, which function will be called if i open the file in explorer?
I mean, for example, my program is Program.exe, and the file is file.zzz. I associate the files *.zzz to my program, and if i open it in explorer, which function in my program will it be called?? OnOpen() etc?? Do i have to add an event handler?
THanks,
Usman
|
|
|
|
|
|
To complete the answer of Alok, in fact what really happen is that your program is called with the name of the file passed as command line argument. But, like Alok said, if it is a SDI or MDI app, the framework will handle all the job for you (it will call automatically the serialize methods thus loading the file). But of course, you have to implement the loading,saving of data in the serialize handlers.
|
|
|
|
|
WHat about dialog based programs? My project is a dialog based project, and i wan to associate TIFF files so that it opens in my program.
|
|
|
|
|
See here.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I need to draw circles, squares, and lines between them,
with some colors and digits
in simple way.
can someone advice me-
are there such controls ?
please type link or Name.
better with some comment.
thanks
|
|
|
|
|
hi,every one!
i want to change the companyname in my .exe file dynamicly,how to do?
there is a sample at http://www.codeproject.com/samples/UpdateVersion.asp, but it
does not deal with it.who can help me?thanks a lot!
|
|
|
|
|
I didn't get your question exactly. if you are trying to change the title of the application take the handle of the dialog and using SetWindowText() function you can change the name of the exe.
give me some more information about your problem.
|
|
|
|
|
The sample u mentioned has got complete code for changing the CompanyName. I have used this code myself. You just need to understand it fully before using and yes, dont forget to compile your application as unicode to do this. It wont work without that. I am just pasting a snippet of code here from the same article which does this.
CString strSubBlock;
LPTSTR pValueBuffer;
strSubBlock.Format(_T("\\StringFileInfo\\%04x%04x\\CompanyName"),
lpTranslate->wLanguage,
lpTranslate->wCodePage);
VerQueryValue(lpBuffer, (LPTSTR) ((LPCTSTR) strSubBlock),
(LPVOID *) &pValueBuffer, &uTemp);
ZeroMemory(pValueBuffer, _tcslen(pValueBuffer) * sizeof(TCHAR));
_tcscpy(pValueBuffer, _T("My Company, Inc."));
And yes, this Article is by one of the most respected members here. Mr. David Crow
Regards,
Aamir
|
|
|
|
|
Thank you,Aamir Butt!
Yes,i use like that you write, but how can i use UpdateResource function whit the variable 'pValueBuffer'?
This is my code:
CString strSubBlock;
LPTSTR pValueBuffer;
strSubBlock.Format(_T("\\StringFileInfo\\%04x%04x\\FileDescription"),
lpTranslate->wLanguage,lpTranslate->wCodePage);
VerQueryValue(lpBuffer, (LPTSTR) ((LPCTSTR) strSubBlock),
(LPVOID *) &pValueBuffer, &uTemp);
ZeroMemory(pValueBuffer, _tcslen(pValueBuffer) * sizeof(TCHAR));
_tcscpy(pValueBuffer, _T("My Company, Inc."));
if (UpdateResource(hResource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO), lpTranslate->wLanguage, lpBuffer, dwSize) != FALSE)
{
if (EndUpdateResource(hResource, FALSE) == FALSE)
dwResult = GetLastError();
}
else
dwResult = GetLastError();
But it does not replace the original companyname with "My Company, Inc." finally,perhaps where is wrong, can you help me? thanks a lot!
|
|
|
|
|
freemme wrote: there is a sample at http://www.codeproject.com/samples/UpdateVersion.asp, but it
does not deal with it.
Are you sure?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|