|
Wow, true.. it worked on a WMV.
I found a link which might hint some Managed DirectX issues on Vista: http://www.thezbuffer.com/articles/470.aspx[^], and other sites also hinted similar incompatbilities due to DirectX 10.
There is also mention of MDX.. but I have not yet a clue what it is exactly.
Still its strange it works on a WMV and not on an AVI.
|
|
|
|
|
I saw that link too. Not much mentioned about it during the
last year or two.
dwg1986 wrote: MDX.. but I have not yet a clue what it is exactly.
MDX == Managed DirectX I suppose
dwg1986 wrote: Still its strange it works on a WMV and not on an AVI.
Yeah - I wish I had the source code to see what the Video
class is using and what's missing on Vista!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Oh yeah.. MDX, Managed DirectX. *slaps himself* Damn was I tired.
So my options till now are:
1. Convert AVI library to WMV. No sense there.
2. Resort to some other third party SDK. (which I still have not found after hours searching)
3. No idea.
I'll post back if I get any success.
Thanks for all your help.
|
|
|
|
|
|
My Project required that I have to load the image from resource.
using Gdiplus::Bitmap::FromResource function , so I have to save the image in BMP format and it doesn't support alpha channel.
Are there anyway I can access the internal data of image after loading it so I can add alpha=0 to pixel that has particular color?
something like this psuedo code
for(int i=0;i<totalpixel;i++){>
if(pixel[i].r == pixel[i].g == pixel[i].b == 0){//if the pixel is black
pixel[i].a = 0;
}
}
thank in advance
modified on Friday, September 26, 2008 7:27 AM
|
|
|
|
|
Load the bitmap
Create a new Bitmap object with pixel format PixelFormat32bppARGB
Create a Graphics object from the new bitmap
Draw the original bitmap on the Graphics object
Use Bitmap::LockBits on the new bitmap to get direct access to the
pixel bits (the BitmapData struct has all the info you need to iterate
through the pixels)
Loop through the pixels setting alpha channel values as desired
Call Bitmap::UnlockBits on the new Bitmap
Dispose the Graphics object and the original bitmap
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank for your answer , I will try it
|
|
|
|
|
Is there also a way to loop through the pixels in VB?
Thank you
Michael
|
|
|
|
|
hello
tried to make a screencapture of a panel with controls on it and "connections" at the background (created using paint() procedure). DrawToBitmap does only the visible part of the panel, so i came up with the following code after a while. problem is that the invisible part of the panel turns up black in the resulting jpeg picture. Does anyone have any suggestions for me?
public static void CreateScreenCaptureFile(Control ctrl, string path)
{
// get dimensions (part may be invisible)
int w = 0,h = 0;
foreach(Control c in ctrl.Controls )
{
if(c.Left + c.Width > w) w = c.Left + c.Width + 100;
if(c.Top + c.Height > h) h = c.Top + c.Height + 100;
}
if(w == 0) w = ctrl.DisplayRectangle.Width;
if(h == 0) h = ctrl.DisplayRectangle.Height;
// create bitmap
IntPtr hwnd = ctrl.Handle;
Bitmap b = new Bitmap (w, h);
Graphics bg = Graphics.FromImage (b);
IntPtr bgdc = bg.GetHdc ();
SendMessage(hwnd , WM_PAINT, (int)bgdc, 0);
SendMessage(hwnd, WM_PRINT, (int)bgdc, (int)(
DrawingOptions.PRF_OWNED |
DrawingOptions.PRF_CHILDREN |
DrawingOptions.PRF_CLIENT)
);
bg.ReleaseHdc();
bg.Dispose ();
// save the result jpeg file
b.Save(path, ImageFormat.Jpeg);
b.Dispose ();
}
|
|
|
|
|
jVersteegen wrote: the invisible part of the panel turns up black
There's no way to get "invisible part" because it doesn't exist.
Invisible parts, by definition, are invisible - they don't get drawn.
Why are you sending a WM_PAINT message? You can't do that - the system
should send that message, not you, and it's not doing anything useful
in your code.
What if you add the PRF_NONCLIENT drawing option to your WM_PRINT message?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Sorry for the late reaction, i had given up hope on any reactions....
adding PRF_NONCLIENT does not change anything.
is there any way to change the background color to white?
thanks!
|
|
|
|
|
joost.versteegen wrote: is there any way to change the background color to white?
Paint white on bgdc before doing the WM_PRINT.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
thanks! I will try later, time to go home now...
have a nice weekend!
cheers
|
|
|
|
|
joost.versteegen wrote: have a nice weekend!
Thank you! You too!
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi,
i have drawn a cube in tao framework in c#.i want to draw a big container(truck) and some small packages(boxes ).These boxes will be packed in the big container.The color of the boxes should be of different colors pertaining to a particular customer.Plz help me out.
regards
aurosikha
|
|
|
|
|
hi all.
i have some problem in using directx to show 3d model in windows.
1.I loaded some .x file in c# and want to rotate them.but there is some problem .when a object rotate some of it's side disappear.
2.problem is that how can i set center of my object for rotate object around it not around Coordinate System .
3.when i assign some bitmap on my object it repeat many time on object surface.
i want to it cover all of my object no tile on it.
its code:
device.Transform.World =
Matrix.Scaling(handle.XScale, handle.YScale, handle.ZScale) *
Matrix.RotationZ(Geometry.DegreeToRadian(handle.ZRotate)) *
Matrix.RotationY(Geometry.DegreeToRadian(handle.Yrotate)) *
Matrix.RotationX(Geometry.DegreeToRadian(handle.XRotate)) *
Matrix.Translation(handle.X, handle.Y, handle.Z);
for (int i = 0; i < handle.MeshMaterial.Length; i++)
{
device.Material = handle.MeshMaterial[i];
device.SetTexture(0, handle.MeshTexture[i]);
handle.mesh.DrawSubset(i);
}
handle is my object that contains my 3d info.
sepel
modified on Wednesday, September 24, 2008 3:18 AM
|
|
|
|
|
anyone have links, magazine articles, book titles, or open source project references
question 1:
what are some algorithms available to simulate how ms word draws each page as i scroll through 1000+ page document. Assuming the whole document cannot be loaded+drawn in memory all at once. How does the buffering work?
Realistically i'll be rendering a printed circuit board that might have many circles, rectangles using filled polygons. If the user zooms in, a given polygon might border the canvas and outside region. how would this partially on screen object be drawn? Should i send my canvas containing perspective+coordinate to all the objects and have the actual objects draw themselves to the canvas. Each shape will need to know how to partially render itself.
are there any advanced articles in this subject?
question 2:
what are some algorithms for
snapping to grid,
when connecting components how auto route lines (shortest route + no overlapping.)
thanks,
-lm
|
|
|
|
|
I need some 3D Models ( cars, people, trees etc. )
Where can I download them from and use them LEGALLY in my applications.
My applications are non-commercial. But I may upload them in codeproject.
Thanks in Advance.
|
|
|
|
|
I forgot to mention. I don't want to pay for the models.
|
|
|
|
|
AmitDey wrote: I don't want to pay for the models.
Of course.
You didn't say what formats but here are a couple of links I've been sitting on for years.
3D Archive[^]
Great Buildings[^]
If you don't have the data, you're just another a**hole with an opinion.
|
|
|
|
|
I want format supported by XNA (.fbx)
But I can convert 3D Studio (.3ds) , DirectX (.x) file using blender to .fbx
|
|
|
|
|
a design that is simple but can make others shock when they see it..
anyone.. pls help me..
|
|
|
|
|
Black font on black background - shockingly simple.
Or what about mintgreen font on pink background, frame and title bar in all rainbow colours... nausea guaranteed.
|
|
|
|
|
Hey everyone, do you know particle deposition?it is an algorithm used to create 3D models. By any chance,does anyone here knew bout this algorithm?thanks
|
|
|
|
|
hello friends,
how can i make a simple, soft and nice brush like that is in the microsoft paint?
My solution was to draw consecutive circles in my mouse drag event and add them to the array list and then repaint all circles in the array list. but some of the events of mouse drag are missed and this make my brush dotted. i want to know how can i make it more smooth. please guide me.
thanks
|
|
|
|