![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hello agraham,
It's interesting to know that Line(x,y,X+1,y+1,color,BF) equals SetPixel(x,y,color) could this behaviour be added to the help file ? From a logical point of view, I would have expected the same result with Line(x,y,x+1,y+1,color,B) equal to Line(x,y,x+1,y+1,color,BF) because in the first case it's the border with nothing in there and in the second case the internal square is ZERO, so nothing to fill in but the border remains the same. But knowing that Line(x,y,x+1,y+1,color,BF) equals SetPixel(x,y,color) it's OK for me. Additional question: can the border and fill colors be different ? Hello forisco The two links in my previous post are for vector graphics with known vertex coordinates, here is one for raster graphics. http://www.codeproject.com/KB/GDI-pl...select=1760928 Best regards Klaus Switzerland Last edited by klaus : 01-01-2008 at 10:03 PM. |
|
|||
|
Thank you, Klaus, for the links : the last is a little complex!
I found this link, with a good solution but it require the SetPixel method : http://www.cs.unc.edu/~mcmillan/comp...areaFills.html and it uses a recoursive method. I will search for a raster method more simple. And thank you to agraham for his explanations : very helpful!
__________________
HP HW6915 240x240 - Windows Mobile 5.0 |
|
||||
|
Hello forisco
Grazie for your link, I had also seen this link but, I don't know why, I was somewhat afraid to use a recursive routine. I implemented the routine in my program and it works fine, with SetPixel. I have only 32*32 pixels so no problem with execution time. Hello agraham, Thank's for the complementary information, I had in mind, was it from another language, I don't remember, that B=border and F=fill with two different colors. But now know that it is not the case. Best regards and thank's again. Klaus Switzerland |
|
|||
|
In fact, Klaus, my problem is just this : i use, as design space, almost all the screen and b4ppc crash in effort to solve all the recoursions.
I'm studing a different solution. I will inform you about my progresses! Thank you and ciao!
__________________
HP HW6915 240x240 - Windows Mobile 5.0 |
|
||||
|
I was yesterday a little bit euphoric because the routine worked on the desktop, but on the device I have the same problem as you 'out of stack memory' even with only 32*32 pixels.
I must also look for another routine, as soon as I have found a solution I will of course also inform you. Grazie e ciao Klaus Switzerland |
|
||||
|
Here you are. A data stack based non-recursive flood fill routine. It uses two Array List controls StackX and StackY. It is rather slow on the device but it works. I will try to speed it up a bit now I've got it working - in the mean time you can progress with your projects.
|
|
||||
|
And here's a fast version. I've put the data stack algorithm in a library where I can do manipulation of the bitmap directly. It's very fast now, even on the device.
EDIT :- I should have mentioned that this library needs Compact Framework 2.0 as Compact Framework 1.0 lacks the facility to manipulate bitmaps at a low level. Last edited by agraham : 01-02-2008 at 02:52 PM. |
|
||||
|
Hello agraham
Thank you very much for your precious help. I have implemented the routine, works well. Unfortunately a have to use the slow version becaus I don't only use bitmap but also a magnified area. On the device it takes about 9s to fill the whole 32*32 square, it's not too bad. Klaus Switzerland |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| request for squeeling counter demo! | colin9876 | Questions & Help Needed | 25 | 05-21-2008 11:25 PM |
| Object Reference not set to an instance of an object | monster9999 | Questions & Help Needed | 9 | 01-15-2008 10:56 PM |
| HTTP maximum request size and method problems | willisgt | Questions & Help Needed | 1 | 08-27-2007 08:10 PM |
| Tutorial Request - How to creat B4P library? | conf | Questions & Help Needed | 5 | 06-25-2007 12:26 PM |
| SetPixel do no work | Put Claude | Questions & Help Needed | 1 | 05-14-2007 06:21 AM |