Nice work, BPlus. Next method is with virtual screens and transparency + _PUTIMAGE.
I just tried it and got an Invalid Handle on Line 79. But you got some awesome code there. Reminds me of how I used POINT to make text larger. I wonder if it's because I put all the files in their own directory?
A few points here (as I happily steal and repurpose this code for my own demo)...
_RGB32(119, 24, 49) —> Just make these _RGB commands (no 32), and you can use this in other screen modes (like SCREEN 12 or 256-color mode). Only thing to watch for is if the fill color is used elsewhere in the program. In 32-bit mode, that _RGB color isn’t very likely to be used previously (a simple generation of a random color, and a check to make certain it’s not in use could eliminate all “paint bleeds”), but as we reduce our color palette smaller, it’s more likely to fill wrong areas...
I haven’t looked at Petr’s fill routine yet, but it might work better in lower colors modes, without the worry of bad fills. I’ll need to check it out later. ;)
Point 2: Get _DEST and _SOURCE at the start of the sub, and then restore them at exit time, if you want the routine to be more portable. ;)
Hi Steve,
Frankly my dear, I don't give a damn about SCREEN 12 mode. ;-))
Why in the wide world would you willingly and wistfully waste wonderful color options in graphics 32 for 16 colors? 0 alpha!?!? And further, be restricted in screen size to one.
Ah-a here is the idea that Steve uses to build Paint Tiling QB45 emulator for SCREEN 12!
People please tell me, better a neutral color or a copy of the area of image to be overwritten if you work in 32bit mode?
Cool paintImage!
I noticed you are testing for Alpha but neither POINT nor PAINT work with Alphas. As I mentioned previously, I was disappointed that even &H color constant values would not be recognized by POINT or PAINT even with full aplha 255 or FF.I can disagree because it seems that POINT works
Principle of function, as I imagined it: Read the color number X, Y at the place where you want to color. Then from this point go to all sides (something as your maze search algorithm) and look for the positions of the points that have a different color than the color of the place you want to color. After you get the whole circuit completely, you paint it and color it. That's how PAINT works right now, just looking for a specific color. I suppose ALPHA would not mind such a function. The only thing she cares about is a different (any) color point than the default color (color in place where is coloring applyed. before color apply). How confirm, that circuit is complete? Hmm.... good ask :)
Hi Bplus
about thisI can disagree because it seems that POINT worksCode: QB64: [Select]
SLEEP 1
About why PAINT doesn't recognize BorderColor% because in Wiki BorderColor% can be also a Long32 and not only an integer
http://qb64.org/wiki/PAINT (http://qb64.org/wiki/PAINT)
moreover there is something broken in the PAINT command implementation for its alternating working well/bad
see hereCode: QB64: [Select]
but POINT seems to work in these examples.
And it looks to me like where PAINT does work, your Border Color is full Alpha 255 and where it doesn't work your Border Color is not full Alpha
Non-Recursive PaintFill. At this point, it's slower than heck, but it works!Code: QB64: [Select]
fill 200, 200, &HFFFF0000, 0 pass = 1 Array(x, y) = pass finished = -1 pass = pass + 1
This may not be so impossible to make use of, once it's optimized for _MEM. As it is now, it's good for a one time "change it and save it" type routine, but I definitely wouldn't rely on it for anything performance heavy.
Point isn’t failing; your bordercolor fails.
PSET (x,y), _RGBA32(255,255,255,128)
Now, PSET that over a white background, a red background, and a black background. Is the color on your screen going to still be _RGBA32(255,255,255,128), or is it going to be a blended version of that color? Bright white (barely toned down), Pink, and then dull white/gray are going to be your screen colors. Using that value as a paint border isn’t going to work as that color doesn’t actually exist on your screen.
One important thing will *always* keep it from existing: the visible display doesn’t allow any alpha less than 255. At least, it hasn’t in any of my past testing.
Then why are we making something to replace PAINT? I thought it was so we could use transparent border colors.
I was trying to be careful that the border was always over black.
One important thing will *always* keep it from existing: the visible display doesn’t allow any alpha less than 255. At least, it hasn’t in any of my past testing.
Just a note. Each _NEWIMAGE screen has a RGBA32 background 0,0,0,0, this changes to 0,0,0,255 when CLS is used.i'll go on and I try this study of POINT in SCREEN 32bit