|
Bram, thank you for this; the more posters who confirm this direction means I can be that much more comfortable this is the standard and state of the art.
|
|
|
|
|
Hi there,
I'm using an MFC graph control to display multiple lines from a stored results file. Each line has a corresponding Y axis & colour.
Is it possible to drag a vertical line across the chart (using OnLButtonDown?) which would then dynamically display the intersecting values in a grid control, along with the corresponding Y axis name & line colour?
Cheers.
PS. This is my 1st post to Code Project so I apologise if it's a bit vague.
ADVAthanksNCE
|
|
|
|
|
ADVAthanksNCE is so great
Hope someone will know how to help you
Cheers
|
|
|
|
|
Can you give me details about the MFC graph control that you are using? It is possible to get that as long as you have complete access to the graph control.
|
|
|
|
|
Hi, The graph control is an ocx (COleControlModule) and I do have full access to it.
At the moment, I use a CDialog to drop the basic line chart into.
To be specific, what I want to do is:
Enhance my basic line graph to:
1. Add a mouse-moveable vertical line originating from the x-axis.
2. Display the values at the points where the lines on the graph intersect the vertical line.
3. Use a grid to display each value with it's associated line colour/type & name.
4. Add/remove lines (& relevant y-axes) to the graph & grid.
Thanks.
|
|
|
|
|
If you want to drag a line of your graph control, you will need to be more specifical and post some code to let the others know about the situation.
If you just want to have a vertical line moving... you can make it easily with the DC, MoveTo and LineTo...
Explain a bit more about what you really need and... if you are new in forum... I recommend you to read this[^]
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hi, Apologies, I'll be more specific. What I want to do is:
Enhance my basic line graph to:
1. Add a mouse-moveable vertical line originating from the x-axis.
2. Display the values at the points where the lines on the graph intersect the vertical line.
3. Use a grid to display each value with it's associated line colour/type & name.
4. Add/remove lines (& relevant y-axes) to the graph & grid.
The graph control is an ocx (COleControlModule) and I have full access to it.
At the moment, I use a CDialog to drop the basic line chart into.
Thanks.
|
|
|
|
|
Hi All,
I am hoping someone can lend assistance for the following. I did not receive any responses in the 'General Discussion' area. I recently submitted an article wich grafts compiled executable code on Windows. See Grafting Compiled Code[^]
What I would like to demonstrate next is the grafting of Linux code into a Windows executable. For a donor, I was thinking it would be appropriate to stay with the Checksum algorithm. So the ELF checksum seems like a good candidate.
For this, I have questions:
1) Does ELF use a checksum (or hash)
2) What Linux function is called to perform this?
3) In which lib is the function located?
Thanks,
Jeff
|
|
|
|
|
Hello Jeff,
Executable and Linking Format uses a hash.
unsigned long ElfHash(unsigned char* c)
{
unsigned long hash = 0;
unsigned long x = 0;
while (*c)
{
hash = (hash << 4 ) + *c++;
if(x = hash & 0xF0000000)
{
hash ^= x >> 24;
}
hash &= ~x;
}
return hash;
}
This project is great for researching ELF format:
http://sourceforge.net/projects/elfio/[^]
|
|
|
|
|
Hi Randor,
Very nice. They do not offer a compiled program (only sources). Would you be able to email me the compiled program (with symbols)? noloader, gmail account.
I apologize for the request. I recycled my Linux box, and don't want to work with a CygWin emulator.
Jeff
|
|
|
|
|
I learned graphics programming using win32 api and its possible my programming style is stuck in a different era, so could anyone tell me:
To the best of my knowledge there is no BitBlt with raster operation (ROP) codes in GDI+. IOW, only using GDI+, you cannot combine a source and destination bitmap using a basic bitwise logical operator (for example AND) on the binary bits of the two bitmaps. If this is the case, is it because bitwise logical ops aren't really necessary? I know GDI+ has alpha and other things that GDI does not. Are ROP codes just irrelevant in graphics programming today? I find that hard to believe - Consider that with a windows icon, it will store a black and white mask to be used in masking the background. How is that mask accomplished behind the scenes except via BitBlt with ROP codes?
My real reason for asking this is that I have recently been familiarizing myself with the flash/actionscript/flex environment for web development and you can do all sorts of complex graphical operations/masks with it. However in Actionscript as well, there is alpha blending and other things, but apparently no bitwise logical operations possible between bitmaps.
Thanks for anyone who can clear this up for me.
|
|
|
|
|
You can create a memDC, create a graphics object using the memDC, draw to the graphics object, let the graphics object fall out of scope, then bitblt the memDC all you want.
There are many things to do in the middle of all that but it is possible indirectly if thats what you need.
However, setting the ROP for line drawing in the DC, then creating the graphics object from the DC will not work for things like "Rubberbanding". To the best of my knowledge, you need to draw to the DC directly for things that use SetROP2()
|
|
|
|
|
GDI+ extends GDI, it doesn't replace it. You're free to use GDI if you need
the ROPs.
Force Code wrote: Consider that with a windows icon, it will store a black and white mask to be used in masking the background. How is that mask accomplished behind the scenes except via BitBlt with ROP codes?
Do you mean with GDI+? I believe when you load an icon into a GDI+ Image/Bitmap
it is converted to 32-bit ARGB so it uses alpha blending instead of the mask
(based on experience, not documentation...try it ).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Force Code wrote:
Consider that with a windows icon, it will store a black and white mask to be used in masking the background. How is that mask accomplished behind the scenes except via BitBlt with ROP codes?
Do you mean with GDI+? I believe when you load an icon into a GDI+ Image/Bitmap
it is converted to 32-bit ARGB so it uses alpha blending instead of the mask
(based on experience, not documentation...try it ).
Mark
So everything that can be accomplished with ROP codes can be done w/ alpha blending? I know what alpha blending is, and used it in an application I'm developing, but the concept of it as a complete replacement for bitwise logical ops on bitmaps is new to me. Would someone attempt to do away with C's bitwise operators - and then replace it with what? I don't get it. How would you replace the ROP code 0x00AC0744 (which I actually use somewhere). How do you replace SRCAND or SRCPAINT, for that matter. I guess I need to find out however, because none of the modern programming environments seem to have anything but alpha. Don't suppose you know of a primer that would get me up to speed. (Well, it looks like you implied above that rop codes are still needed - still slightly confused - why wouldn't actionscript have either bitwise AND or OR for bitmaps given all the myriad stuff it can do.)
|
|
|
|
|
Force Code wrote: but the concept of it as a complete replacement for bitwise logical ops on bitmaps is new to me.
Isn't it only partial. I'm not versed in graphics by any measure but doesn't GDI+ cover everything by providing DrawImage (which you can use multiple times) with Effects objects and ImageAttributes?
|
|
|
|
|
Thanks i'll look into this
|
|
|
|
|
Force Code wrote: So everything that can be accomplished with ROP codes can be done w/ alpha blending?
I never stated that anywhere. I attempted to answer a specific question -
the one I quoted from your post. If you weren't referring to GDI+ (which I
asked), then you can disregard the comment.
Again, if you want to use the ROP codes, use GDI. There's nothing wrong
with that....it's still fully supported.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Force Code wrote:
Consider that with a windows icon, it will store a black and white mask to be used in masking the background. How is that mask accomplished behind the scenes except via BitBlt with ROP codes?
Do you mean with GDI+? I believe when you load an icon into a GDI+ Image/Bitmap
it is converted to 32-bit ARGB so it uses alpha blending instead of the mask
(based on experience, not documentation...try it ).
Mark
Not sure what the mere fact its converted to ARGB indicates. It seems a bitblt could still be performed on the lower 24 bits. How would you make a bitmap background transparent only using the source, destination, and alpha blending (with no mask bitmap).
OK I'll answer my own question, by using the alpha channel as the mask bitmap.
|
|
|
|
|
Force Code wrote: Not sure what the mere fact its converted to ARGB indicates.
Then I guess you weren't referring to GDI+, so you can disregard my comments
about how icons are converted when brought into the GDI+ world.
Force Code wrote: How would you make a bitmap background transparent only using the source, destination, and alpha blending (with no mask bitmap).
With GDI or GDI+? With GDI+ I don't need to be concerned with the destination.
All I need to be concerned with is the source bitmap and the Graphics object's
compositing mode.
Any pixel in the bitmap that has an alpha-channel value of 0 will be transparent.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: With GDI+ I don't need to be concerned with the destination.
All I need to be concerned with is the source bitmap and the Graphics object's
compositing mode.
Does "compositing mode" mean the alpha channel or something else?
|
|
|
|
|
In a GDI+ Graphics object, the compositing mode determines how
a source color is blended (composited) with a destination color.
The alpha channel, if present, is used in both currently supported compositing
modes.
See Graphics::SetCompositingMode[^] for more details.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello guys!
I have a test to do and I don`t know where to start from:
I have a Pocket PC (FS Loox N560) with USB Host. In a future application I will have to get data on this USB cable from another device, but that device sends data on a Serial port. So, having to test if I can receive that data, I got a module that goes from USB to Serial.
Now, more specific:
I have to use the usb port of my device to send some data (random data). If this is successfull, a led will start blinking on that module, telling me that data is received to it (and will convert it to serial, in my future application).
I`ve been given a link to some drivers for this:
Virtual COM Port Drivers. On this page, the ARMxScale Processor: Driver 1.0.2.9
I`ve been told to use a virtual driver to simulate my usb port as a serial port and simply send some data through it. I must say that I have 0 experience in creating drivers (or using them) and very little experience in using the serial port. I know it`s physical principle (i`m studying at the university of electronics and telecomunications), and that you receive/send data by defining it as a file and reading/writing from/to this file.
I`m very grateful for any link,suggestion,snappet etc.
-----
If I`m posting in a wrong section, I`m sorry.
If I`m not allowed to post links like the 2 provided above or they are considered advertisment, I`m sorry and I`ll ask a moderator to delete them. Thanks!
-----
Let the led blink!
Shpid3r
|
|
|
|
|
Well, normally you shouldn't develop the driver yourself, it should be provided with the USB-to-serial module. But it is possible that there is no driver for it for PocketPC, you have to look at it. Otherwise, I don't think you'll be able to develop it yourself (you need to know how to interact with the module itself).
And if everything is fine and you have a PocketPC version of the driver, then it is quite easy to work with: you just open it as a standard serial port (you'll need to know on which port number though).
EDIT: BTW, maybe the module is already supported so you can just try and plug it in and see what happens.
|
|
|
|
|
10x Cedric, for your fast reply
The module is a non-profesional one, which was created by my supervisor from a scheme (so as a wild guess Plug&Play won`t work). It`s built around a specific chip that does this conversion (USB -> Serial). The same person instructed me to use that driver (from the links I gave in the 1st message) to make it work.
I suppose I'm here:
Cedric Moonen wrote: And if everything is fine and you have a PocketPC version of the driver, then it is quite easy to work with: you just open it as a standard serial port (you'll need to know on which port number though).
I just wonder.. how to determin the number ? Simply trying all of them ?
Are you aware of a link to some serial project (designed for WinCE) ?
|
|
|
|
|
Ok, so I suppose the driver will work (of course, you'll have to take the version for PocketPC). Just install it and plug your module to see if everything is ok (if it doesn't say that it is an unrecognized device, it should be ok).
shpid3r wrote: I just wonder.. how to determin the number ? Simply trying all of them ?
I know that you can get it from a key in the registry but as I never did it myself (and never played with the registry before), I won't be able to help you.
After a little search on codeproject, I found this[^]. You should test it and see if it works on your platform (it should normally). You can also have a look in the same category to find other articles about that.
|
|
|
|