|
I suggest you learn SDL.. its fast, portable.. and easy to learn
I made a tetris game using it. It was amazing to look at your game run both on windows and linux...
DirectX/DirectDraw is good... but I think SDL is better for your needs, most 2D needs. and you can even do 3D by mixing OpenGL with it.
|
|
|
|
|
hi all
i'm new in graphics...
i want to build a small 2d module of my room, with all the closets and tables...
but i dont know where to start...
is it to much more difficult the draw a 3d module???
i will appreciate if you can guide me
|
|
|
|
|
by the way... i'm writing in c#
|
|
|
|
|
|
I am trying to write some code to reconstruct a small irregular shaped "hole" in an image where the image data has been lost. My hope is that by analysing the surrounding image I can make an intelligent guesses as to what the missing part might look like.
Using standard edge recognition techniques I have managed to identify strong contrast edges in the surrounding image. The next step is to identify which of these edge lines cross the hole and to extrapolate them across.
The image at http://www.bracknellbridge.com/images/Thinned1.bmp[] shows where I'm at. The dark surround represents part of the image for which data is intact and the light grey centre is the area I am trying to reconstruct. The white line segment above and below the light grey area represents a high contrast edge. To the human eye it looks like this line probably crosses the light grey area. What I need is a general algorithm to recognise this situation and extrapolate the line across the hole.
It has been suggested that the Hough transform might be the way to go but I'm struggling with how to apply this in a practical sense. Is the idea to consider every possible pair of points and calculate the parametric equation of the line passing through them, then see which values are most common?
It sounds simple in theory but I can think of practical problems. If points A and B are on line 1 which is very close, but not identical, to line 2 which joins C and D how can I ensure they are interpreted as 2 votes for "nearly" the same line? How close is close enough?
If anyone has some practical advice or ideas I should be very interested. A practical code example of the Hough transform would be especially useful.
Keith
|
|
|
|
|
Indirectly you do consider every possible pair of points, but algorithmically it's a bit simpler.
Start with an array representing the unknown region, initiallized to all zeroes. Then go through each known point in the original image, and if it's white, trace out line segments in your array that go through this point (at different angles), incrementing the array elements each line intersects.
You'll get a lot of "noise", but the highest values in the array will be along the missing segment because all the known white points will combine their "votes" along this line.
|
|
|
|
|
Alan
Thanks for your response. I'm still floundering a little. When you say to start with an array representing the unknown region I presume you mean one array element per (unknown) pixel?
It's the next bit I'm having real trouble with. Trace out line segments at different angles. How many different angles? It's always possible to construct a line which passes through any two given points, so for every white image pixel and every pixel in the unknown area it will always be possible to construct a line, at some angle, which intersects both. It seems to me, therefore, that if you try enough angles then for any one white image pixel, every pixel in the unknown area will get some votes, with the pixels nearest to the white image pixel getting the most because a wider range of angles will result in a line which passes through them due to rounding errors.
I suspect I may have misunderstood something in your explanation.
Keith
|
|
|
|
|
Yes, one array element per unknown pixel. You'll have to experiment with different numbers of angles. Too many, and every point will cover the whole unknown region. Too few, and you'll miss reinforcing the pixels over the true line.
Also you'll want to limit the length of the segments you trace from each white point, so you don't have irrelevant distant pixels influencing your analysis.
You want to select values such that the pixels in the unknown region that are colinear with the white lines get the most reinforcement.
After you trace from the white pixels, you need to threshold the unknown region, i.e. consider every pixel with a sum above some value to be white, and all others black. This will take some experimentation to determine the best value.
|
|
|
|
|
Hello!
I'm writing my DirectShow filter and I need to handle DVD (play, pause and stop) events...
Base filter class is CTransInPlaceFilter. Have You got any idea?
Thanks
|
|
|
|
|
|
Thanks for replying, but this is not exactly what I need.
I must catch the events from inside of the filter.
I can create hidden filter window and subclass the player window or change it
and resend messages to the player,
but it's slightly hard and hacky solution.
Aren't there any better way to catch the events directly in the filter class?
|
|
|
|
|
I don't know, I haven't done much with DirectShow. But I suspect this is possible, you just need to dig a little more.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
I use images for my toolbars and other gui elements from IconArchive.com and VistaIcons.com but sometimes I don't get the ones I need.
Does anyone knows where to get more free icons?
|
|
|
|
|
Subj.
I know one can make a region out of GraphicsPath which has methods like intersect , exclude , xor , union etc. that allow to combine regions in various ways. But can I do the same with GraphicsPath itself somehow (it doesn't have anything similar)? Regions are problematic since one can only fill it. Can't draw it and it doesn't pay attention to Graphics.SmoothingMode and Graphics.CompositingQuality .
Let's say I have a polygon in a GraphicsPath. I want to cut an oval shape out of it on a side.
Please help!
|
|
|
|
|
Hello all,
I'm facing a challenge, creating a winform(c#) that displays tif images,
very large ones, that when loaded, they occupy the majority of the memory.
My theory is that I could resize, change the dpi, before they are displayed,
because you wouldn't need the amount of detail just to view them anyways.
So, from a 600dpi image, I would like to be able to both change it to, say 300dpi,
and resize it to further decrease memory usage.
But, you still need to load the image into memory in order to manipulate them?
Is there another approach that does not involve trying to load the full image into memory?
Note, I still want the file to be in it's original state. Just want to resize it when viewing.
best regards,
Ryan
|
|
|
|
|
Hi,
Iam new to WinCE .net and im developing a UI in C#. My problem is that my form is not complty shown in the output window . Why is this happening? Please help.
Sayana
|
|
|
|
|
Hi everybody,
I would like to create a project template for the community programmers, for now I would like to create a Project template for the Visual C++ 2008 for the HGE framework. But I would like to know how I can start?
Thanks for the attenction and have a nice day.
Sorry for anything.
[Jack Dracon Game Programmer Beginner] - Brazil
|
|
|
|
|
Actually related to transparent text box.
The simple solution was to define a "large" Label with background set to transparent since a "textbox" can't be transparent. Although "DrawString" works well enough. I would like to set the "textbox" background to the image underneath and use standard text display.
A sample:
Dim Some_Image As Image
Some_Image = Image.FromFile("Test.bmp")
'For testing the bmp is 312x445
'Hard-coded Co-ordinates for testing
Using gr As Graphics = Graphics.FromImage(Some_Image)
Dim StartPoint As New System.Drawing.Point(17, 200)
Dim EndPoint As New System.Drawing.Point(0, 0)
Dim SizeClip As New System.Drawing.Size(181, 96)
Dim TextBackground As Image
TextBackground = gr.CopyFromScreen(StartPoint, EndPoint, SizeClip)
Label1.Image = TextBackground
Label1.Text = "Overlay Text"
End Using 'gr
'Paste up the image
PictureBox1.Image = Some_Image
The "CopyFromScreen" won't compile. Error="Expression does not return a value"
Commenting that statement out and replacing with
Label1.image=Image.FromFile("someotherimage.bmp") works
Hope I explained this clearly!
|
|
|
|
|
CAN Coder wrote: The "CopyFromScreen" won't compile. Error="Expression does not return a value"
Correct, because Graphics.CopyFromScreen() doesn't return a value.
The method copies pixels from the screen to the drawing surface
associated with the graphics object. Since you want that surface to be
an Image/Bitmap, you need to create the Image (the appropriate size and
desired format) first, then create a Graphics from the Image (using
Graphics.FromImage() is fine). Then calling CopyFromScreen() on this
Graphics object will copy pixels from the screen onto your image.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
I have the following problem: I painted a rectangle with a text outside of my app on the screen in the WM_PAINT message. The Problem is that it flickrs very hard. The code I use:
hdc = GetDC(NULL);
SelectObject(hdc, GetStockObject(WHITE_BRUSH));
RoundRect(hdc, 10, 10, 100, 40, 9, 9);
rc.left = 10;
rc.top = 10;
rc.right = 100;
rc.bottom = 40;
SetBkColor(ps.hdc, RGB(255,255,255));
DrawText(hdc,L"Hello",5, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
ReleaseDC(hWnd,hdc);
I also tried using the WM_NCPAINT message but the it destroys the complete app frame.
Thanks for help.
bye,
gabbana
|
|
|
|
|
Okay i solved the problem with the double buffering system.
I created a new DC and a Bitmap and draw into this dc and made an bit block transfer at the end into the right DC.
|
|
|
|
|
I have been working with a small vision application,in Directshow,
and i want a control that, like a TrackBar can move, but i want it to scan the surface of my window
with a line that then returns picture data for that specifice scan line !!!
My problem is that i have not worked with graphic programming before!!!
And i have been looking through some articles,but havent found what i am looking for.
language i am working with C++
Compiler i am working with is Borland C++.
Questions:
1) Is it possible to generate own windows classes like the BUTTON class in WIN32 API ?
2) Is there a language that makes graphic programming easy.
3) Been looking for a place to start, is game programming a whay to start when learing
graphic programming, or is there another whey to solve my problem ??
Any articles and help will bee appricated.
|
|
|
|
|
1) Yes its possible -> creating own controls
2) c++
3) You cannot compare game development with graphic development, because the first also includes thinks like AI,..., my best way would be start with GDI (GDI+) and then begin with Direct3D.
|
|
|
|
|
Any one who knows about BBM format and its specifications, or how to convert any image to BBM format using C#, please help me.
Searched in all blogs, no clue about BBM format.
Thanks in advance.
|
|
|
|
|
I couldn't find much about it. It appears to be an image format used for animation. You might want to check out LBM (which is essentially IFF) first as I bet BBM is very closely related.
Cheers,
Drew.
|
|
|
|