|
I want to play targa files on device context . gdi+ unable to play
it . how it is possible .
|
|
|
|
|
I don't know anything about it but according to the DirectX 9 documentation[^] there is some support for Targa files.
led mike
|
|
|
|
|
I am trying to find out if there are any algorithms like the ones used in Visio in a class diagram or ER diagram. My basic requirement is that like in Visio, I have shapes and I try and connect them between them by drawing lines programmatically.
However, it would be great if someone can point me to any algorithms out there (no matter the programming language) which does collision detection and other things like automatically adjusting the shapes and lines if another shape is dropped on another shape. I hope I am being clear. Any algorithm written in .NET or any other language would be great or just an algorithm would be much appreciated. Thanks in advance. Really appreciate it.
Sriram
|
|
|
|
|
Have a look at GraphViz[^], maybe it can help you.
|
|
|
|
|
I have a custom control that i am able to change its opacity. In my client application, i have a picture box that i use to view the video from my web cam.
The problem is that, my custom control has refused to sit on to of the picture box. At design time and at runtime when my web can is shut down i can see it on top of the picture box; but at runtime when the web cam transmits its video to the picture box, the control goes below the picture box.
I want my control to always sit on top, can someone help me.
|
|
|
|
|
Initially, Z-order is determined by the order the controls are
created (assuming they have the same parent). What order do you
create the controls?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have not tried setting the z-order yet.
One thing i would like to stress on is that, when i place the default .net panel on the video viewer(picturebox with realtime image from the webcam) the panel remains on top. But with my custom semi-transparent panel, the video viewer over laps the custom panel.
I have a feeling that there is a/some lines of code im missing out in my custom panel.
I just found out that my semi-transparent panel can not display background images.
This is the code for the semi-transparent panel:
<code>
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing;
namespace VideoCapture_Tutorial
{
public partial class MyControl : Panel
{
private Color brushColor;
public MyControl()
{
InitializeComponent();
}
public MyControl(IContainer container)
{
container.Add(this);
InitializeComponent();
}
protected override CreateParams
CreateParams
{
get
{
CreateParams createParams =
base.CreateParams;
createParams.ExStyle |=
0x00000020; // WS_EX_TRANSPARENT
return createParams;
}
}
protected override void
OnPaintBackground(PaintEventArgs e)
{
//
}
protected override void
OnPaint(PaintEventArgs e)
{
Graphics graphics = e.Graphics;
Rectangle rect = new Rectangle(0, 0,
base.Width - 1, base.Height - 1);
Color brushColor = this.brushColor;
Pen pen = new Pen(Color.Black);
int num = (10 * 0xff) / 100;
SolidBrush brush = new
SolidBrush(Color.FromArgb(num, brushColor));
graphics.FillRectangle(brush, rect);
graphics.DrawRectangle(pen, rect);
pen.Dispose();
brush.Dispose();
graphics.Dispose();
//Invalidate();
}
public Color BrushColor
{
get
{
return this.brushColor;
}
set
{
this.brushColor = value;
base.RecreateHandle();
}
}
//protected override void
}
}
</code>
Thanks for your help. I guess you can still do more it is really urgent.
Thanks
|
|
|
|
|
I have not tried setting the z-order yet.
One thing i would like to stress on is that, when i place the default .net panel on the video viewer(picturebox with realtime image from the webcam) the panel remains on top. But with my custom semi-transparent panel, the video viewer over laps the custom panel.
I have a feeling that there is a/some lines of code im missing out in my custom panel.
This is the code for the semi-transparent panel:
<code>
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing;
namespace VideoCapture_Tutorial
{
public partial class MyControl : Panel
{
private Color brushColor;
public MyControl()
{
InitializeComponent();
}
public MyControl(IContainer container)
{
container.Add(this);
InitializeComponent();
}
protected override CreateParams
CreateParams
{
get
{
CreateParams createParams =
base.CreateParams;
createParams.ExStyle |=
0x00000020; // WS_EX_TRANSPARENT
return createParams;
}
}
protected override void
OnPaintBackground(PaintEventArgs e)
{
//
}
protected override void
OnPaint(PaintEventArgs e)
{
Graphics graphics = e.Graphics;
Rectangle rect = new Rectangle(0, 0,
base.Width - 1, base.Height - 1);
Color brushColor = this.brushColor;
Pen pen = new Pen(Color.Black);
int num = (10 * 0xff) / 100;
SolidBrush brush = new
SolidBrush(Color.FromArgb(num, brushColor));
graphics.FillRectangle(brush, rect);
graphics.DrawRectangle(pen, rect);
pen.Dispose();
brush.Dispose();
graphics.Dispose();
//Invalidate();
}
public Color BrushColor
{
get
{
return this.brushColor;
}
set
{
this.brushColor = value;
base.RecreateHandle();
}
}
//protected override void
}
}
</code>
Thanks for your help. I guess you can still do more it is really urgent.
Thanks
|
|
|
|
|
Orson wrote: I have not tried setting the z-order yet.
But that's what determines what gets drawn on top of what
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How do the video frames get drawn on the picture box?
Since video frames are being drawn periodically, you'll also
need to redraw any overlaid controls each time a frame is drawn.
Of course, this will flicker....you'll probably have to deal with
that as well.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What event do i override for the picture box(video viewer) for repainting the picture box?
How do implement the z-order?
Sorry im asking to many questions, i just came into c# im from a java background.
|
|
|
|
|
Orson wrote: What event do i override for the picture box(video viewer) for repainting the picture box?
The Paint event? I'm still unclear as to how the video is being drawn
on your picture box. What control are you using?
Orson wrote: How do implement the z-order?
You can change the z-order of controls on a form using the
Control.ControlCollection.SetChildIndex Method[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Im using the avicap32 and user32 dll's of windows to preview my video from the webcam to my picture box.
The code fragment from different layers on my application that previews the video in the picture is displayed below:
<br />
private void lstVideoSources_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
Device d = DeviceManager.GetDevice(lstVideoSources.SelectedIndex);<br />
d.ShowWindow(this.video_viewer);<br />
}<br />
<br />
<br />
<br />
public void ShowWindow(global::System.Windows.Forms.Control windowsControl)<br />
{<br />
Init(windowsControl.Height, windowsControl.Width, windowsControl.Handle.ToInt32());<br />
}<br />
<br />
<br />
public void Init(int windowHeight, int windowWidth, int handle)<br />
{<br />
string deviceIndex = Convert.ToString(this.index);<br />
deviceHandle = capCreateCaptureWindowA(ref deviceIndex, WS_VISIBLE | WS_CHILD, 0, 0, windowWidth, windowHeight, handle, 0);<br />
<br />
if (SendMessage(deviceHandle, WM_CAP_DRIVER_CONNECT, this.index, 0) > 0)<br />
{<br />
SendMessage(deviceHandle, WM_CAP_SET_SCALE, -1, 0);<br />
SendMessage(deviceHandle, WM_CAP_SET_PREVIEWRATE, 0x42, 0);<br />
SendMessage(deviceHandle, WM_CAP_SET_PREVIEW, -1, 0);<br />
<br />
SetWindowPos(deviceHandle, 1, 0, 0, windowWidth, windowHeight, 6);<br />
}<br />
}<br />
Im trying out what you said...
|
|
|
|
|
Can i send you the entire code through your mail box please?
|
|
|
|
|
I just noticed something. I tried to change the z-order and position(left,top) on the click event of the picturebox, but each time i click on the picture box while the video is on it, nothing happens. but when i stop the video(i.e when picturebox is now like normal without images) and click on the picturebox the action specified in the click event takes place.
I feel the video is like a different layer on top of the picture box.
Another important note is that the video also works on a panel.
|
|
|
|
|
Orson wrote: I feel the video is like a different layer on top of the picture box
In a way, it is. You won't be able to draw on the top of live video because
every new frame gets drawn on top of whatever you draw there. Changing the z-order
will not help here - VFW still just draws to the screen.
To get around this, you need (ideally) to be able to draw on a video frame before
it is drawn to the screen. This will prevent the flicker associated with redrawing
any overlay over the top of every video frame on the screen.
With VFW, capSetCallbackOnVideoStream() can help.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hey guys..anyone knows a good website to download .x models to use with directx 9?
thank you
|
|
|
|
|
|
|
thanks guys..but maybe i should have mentioned i want FREE sites ?:P
|
|
|
|
|
How about here[^]? You can easily convert these into .X models using a model converter.
|
|
|
|
|
thanks man
|
|
|
|
|
Hi,
Sorry about my english at first.
i am doing mobile education project in CF. while students solving questions, they must solve questions with using touchpad only. (not use of paper) I showed questions in a picturebox(1 question per 1 picturebox. For every question there is forward button.) But at the solution process i dont want to change image of picturebox (re-usable) so i think about a layer for paperwork only. and also if student moved on to other question,the paperwork thing must exist also (if student want to come back to question.).
is there a way to edit or add picturebox for a layer?
(C#-Visual Studio 2005-CF)
Quiet important thanks
modified on Tuesday, January 22, 2008 8:38:48 AM
|
|
|
|
|
I noticed that I'm not the first person to ask this question. "levgiang" has also asked a similar question.
What would be the recommended ways of saving a series of computer generated bitmap (frames) to an animated file format. I'm creating a series of computer generated bitmaps/images and I would like to find an expedient way of saving the frames in a popular animation file format so that the entire series can be independently viewed in a generic windows media player.
As a follow up question, what would be the recommend ways of reversing this process, where I retrieve an animated file into a C# or VB program so that the individual frames can be separated out for further processing.
I'm currently teaching myself Visual Studio Express 2005 using VB and C#.
BTW, would it help to upgrade to Visual Studio 2008?
Thank you for your help!
Steve
www.OrionWorks.com
www.zazzle.com/orionworks
|
|
|
|
|
Hello.
How would I make my game draw a new Texture2D that goes the way the right analog stick is facing when the right trigger is down? (think Geometry Wars, etc.) I have the things needed for the stick (enum direction) and trigger (bool isRightTriggerDown), but I don't understand how to draw the new sprites, or atleast how to make them move seperately than each other in different directions. Would I use a for loop to draw how many is needed, or what. Help would make me very happy. Thanks for reading, at least. (and in advance)
- I love D-flat!
|
|
|
|