|
If you are relying on a internal data structure to store the rectangle, then you don't want to depend on the window, whether it is closed or not. Use data structure which stores reactangle, chart identifier, block name, so that when the goto box is used to search a block nail down the data structure object and create the corresponding chart, and draw highlighted to indicate the focus.
|
|
|
|
|
In documentation it is said, log10() is using complex type argument. Can we use this function with int or float types?
How to check the return value is infinitive?
Best Regards,
Suman
|
|
|
|
|
There are four overrides for this function of types COMPLX, double, long double and float.
I want to check if the return value is infinitive.
Best Regards,
Suman
|
|
|
|
|
compare with -HUGE_VAL
HUGE_VAL is a defined value of 1.#INF000000000.. which is return as error for INFINITE.
modified on Thursday, March 13, 2008 9:42 AM
|
|
|
|
|
You can also check the argument.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Yes that is also good idea!!
Best Regards,
Suman
|
|
|
|
|
Hi All,
I have some controls that gets all the details regarding a mail. I need to add a Email Preview option.
How to start?? Or any ideas regarding how to implement that?
Tried to google but in vain.
Any ideas will really be big help. Thankyou.
Priya Sundar
|
|
|
|
|
what about giving the mail message body to webbrowser control.
|
|
|
|
|
hi thanks a lot.
It really worked!
I didnt know really about those things(webbrowser control!!).. in fact many things..
Thanks.
Priya Sundar
modified on Thursday, March 13, 2008 4:19 AM
|
|
|
|
|
Hi,
I'm about to rotate an image for display and I used RotateTransform() thanks to Mark Salsbery but now I'm having difficulty using it.
When I draw Image without RotateTransform,
g.DrawImage(&img,100,100,img.GetWidth(),img.GetHeight());
there's no problem. But when i added RotateTransform.
g.RotateTransform(330); // 30o elevation
g.DrawImage(&img,100,100,img.GetWidth(),img.GetHeight());
the image is displayed not in point (100,100) as expected rather in (137,37).
Is there something wrong in my code?
Do I have to add additional code for RotateTransform to work?
How will I display a rotated image in a fixed point?
Please help me.
Thanks.
|
|
|
|
|
You could use Graphics::TranslateTransform() to shift the image vertically and/or horizontally.
Note that the order you set transforms with matrixes is important...
Here's some reference material: Transformations (GDI+)[^]
FWIW, Here's an example (I've posted here before) which rotates an image around its center point, like a propeller...
Gdiplus::Bitmap SrcBitmap(L"C:\\test.tif", FALSE);
Graphics DstGraphics(*this);
REAL angle = 0.0f;
for (int i = 0; i < 1440; ++i)
{
DstGraphics.ResetTransform();
DstGraphics.RotateTransform(angle);
DstGraphics.TranslateTransform(SrcBitmap.GetWidth() / 2.0f, SrcBitmap.GetHeight() / 2.0f, MatrixOrderAppend);
DstGraphics.DrawImage(&SrcBitmap, -((INT)SrcBitmap.GetWidth() / 2), -((INT)SrcBitmap.GetHeight() / 2), SrcBitmap.GetWidth(), SrcBitmap.GetHeight());
angle += 0.5f;
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks a lot.
Now I will try it.
|
|
|
|
|
Is there a way where I can position the image at the
upper left corner of the image to any point?
Like for example position the image corner at point (100,100).
(100,100)
....._____
..../ / / /
.../ / / /
..------
|
|
|
|
|
TooShy2Talk wrote: Like for example position the image corner at point (100,100).
Matrix matrix;
matrix.Translate(100.0f, 100.0f);
matrix.RotateAt(30.0f , PointF(100.0f, 100.0f), MatrixOrderAppend);
graphics.SetTransform(&matrix);
graphics.DrawImage(&img, PointF(0, 0));
graphics.ResetTransform();
|
|
|
|
|
Thank you for the reply.
I will try this.
|
|
|
|
|
It's up to you to decide what the upper left corner of a rotated rectangular image is
and how you want it drawn.
You'll have to do a little math, but you have the functions to rotate and position.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am writing an application to communicate with a controller, the data packet size is 7 bytes maximum 14 bytes both ways. I am trying to calculate my worst case frequency and I am using the following approximation, I seem to reall that baud rate is the approximate bit rate.
Max Controller Baud Rate = 500K
Max packet size = 56 bits.
500000/96 = 5.2 KHz
So based on this, and discounting controller and protocol converter latencies, I need to read the serial port every 2 microseconds.
Am I dreaming, or can a small thread handle it? How can I determine what size buffer I need to avoid overflow or loss of data?
Thanks once again for your replies.
|
|
|
|
|
If you are truly talking about serial port usage, the data may be sent by your controller at 500K, but remember that for serial communications, every byte contains eight bits of data, plus (normally) one start bit and one stop bit.
Most serial ports cannot handle more than 115,200 baud (although perhaps some USB-Serial adapters can do better). Additionally, most serial ports provide a buffer that can hold more than one character - typically up to 16 - before you need to read the data.
Given that, at 500000 bps, with 10 bits/character gives 50000 Bytes per second. If you allow the port to buffer the data (let's say 16 characters), then you have 3125 full buffers per second which means a read every 320 microseconds.
The other question is how often does your controller actually send that data. It would appear you may need to send a 7-byte packet to the controller and then you get a 7-byte response from it. If that's the case, you obviously cannot get a response as often as you are calculating - in fact it would be about every 640 microseconds.
If you only query your controller periodically, then you won't get a response until you query, so you're in control of how often you must read the serial port.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
|
jonsey29847 wrote: ...I need to read the serial port every 2 microseconds.
Are you using a RTOS?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, however the controller(s) may not send responses back right away as some messages they handle may have a higher priority then my request for data. I am just trying to get a feel for the timing constraints for worst case data aquisition. Based on krmeds replay it would appear I am well within the capabilities of Windows.
Thanks
|
|
|
|
|
jonsey29847 wrote: Yes...Windows.
So which is it? Windows is not a RTOS, thus it cannot do anything every two microseconds.
Rather than polling, why don't you let the serial port tell you when it has data?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
My application is to communicate with an ECU (OBDII controller), the ECU is real time.
The controller has to be polled to get the data, my attachment point is a network (CAN) thus any data I see may be for other devices on the network.
|
|
|
|
|
Hello everyone,
Opaque pointer must be a pointer points to inner (hidden to outside) struct or class?
(refer to the C++ part)
http://en.wikipedia.org/wiki/Opaque_pointer
thanks in advance,
George
|
|
|
|
|
Interesting technique!
Maxwell Chen
|
|
|
|