|
not sure i understand you reply...
Stephen Hewitt wrote: that's a square or rectangle which is squashed to one side so that the two opposing sides are parallel. To simulate perspective you need a trapezium.
????
can you explain it in more simple words.
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
A parallelogram looks like this:
-----
\ \
\ \
-----
But a trapezium looks like this:
---
/ \
/ \
-------
PlgBlt is short for parallelogram_Bit_Blit. The following is a quote from MSDN:
"Pointer to an array of three points in logical space that identify three corners of the destination parallelogram".
Notice it has three points not four - This ensures it is impossible to even ask for a shape that isn't a parallelogram: No matter which three points you give to it a third is calculated such that the resulting shape is a parallelogram.
To simulate perspective you need something that looks like a trapezium.
Steve
|
|
|
|
|
I know the difference between a trapezium and parallelogram.
since the rectangle is diverted and represented in 3D environment, i do need to preserve its coordinates so the outcome result of what is need is a parallelogram and not trapezium.
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
What do you mean, "since the rectangle is diverted and represented in 3D environment"? PlgBlt performs a 2D mapping from a rectangle to a parallelogram. A far as I can see that's a show stopper for you. I think to get it to work the way you want you’d have to use DirectX or OpenGL or create your own code to calculate a transformation for every pixel – No simple GDI call that I know of can do what you want as it’s designed for 2D work.
Steve
|
|
|
|
|
|
I can't see anything that will help you in there.
Steve
-- modified at 7:26 Sunday 23rd April, 2006
|
|
|
|
|
Look at the reply by Pravin Kumar (the second one) ,
he mentioned several steps:
(i) You have to create a polygon region from the rotated vertices of the rectangle,
(ii) get its bounding rectangle using CRgn:: GetClipBox function,
(iii) create a compatible bitmap and attach it to a compatible memory DC,
(iv) paint the memory DC with the background colour of the window,
(v) draw region on memory DC using FillRgn and FrameRgn functions and finally
(vi) BitBlt the memory DC to the window DC. Detaching the bitmap from memory DC and deleting bitmap and DC go without saying
and the trick could be to create a polygon of the outcome rectangle, then copy it to memory dc after you clip it using RGB, then draw the memory dc back to window using bitblt....
this code be something right?
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
I can't see how this procedure does what you want. I think what you want is rotation around the x or y axis with perspective. This is beyond abilities of GDI.
Steve
|
|
|
|
|
ok then let's conclude this debate
Bottom line is that i need to use Open GL or DirectX to do so....
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Yeah, I don't think were progressing the issue. Good luck.
Steve
|
|
|
|
|
I've sent you an oher sample in the mail, did u get it?
this time it does what i need but i have a drawing problem...
maybe u can help?
thanks
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi ,
I am infancy to socket programming .I need to connect to an external device through terminalserver4 and i should be able to send command & receive output. Using the following code, i am able to send data to the external device from the two send functions and able to receive data from only the first recv function.
The program is blocking at the second recv function. Please check the following code and help me if anywhere went wrong.
#define DEST_IP "10.10.1.1"
#define DEST_PORT 2001
void CSocktestDlg::process()
{
WSADATA wsaData;
if(WSAStartup(MAKEWORD(1,1),&wsaData)!=0)
{
AfxMessageBox("WSAStartup failed",MB_OK);
exit(1);
}
else
{
//AfxMessageBox("WSAStartup succeeded",MB_OK);
}
int sockfd;
struct sockaddr_in dest_addr;
//Establishing socket
sockfd=socket(AF_INET,SOCK_STREAM,0);
dest_addr.sin_family=AF_INET;
dest_addr.sin_port=htons(DEST_PORT);
dest_addr.sin_addr.s_addr=inet_addr(DEST_IP);
memset(&(dest_addr.sin_zero),'\0',8);
//For connecting
if(connect(sockfd,(struct sockaddr *)&dest_addr,sizeof(struct sockaddr))==0)
{
//AfxMessageBox("Connected to remote system successfully",MB_OK);
}
else
{
AfxMessageBox("Unable to connect to remote machine",MB_OK);
}
//For sending data
CString code= "2,76,69,68,77,73,44,73,77,68,69,73,77,68,69,0,217,105,3";
int len,bytes_sent,n,i;
CTokenEx CtlArraySpliter;
CStringArray strArray;
CtlArraySpliter.Split(code,",",strArray,TRUE);
for(i = 0; i < strArray.GetSize(); i++ )
{
//len=strArray.GetAt(i).GetLength();
n = atoi(strArray.GetAt(i));
bytes_sent=send(sockfd,(char *) &n,sizeof(int),0);
}
strArray.RemoveAll();
AfxMessageBox("Sent message through socket to remote IP",MB_OK);
Sleep(5000);
//For receiving data
char buf[50];
int p=recv(sockfd,buf,50,0);
CString s,readbuffer,soutput;
readbuffer=(CString)buf;
soutput = "";
for(i = 0;i < p;i++)
{
if (soutput == "")
{
s.Format("%d", (int)((unsigned char)readbuffer.GetAt(i)));
soutput = soutput + s;
}
else
{
s.Format("%d", (int)((unsigned char)readbuffer.GetAt(i)));
soutput = soutput + "," + s;
}
}
AfxMessageBox(soutput,MB_OK);
//second time sending......................
CtlArraySpliter.Split(code,",",strArray,TRUE);
for(i = 0; i < strArray.GetSize(); i++ )
{
//len=strArray.GetAt(i).GetLength();
n = atoi(strArray.GetAt(i));
bytes_sent=send(sockfd,(char *) &n,sizeof(int),0);
//m_myPortController.Write((char *) &n,0,0);
}
strArray.RemoveAll();
Sleep(5000);
char buf1[50];
int q=recv(sockfd,buf1,50,0);
readbuffer=(CString)buf1;
soutput = "";
for(i = 0;i < q;i++)
{
if (soutput == "")
{
s.Format("%d", (int)((unsigned char)readbuffer.GetAt(i)));
soutput = soutput + s;
}
else
{
s.Format("%d", (int)((unsigned char)readbuffer.GetAt(i)));
soutput = soutput + "," + s;
}
}
AfxMessageBox(soutput+" first port second time",MB_OK);
if (p == SOCKET_ERROR)
{
p = WSAGetLastError();
WSACleanup();
}
else
{
AfxMessageBox("Received data successfully",MB_OK);
}
//For shutting down the socket
int r=shutdown(sockfd,2);
WSACleanup();
if (r==0)
{
//AfxMessageBox("socket closed successfully",MB_OK);
}
if (r==-1)
{
AfxMessageBox("Unable to close the socket",MB_OK);
}
}
The program is blocking at the second recv() function.
Pl help me.
Thanks in advance!!
|
|
|
|
|
in general, each waiting function (such as recv()) should be put in a thread, because u don't know if or when other-side sends message to you.
so create threads for your waiting functions.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
here, i think there is no waiting problem.Because the external device sends message immediately after sending command code. Is there any other wrong in my code? For the first time it is responding immediately. For the second time not.
|
|
|
|
|
Hi,
Is there any utility that can return informations about the programming language used to create a specific EXEcutable file?
Regards,
sdancer75
|
|
|
|
|
since the program is compiled, you have no information about the programming language which has been used to generate it
|
|
|
|
|
An exe has (somewhere) things called "compiler signature" and "linker signature".
By interpreting these signatures, you can find out the compiler and the linker used to create the exe file.
They won't tell you the computer language, but the used compiler will give you a hint.
Google for "compiler signature" and "linker signature"
|
|
|
|
|
There is no one simple way but there are things you can look for. One is to have a peek at the import table. There are many tools that can help with this such as Depends[^]. If it imports "msvbvm60.dll" it is probability written using VB6 for example.
Steve
|
|
|
|
|
Hi,
Is there any utility that can return informations about the programming language used to create a specific EXEcutable file?
Regards,
sdancer75
|
|
|
|
|
LANGID GetUserDefaultUILanguage(void);
|
|
|
|
|
this is the speaking language of the UI, not the programming language
|
|
|
|
|
Sorry , I misunderstand it.
use FileInfo tool to detect programming language :
FileInfo[^]
or language[^]
-- modified at 6:21 Thursday 20th April, 2006
|
|
|
|
|
|
Hey Hello,
we are two students from Dresden (Germany) and we have to program some little code, but we have really no idea how to do this!
OK, lets describe.
We want to write a tool which makes it possible to show the ping and traffic. Our teacher said we have to use c++ @ LCC.
Our application is a dialog based windows application. There is a textfield where the user is able to enter the host which he or she wants to ping on. The result of Ping should be visualized by a diagramm @ real time. How can we reach this goal?
Tutorials of lcc win32 say, that there should be a header file called ping.h. We use the version 3.3 and there is no such file. What can we do now?
thx and have a nice way home
|
|
|
|
|
have a look at
http://www.scitools.com/examples/NetManager_html/583.html
You can find the ping.h file at the above location.
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|