 |
|
 |
It would be usefull if demo project was provided
|
|
|
|
 |
|
 |
Hi Serup,
I came to know your article while searching for concepts related to contour. Am working as a software engineer in Visual C++ for the past two years. No one is here for me to train. Am reading for myself and doing things as much as my effort makes it possible. Now am in a need to accomplish the following one:
1. I need to show a bitmap in a full screen mode
2. Then i need to scatter that bitmap here and there all over the screen and then have to reassemble it to make it return back to its original form.
I had posted one message asking about this. Then i got the reply to look for finding contours of that bitmap and then to carry on from there. One more reply suggested me to study about 3DMax.
Now i posted this to have your ideas and suggestions. If there any book for me to read and proceed, please refer to me. I am ready to read and implement the procedure.
My email id is Anj.Sangeetha@gmail.com
Thanking you,
With Regards,
Sangeetha.
With Regards,
Sangeetha.
|
|
|
|
 |
|
 |
i want any available projects in embedded systems written in c programming source code;
|
|
|
|
 |
|
|
 |
|
 |
After adding solution from iTreeSoft, then following can be done:
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CBitmapHandling bh;
HRGN hRgn;
bh.BitMapContourToWinRgn((int)IDB_BITMAP_MASK,hRgn);
VERIFY( SetWindowRgn(hRgn , TRUE ) );
return TRUE; // return TRUE unless you set the focus to a control
}
NB! Remember to paint your bitmap in OnPaint. The bitmap mask is a copy of the original bitmap with white color as transparent (cutting away unwanted bits)
|
|
|
|
 |
|
 |
There are some bugs in this example.
Without trying to run this code i saw some mistakes in the code.
- When you search a startpoint you are testing for white pixels. This looks ok. But when you look for an endpoint you test that R and G and B are not full. This is wrong. Any Colour which has one component at 255 will be taken which is wrong.
- The other thing is that, as you said before, you will not get figures with holes. e.g.(pixels):
xxxx
xxx xxx
xxxx
Also you will not get figures correctly which have more than one up and downs.
xx xx xx
xxxxxxxx
And you will not get figures which have two separatet parts.
xxxx xx
xx x
But to get this all is a really hard work.
|
|
|
|
 |
|
 |
Thank you very much for your time.
It seems that what I from the beginning thought was just a matter of making, is actually not so easy, well ! I still think that the concept of this solution is holding. I think that perhaps it could be possible to cover all the figure configurations, if this example was build for recursive calling, meaning it could solve easy parts first, then save some intermediate info and then call itself to carry on, however this was a pet project and unfortunately I do not have time at present to pursue this, interesting, solution, perhaps you have ? Anyway, I enjoyed thinking about the problem once again.
- Johnny
|
|
|
|
 |
|
 |
While (1) is rather harsh, your article could do with a few improvements...
The article text is only a small paragraph long. You could easily expand this.
Why did you write this code? To solve a nasty problem, or to make a "cool" UI?
Do you have any example screen shots?
Downloadable demo project, starting with a "load bitmap" dialog to set the demo dlg's shape?
Your idea has the potential to be quite useful, but the article is too light at the moment.
I would point you at Marc Clifton's article guide...
http://www.codeproject.com/scrapbook/whatisagoodarticle.asp[^]
Iain.
|
|
|
|
 |
|
|
 |
|
 |
I confess I haven't read it in a while (most of my development is paid for, so
not really "put-up-here"able). I remember thinking he went over the top in some
places, but at least people should _actively_ choose to disregard bits, rather
than just ignoring them...
Iain.
|
|
|
|
 |
|
 |
I agree it is a thin aproach to solving userdefined dialog shape handling, but I wanted to create a simple class that could give me the outline of a bitmap, since I needed it to beable to set clipping region of main window.
This does it in a very simple way, however it can unfortunately not handle bitmaps with white holes inside, the polygon creation, goes balistic and I end up with some really interesting results.
I am currently working on trying to fix that. I have found some examples on "skin" for buttons, however I need to look into that code, since it is not so simple.
Thank's for your respons.
Johnny
|
|
|
|
 |
|
 |
You did great, giving direction to search for this problem.
Thanks
Gordon
|
|
|
|
 |