|
See here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
someone help me, how to code app to play internet radio?
thanks
Nho'c Ti`
|
|
|
|
|
I'm trying to draw a line over a bitmap that is not coming from one of the corners of a pixel,
It can be from the center or any other place as well as the corners of a pixel, currently
if you draw a line, using LineTo(int,int) what happens is the line doesn't start from the
center of the pixel it starts from typically the left upper corner of the pixel,
given a line say that is drawn in paint by pixels, what i want to do is draw a real line (vector type not raster)
that doesn't concern it's self with the actual pixel, similar to a trace program for raster to vector graphics (Adobe Streamline).
they have bitmapped lines, then they draw vector line types over the top of the bitmapped ones,
and when you look at the line it looks as if it was centered on the pixels if it was a vertical or horizontal.
I want to do the same thing....
I was looking at LineDDA but that didn't work I tried LineTO and that didn't work, LineToEx() as well if I have say pixels
50,50 to 150,50 the line that you draw is on the left side of the pixels and is not centered...?
I basically have a bitmap that displays fine, it is in a scrollview and moves, zooms, pans and the scroll perfectly
int py=GetScrollPos(SB_VERT);
CSize sz(GetTotalSize());
// TODO: calculate the total size of this view
int x=(int)( ima->GetWidth()*m_pDoc->m_ZoomFactor);
int y=(int)(ima->GetHeight()*m_pDoc->m_ZoomFactor);
SetScrollSizes(MM_TEXT, CSize(x,y));
Now I realize I am using MM_TEXT so can you create another Mapped cordinate system on top of a bitmap, and how do you do this?
HEre is the basic idea of what i do to draw a bitmap, now I want to draw on top of the bitmap to (but not actually in the bitmap )
(* TAKE A LOOK AT ADOBE streamline *) that is what I want to do....
void OnDraw(CDC* pDC)
{
CVtestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
BOOL bPrinting = pDC->IsPrinting();
CMemDC* pMemDC = NULL;
if (!bPrinting)
pDC = pMemDC = new CMemDC(pDC);
/* more stuff */
SetStretchBltMode(hdc,COLORONCOLOR);
SetDIBitsToDevice(hdc, x, y, cx, cy, 0, 0, 0, cy,info.pImage,(BITMAPINFO*)pDib,DIB_RGB_COLORS);
/*all done now */
delete pMemDC;
}
Any ideas, I'm sure this is very easy.... a simple source code example of a line would be greatly appreciated.
(I will extend this too arcs as well latter)
|
|
|
|
|
Dear All,
I want to develop a tool for the Fault Tree Analysis[FTA].
Now,I can only draw a simple static fault tree using my FTA tool,and with less analysis of minimal cutset.
For further research,I plan to:
(1)Add more analysis;
(2)Draw dynamic fault tree using the new dynamic gates;
(3)Use Markov Chain;
But I don't know the relationship between the static fault tree and the dynamic one,i.e. how to handle them in my FTA tool? and how to use Markov Chain?
If you are familiar with any software packages that can take care of these kinds of things please let me know about them.
If you are interested in FTA,could you please tell me some useful web sites?
If you are developing the FTA tool,would you please give me some examples/source codes about them?
Any information about these will be very highly appreciated.
Thanks in advance.
***
We are making progress everyday.
|
|
|
|
|
Hi there,
Currently, I have a C++ program running that communicated with
a communication device. I can execute commands and receive responses
via my C++ program to/from this device.
Now,i want to setup another version of this system with WEB BASED
capability. And i want to reuse back my existing resources which is
my C++ program. My questions are:
1. Is there any web technology that be able to integrate with C++ program?
2. Is it possible that ASP.net be able to do the job with combination of
c# or vb.net?
3. How about open source web environment which we can integrate with
C++ program?
4. How can a web browser always listen to the server's response if
there has changes going on from the communication device
without refreshing the whole web page?
Pls suggest a suitable architecture for my system in order to run in
both windows and web application with only 1 back-end engine.
Thanks.Pls as soon as possible.
|
|
|
|
|
You have a couple of options: First, you could expose the C++ functionality through a DLL and call it from your asp.net page via the interop facility. Second, you can rewrite the functionality in .NET. Third, you could use a web app server that natively hosts C++ code, like the Lightning Application Server[^].
onwards and upwards...
|
|
|
|
|
Hi all:
Is it possible that when you first rename a parent tree item then the subsequent rename of its child item will be act strange? Is it because of specific style settings or...
|
|
|
|
|
In my program, i got the handle of an explorer window,and i wannna get it's current full path in my program.Any ideas?
|
|
|
|
|
I am not sure about the use of handle to explorer window in your program.
For getting the path of your program ,you can use
GetModuleFileName()
Hope this helps.
Abhi Lahare
|
|
|
|
|
This API : GetWindowModuleFileName : WIll Help.Look for more Info in your local copy of MSDN
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
|
In my program, i got the handle of an explorer window,and i wannna refresh it in my program.Any ideas?
|
|
|
|
|
how to put simbol like : alpha, beta, gamma ... to visual c++ dialob box???
|
|
|
|
|
Firstly you will need a font that has alpha, beta and gamma within the font.
Then you can either set the dialog font to that new font.
or
Draw the appropriate static controls yourself with the new font. (This can be done within OnDrawItem() of the dialog).
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
TCHAR szBuffer[128];
_stprintf(szBuffer, _T("Alpha (%c) Beta (%c) Gamma (%c) Delta (%c)"),
0x391, 0x392, 0x393, 0x394);
MessageBox(NULL, szBuffer, _T("Greek"), MB_OK); Remember that UNICODE and _UNICODE must be defined.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
A very handy utility that is part of the WinOS is charmap. It will show you the characters available for each font, as well as the key combo to produce that character.
onwards and upwards...
|
|
|
|
|
Yo,
Say I have a mission critical program. I want to periodcally check that it is still running possibly using cgi show a status
on a web page or at least alert someone if it ceases running. Is the best way to write a small service which checks if the process
is running? What do others think. Is there a simpler solution.
Regards,
Alfonce
|
|
|
|
|
for a small-to-medium WTL application, I'm looking for a serialization library. Typical files will be <100K, but the data structure is fairly complex. Text or binary doesn't matter.
Requirements: free (non-GPL), low runtime dependencies, simple to use.
Any takers?
I never really know a killer from a savior boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Haven't used it myself, but given the link in your sig you might want to try this (if you haven't already). Looks pretty flexible...
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
I am stumpped
I have a tree control I am filling with
// insert into the selected tree item
tvinsert.hParent=this->GetCurrentItem(bLocal); tvinsert.hInsertAfter=TVI_LAST; tvinsert.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_CHILDREN; tvinsert.item.pszText=new_name.GetBuffer(0); tvinsert.item.iImage=f;
tvinsert.item.iSelectedImage=g;
HTREEITEM a = TreeView_InsertItem(tmpTree->m_hWnd, &tvinsert);
but it doesn't show a plus (+) sign.
// if I add
tvinsert.hParent=a; tvinsert.hInsertAfter=TVI_LAST; tvinsert.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_CHILDREN; tvinsert.item.pszText="first sub item"; tvinsert.item.iImage=f;
tvinsert.item.iSelectedImage=g;
HTREEITEM b = TreeView_InsertItem(tmpTree->m_hWnd, &tvinsert);
// still no plus
// if i add
tvinsert.hParent=b; tvinsert.hInsertAfter=TVI_LAST; tvinsert.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_CHILDREN; tvinsert.item.pszText="sub to sub item"; tvinsert.item.iImage=f;
tvinsert.item.iSelectedImage=g;
HTREEITEM a = TreeView_InsertItem(tmpTree->m_hWnd, &tvinsert);
the item now has a plus sign with both subs, one under the other....
any helps really, really appreciated
shotgun
|
|
|
|
|
Since you have the TVIF_CHILDREN mask bit set, you need to set the tvitem.item.cChildren flag. In debug mode, the flag would normally be set to zero indicating there are no children - so, you need to set the flag in the root and child item to 1 and the grandchild to 0.
This should result in
- ROOT (a)
- CHILD (b)
GRANDCHILD (c)
when expanded.
Steve
|
|
|
|
|
|
you are a god...
Thank you
shotgun
|
|
|
|
|
The code below, would must to show the count the number of pages in a PCL file. But, don´t show. Why?? What is wrong??
//----------------------------------
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
int main (int argc, char **argv) {
FILE *InputFile;
char ch, EndTag, tag[2], *InputFileName;
int n, BlockSize, Pages, Copies, Quiet;
unsigned long FileSize, FilePos;
BlockSize =0; Pages =0; FileSize =0; FilePos =0;
Copies =0; Quiet =1;
InputFileName = NULL;
// Parse command line parameters
for(n = 1; n <= argc - 1; n++) {
if(! memcmp(argv[n], "-h", 2)) {
printf("Error");
exit(0);
} else if(! memcmp(argv[n], "-v", 2))
Quiet = 0;
else if(argv[n][0] == '-') {
fprintf(stderr, "-- Parameter incorrect: '%s'.\n",
argv[n]);
exit(1);
} else
InputFileName = argv[n];
}
if(InputFileName == NULL) {
fprintf(stderr, "-- Must enter a file name.\n \" Use 'pclcount -h' to get help.\n");
exit(1);
}
// Try to open the input file
if(! (InputFile = fopen(InputFileName, "r"))) {
fprintf(stderr, "--Error opening file: %s\n", argv[1]);
exit(-1);
};
// Get the file size, to show statistics if '-v' is passed
if(! Quiet) {
fseek(InputFile, 0, SEEK_END);
FileSize = ftell(InputFile);
fseek(InputFile, 0, SEEK_SET);
}
while(fread(&ch, 1, 1, InputFile)) {
switch(ch) {
case 12:
// Found FormFeed: increments page counter
Pages ++;
break;
case 27:
// Found <esc>
fread(tag, 2, 1, InputFile);
if(! (memcmp(tag, "*b", 2) && memcmp(tag, "(s", 2) &&
memcmp(tag, ")s", 2) && memcmp(tag, "&p", 2))) {
/*
Detect the operators:
<esc>*b###W -> Start of Binary Block
<esc>(s###W -> Start of Characters Description
Block
<esc>)s###W -> Start of Fonts Description Block
<esc>&p###X -> Start of non-printable Characters
Block
In these operators, '###' is the size of
respective block.
*/
// Define the block end-character
EndTag = memcmp(tag, "&p", 2) ? 'W' : 'X';
do {
fread(&ch, 1, 1, InputFile);
if((ch >= '0') && (ch <= '9')) {
// A number was read: it's part of block size
BlockSize = 10 * BlockSize + ch - '0';
}
} while ((ch >= '0') && (ch <='9'));
if(ch == EndTag) {
// The operator ends with 'W': it's a espected operator
// Do a 'seek' to jump the block
fseek(InputFile, BlockSize, SEEK_CUR);
FilePos = ftell(InputFile);
// Refreshing status message here (don't do it all the time) don't slow the process
if(! Quiet) printf("Processing... %ld of %ld bytes (%ld%%)\r", FilePos, FileSize, (FilePos * 100) / FileSize);
}
// Not a espected operator: reinitialize BlockSize
BlockSize = 0;
} else if(! (memcmp(tag, "&l", 2))) {
// The operador <esc>&l###X informs the number of copies ('###') solicited
n = 0;
for(ch = '0'; (ch >= '0') && (ch <= '9');
fread(&ch, 1, 1, InputFile)) {
n = 10 * n + ch - '0';
}
if(ch == 'X') {
// The operator ends with 'X' (as espected). Gets the number of copies
Copies = n;
}
}
break;
}
}
fclose(InputFile);
if(Quiet)
// Case '-v' wasn't passed, prints only total of pages of the job
printf("%d\n", Pages * Copies);
else
printf("Processing... Done. \n \" Number of Pages.......: %d \n \" Number of Copies......: %d \n \" Total of Pages........: %d \n", Pages, Copies,Pages * Copies);
return(0);
}
Thank´s!
raf-sp
raf-sp@bol.com.br
|
|
|
|
|
raf-sp wrote:
But, don´t show. Why?? What is wrong??
So what does it show? Is it off by one? Does the while loop not find any ASCII 12 characters? Remember that "page eject" in PCL can be any of the following commands:
RESET (EcE)
PAGE SIZE (Ec&l#A)
PAGE LENGTH (Ec&l#P)
ORIENTATION CHANGE (Ec&l#0)
PAPER SOURCE CONTROL SEQUENCE (Ec&l0H) with a value of zero
PAPER SOURCE (Ec&l#H)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|