|
I think you need to look at the differences in how CFrameWnd and CDialog route messages their children. Or at least see how to get a child window hooked into the CDialog routing. It's been a while since I've looked at the MFC source and I'm not sure I could stomach it now.
If you don't have the data, you're just another a**hole with an opinion.
|
|
|
|
|
|
Hi,
I have got a big topographical jpg file that I want to display in a form on a picturebox in its real coordinates that ranges X from 50 000 to 75 000 and Y from 2 800 000 to 2 825 000. this will make it very easy for me to get the mouse coords in real coords as the user invokes the Mousedown event. It will also make it easier for me to draw real features in its real coordinates.
I have got the code:
Image image = Image.FromFile(@"C:\Images\2529DA.jpg");
Pen myPen = new Pen(Color.Black);
Graphics formGraphics = this.picGrid.CreateGraphics();
formGraphics.Clear(picGrid.BackColor);formGraphics.DrawImage(image,0,0,1000, 1000);
This shows the topomap nicely on the screen but with the local picturebox coords from 0 to 1000. If I change the code to
formGraphics.DrawImage(image, 50000, 2800000, 25000, 25000);
This previous code then puts the map WAY offscreen to the south-east !
I tried fiddling with the following code but no luck.
formGraphics.DrawImageUnscaledimage,0,0);
formGraphics.DrawImageUnscaledAndClipped(image, rect1);
please help !
Thanks
Ian
|
|
|
|
|
I know that you can save images in the Gif format, but how do you make an animation and save it as a Gif.
please help
When you take a Nerd and a Jock and put them together you get a Nock
|
|
|
|
|
AFAIK GDI+ does not support writing multiframe GIF files
(although it WILL read them).
There's probably libraries that will write them, or if you want
to roll your own:
GIF Specification[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for the help
Do you know of any librarys, because the link was some outdated info on Gif encoding.
If you do not would there be a way to do it using unmanaged code, (I don't know unmaneged code at all)
When you take a Nerd and a Jock and put them together you get a Nock
|
|
|
|
|
The Only Nock wrote: Do you know of any librarys, because the link was some outdated info on Gif encoding.
It's not outdated - that's how long the GIF format has been around
I don't know of any libraries or code to make them programmatically.
It's a shame GDI+ doesn't do it.
Have you searched here at Code Project? Something like this may yield
some good info: NGif, Animated GIF Encoder for .NET[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Windows Picture and Fax Viewer can not view BMP files writen by self-made C++ code (Drawing failed). Either thumbnail of these files are not shown, but they are correctly openable at least with MS Paint, IrfanView and QuickTime PictureViewer. Whats the problem?
|
|
|
|
|
Something wrong with the bitmap I imagine.
Some image loading code is more forgiving than others
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I reveal little bit more: in my code the file size is not set into header, this is only difference against BMP file def. BUT, I have hex dumped many BMP header mady by different programs, and some of them there is neither file size set and these files are still openable with Win Fax Viewer + thumbnail! Magic!
|
|
|
|
|
Well since your image is perfect then you should report a bug to microsoft.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Tapio Grönfors wrote: Windows Picture and Fax Viewer can not view BMP files writen by self-made C++ code (Drawing failed). Either thumbnail of these files are not shown, but they are correctly openable at least with MS Paint, IrfanView and QuickTime PictureViewer. Whats the problem?
Let's see. Your homegrown code doesn't get the image shown in several applications. Obviously the problem is with them - it couldn't possibly be that there's a bug in your code now, could it?
|
|
|
|
|
How to identify the image is piggy backed or overlapped?
|
|
|
|
|
What image? What is "piggy backed or overlapped"?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I know you can make a icon using
'Icon k = Icon.FromHandle(WorkingImage.GetHicon());'
how do you add more than one icon to the icon file
When you take a Nerd and a Jock and put them together you get a Nock
|
|
|
|
|
There is only one way to have more than one Icon in the file.
Write the file using bytes yourself.
When you take a Nerd and a Jock and put them together you get a Nock
|
|
|
|
|
I am having trouble With drawing to an image using the Graphics class. I have tried
'...
void somebutton_click(...)
{
Graphics g = Graphics.FromImage(checkbox1.Image);
...
g.Draw...(...'
and
'Graphics g = checkbox1.CreateGraphics()'
the end result is a unchanged picture
please help, I am new
also if you did not see, the language C# and .Net framework
When you take a Nerd and a Jock and put them together you get a Nock
|
|
|
|
|
Since no one answered my question, the question was
1. A question so stupid that no one bothered to answer
2. No one knows
In the case of the second answer I will be answering my own question.
The answer was simple, The Graphics will not draw on a null image (I never assined the checkbox a image).
So to fix this problem you just give the checkbox a Bitmap in the beginning.
The weird thing is that the Graphics class gave no exceptions or errors other that the fact that it would not draw.
When you take a Nerd and a Jock and put them together you get a Nock
|
|
|
|
|
Hi
Here is link http://www.assol.mipt.ru/isr/catalog_en.html . Here if u click on an photo, a new page will be opened with that photo enlarged, and there u can choose textile material, color for that photo, and new photo is whith selected colors, textile is gained.
I just want u to show me the way, programming language(easy to write program analog to this),which programming section i should learn(image processing or something like this). I want to write program similar to this, but a desktop program,
Now i'm programming on C#.but have no idea,experience in image like programming
Thanks in advance
|
|
|
|
|
For the graphics, all of that can be done with GDI+[^]
which can be accessed in C# using classes in the System.Drawing Namespace[^].
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
I am developing an application where i want to display live video and also do some image processing.
I tried:
1. Video for Windows API : easy but not quite comprehensive and not able to use overlay
2. 3rd Party SDK: nice quality still no overlay support, no single frame capture fn.!
3. GDI+ is an option but not quite preferable for fast video display and capture where I think DirectX goes well. Thus selected latest DirectX v9 which is latest for WinXP.
4. searched for DirecX but got DirectShow links which is deprecated in DirectX 9. also could not find suitable code for capturing single frame.
I've been searching for quite a while now. searched through CodeProject, MSDN, Google; but could not get exactly what i wanted.
Thus can you guide/suggest in the following area:
How to easily use DirectX 9.0 for displaying video from devices and capturing frames
I want to achieve this with very simple ( minimalistic) coding as i am beginner in this area and would not like to indulge with the complexity of DirectX (one of the most complex API's by Microsoft) for that purpose please suggest how to use Windows Media Player SDK or Windows SDX.
How to use DirectX 9.0 API's in -
1. Live video: display live video from digital camera / (analog camera + framegrabber card).
2. Overlay: displaying informative data over(on top of) the video (i guess this is what they call Overlay)
3. Capture Frame : capturing Current frame(image) for Image processing
platform: C#.NET, Visual Studio 2005, .Net Framework 2.0, WinXP Prof. SP2 on Pentium Core 2 duo 2GHz , 1GB Ram PC with Intel onboard graphics accelerator.
any help/suggestion or links highly appreciated ...
thanks.
|
|
|
|
|
LoneInvader2007 wrote: searched for DirecX but got DirectShow links which is deprecated in DirectX 9.
It's not deprecated. In fact DirectShow is so not deprecated
that its SDK was rolled into the platform SDK because it's a standard
part of the operating system.
The next generation (Vista+) Windows multimedia platform is Media Foundation[^]
You are, of course, free to use whatever capture and render methods you choose...
just keep in mind DirectShow has taken care of a LOT of the render/capture work
for you
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
@ Mark Salsbery
- Thanks for your reply.
Mark Salsbery wrote: DirectShow has taken care of a LOT of the render/capture work
provided DirectShow is well documented/supported on MSDN or elsewhere;
can DirectShow help in drawing graphics over the video (live video from camera)?
As these lines from Wikipedia Article http://en.wikipedia.org/wiki/DirectShow[^] imply it does'nt -
"Windows XP introduced a new filter called the Video Mixing Renderer 7 (VMR-7 or sometimes just referred to as VMR). The number 7 was because VMR-7 only used DirectDraw version 7 to render the video and did not have the option to use GDI drawing. The main new feature of VMR-7 was the ability to mix multiple streams and graphics, allowing applications to draw text and graphics over the video "
due to WinXP OS constraint, Thus I selected Direct3D (DirectX 9) over previous DirectDraw and DirectShow. (added to it the complexity of DirectX and the simplicity of me as a beginner in this field , i would really prefer the Managed DirectX or XNA as these API's provide simplified access through .NET.
keeping in mind that my current application is a machine vision application which only demands simple video capture display and capturing single frames for Image Processing.
For DirectX, web is full with help/guidance for game development and no such serious help is available for unique applications such as this one.
Thread like this is pretty much needed for such type of applications which will then prosper on DirectX technology.
On behalf of many I have just started the thread. I request everyone to take a note of this and contribute to this thread by answering the questions raised here and similarly wherever.
Thanks.
any help/guidance/feedback will really be appreciated
Question:
How To use DirectX 9.0 For Machine Vision Application:
How to use DirectX 9.0 API's in -
1. Live video: display live video from digital camera / (analog camera + framegrabber card).
2. Overlay: displaying informative data over(on top of) the video (i guess this is what they call Overlay)
3. Capture Frame : capturing Current frame(image) for Image processing
platform: C#.NET, Visualt Studio 2005, .Net Framework 2.0, WinXP Prof. SP2 on Pentium Dual Core 3GHz PC with Intel on-board graphics accelerator.(graphics card can be considered for DirectX)
|
|
|
|
|
LoneInvader2007 wrote: can DirectShow help in drawing graphics over the video (live video from camera)?
Yes. Whether it does what you need it to do or not, I don't know.
I do know Wikipedia isn't the ultimate source of info on DirectShow.
Using the Video Mixing Renderer[^]
Rendering is just one part. Acquisition also need to be considered.
Does the device have a WDM driver? If you've got capture covered already,
you can do rendering however you want to.
I personally use DirectShow for capturing from WDM and legacy VFW devices.
I do my own custom rendering for drawing on the video frames before they are
rendered, using GDI, not Direct3D (I personally found no benefit from the added
complexity of Direct3D, since all I'd use it for is back-buffers that don't need
to be on hardware).
The DirectShow SDK is freely available and includes enough sample code to create working
apps by mostly copy/paste - check it out, see if it's what you need.
Use whatever is best for your application.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Yes. Whether it does what you need it to do or not, I don't know.
I do know Wikipedia isn't the ultimate source of info on DirectShow.
Thanks for your recommendation. application needs basic drawing on the live video display.
thanks for the msdn link, how could'nt i get that link
need to check.
will convey the status...
meanwhile (if there is a need for a good text) could you suggest a good one for DirectShow 9
|
|
|
|