|
Hours and hours of endless research on the internet finally revealed the following result:
TreeMaker 5 (source included)[^]
Just kidding, 3 seconds with Google and I found it. Maybe you should first learn, how to use Google?
|
|
|
|
|
Hi,
I've been trying to display a transparent rectangle using standard Win32/GDI coding now for at least an hour. I've searched in tons of places, but I just can't get it working. This is my current code:
RECT r = GetRect();
HBRUSH brush = CreateSolidBrush(RGB(0x00, 0xD7, 0xEC));
FillRect(hdc, &r, brush);
DeleteObject(brush);
That displays fine, but it displays a completely opaque rectangle and I'm clueless on how to go about making it transparent.
Any help is very much appreciated!
Thanks,
Martin
|
|
|
|
|
I wouldn't recommend using GDI for transparency - it wasn't designed to accommodate such features.
Instead, I'd take a look at GDI+, an extension of the GDI library and is included with versions of Windows XP upwards, but can also be distributed as an executable with your app if the target OS is lower than this. It's also a good library to familiarise yourself with for the future due to its diverse graphics manipulation functions included.
Something like this could create a semi-transparent black rectangle:
SolidBrush solidBrush(Color(150, 0, 0, 0));
graphics.FillRectangle(&solidBrush, 0, 0, 100, 50);
Take a look more at the SolidBrush() class, the FillRectangle() method.
Regards,
--Perspx
"I've got my kids brainwashed: You don't use Google, and you don't use an iPod." - Steve Ballmer
"Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph." - Linus Torvalds
|
|
|
|
|
Thanks, I'll check it out.
|
|
|
|
|
ummm....you are explicitly creating an opaque brush and then filling
a rect with it. There's nothing transparent about any of that
If you are trying to draw a hollow rect...
HPEN pen = CreatePen(PS_SOLID, 1, RGB(0x00, 0xD7, 0xEC));
HGDIOBJ oldpen = SelectObject(hdc, pen);
HGDIOBJ oldbrush = SelectObject(hdc, GetStockObject(HOLLOW_BRUSH));
Rectangle(hdc, r.left, r.top, r.right, r.bottom);
SelectObject(hdc, oldpen);
SelectObject(hdc, oldbrush);
DeleteObject(pen);
Mark Salsbery
Microsoft MVP - Visual C++
modified on Saturday, November 1, 2008 10:12 PM
|
|
|
|
|
I've downloaded the Cimge library (for mac) but can' compile it. I've tried different versions
Compile for Linux/BSD/MacOSX, with X11 display and standard options.
Compile for Linux/BSD/MacOSX, with X11 display and debug informations.
Compile for Linux/BSD/MacOSX, with X11 display and optimizations.
Compile for Linus/BSD/MacOSX, with minimal dependancies.
Compile for Linux/BSD/MacOSX, with maximal dependancies.
but dosen't seems to work.
Can anyone help me please
Thanks a lot
|
|
|
|
|
Hi
How can i use TCL\TK for openGL?
Do anybody have any learning material?
|
|
|
|
|
anyone there who is an expert in Opencv? and Image Processing using C?
Phaniram vvs
|
|
|
|
|
I know something about OpenCV. Do you have a specific question?
[added 10/27/08]
Guess that was a rhetorical question.
Your silly assed, irrelevant opinion has been duly noted. Now take it elsewhere!
modified on Tuesday, October 28, 2008 1:33 AM
|
|
|
|
|
I need to create a visualization of the progress of machining a part. The part is a relatively simple shape made up of cylinders and conical sections and only a side 2D view, no texture and minimal if any shading, for now. I will have to put the graphic in an ActiveX control or VBA form. This is my first time going beyond the MFC-GDI and am wondering what direction to start in and why.
Thanks in Advance
|
|
|
|
|
Hi all!
Please help me with my question. I'd like to draw .bmp file on openGL surface. My openGL surface is GL_TRIANGLE_STRIP set. Now I can load bitmap on the surface but it is not I want. Now I'm receiving the surface with tilled images. But I'd like to fit my picture on whole surface.
Thanks.
|
|
|
|
|
Hi all,
I'm trying to find a set of calculations that describe different muscles. My goal is to find some formula that can be tweaked a little bit, so that the dimensions end up looking different. For example, the shoulder muscle--modify one variable and it looks beefier, modify another and it gets wider. Anybody know where I can find some formulas for this kind of thing?
Thanks for your time,
Michael Fritzius
|
|
|
|
|
any one here can teach me how to use directx to drawing using VB.Net
Coz I wana create a Game!!!
|
|
|
|
|
|
Thanks for U're sugestion!
I write 2D game, I try write the game using GDI, but some times the program run slowly! , so I try write the game using direct X, but until now i dont understand about it!
|
|
|
|
|
rio_p wrote: using direct X, but until now i dont understand about it!
If you Google "directx VB.NET' you'll find a link to an older DirectX
SDK that has VB.NET samples in it, along with all the DirectX documentation.
You're going to need the DirectX SDK anyway
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
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
|
|
|
|