Search:
Type: Posts; User: Niya
Search:
Search took 0.26 seconds.
-
-
Billy Boyd brings back fond memories. I loved this one from LOTR. I must have listened to this 1000 times back in the day:-
https://www.youtube.com/watch?v=07tyg4JZWkA
-
My instinct is that it's a pointer to a byte array because in C pointers and arrays can be used interchangeably with some caveats.
-
I just want to weigh in on this ByRef vs ByVal thing. Everyone seems to be focused entirely on performance and no one has touched on coding standards, best practices, code clarity etc.
ByVal/ByRef...
-
I think the idea is that we're not supposed to know really sits behind any specific handle. Even with this DPA thing it seems MS went through a bit of trouble to hide the actual struct. Why even use...
-
I was looking at the naming convention. Microsoft likes to tag handles with H as the prefix. HWND, HBITMAP, HBRUSH, HDPA.
I'm not saying you're wrong but I think both can be true. You can call it...
-
It doesn't compile and I think it's because the indexing operator has higher precedence than the cast. It indexes hpda first, which evaluates to the DPA structure which cannot be cast to a pointer...
-
No problem.
I think you got really lucky that someone decided to reverse engineer this specific handle. As I understand it, all handles in Windows are either an index into an array somewhere...
-
I think 2kaud was moreso addressing the discussion between VanGogh and myself.
I might be able to help with that. The very first thing I did when I came to this thread was to copy this into...
-
Ideally, yes. But many times we just have a snippet of code that is referencing things not included in the snippet which makes compilation a chore at best and impossible at worse.
-
Here's the original C code in case that page gets lost to time before VBForums:-
void floodFillScanlineStack(int x, int y, int newColor, int oldColor)
{
if(oldColor == newColor) return;
...
-
That's actually understandable. Back in the day no one really took Visual Basic seriously as a language of performance so all the super optimized algorithms were were written in the "elite" languages...
-
:D
BTW, I found where you got that algorithm from. You found it here most likely:
http://vb-helper.com/howto_net_unsafe_flood.html
I also just release that CodeBank entry I was talking about:-...
-
https://www.vbforums.com/images/ieimages/2024/02/20.png
A recent discussion in this thread led me to the discover that a decent flood fill implementation was somewhat difficult to find online,...
-
I see. Currency is a fixed point type then.
That's very old school. The Doom engine for example uses fixed point math because of how slow or non-existent FPUs were back then. If I remembered...
-
Oh it can get much worse. Try to imagine the pain when typedefs of typedefs of typedefs get involved. You could make a lot of mistakes if you're not paying close attention.
-
I think the Currency type in VB6 is also a scaled integer. I'm not sure where or how it differs from a Decimal but the name of the type suggests it's purpose in financial calculations.
-
He is talking about the Decimal type which is ubiquitous in Microsoft products. You can find them in VB6, SQL Server and .Net.
They are basically scaled integers and not true floating point...
-
Actually assembly code is clearer. As low level as C is, it still has abstractions that can obfuscate the truth. Assembly has near zero abstractions. You don't need to guess what assembly code is...
-
I am still curious why you said it's not what seemed obvious. It makes me wonder what else someone might think when they look at it.
-
Well the original macro is dereferencing a void*** evaluates to void**. You can even test this in the IDE:-
void*** p;
auto x = *(p);
If you hover the mouse pointer over the x...
-
I think it's easy for us to forget that floating point numbers like all numbers on a computer have a finite amount of bits. However unlike Integers, errors are not thrown when we run out of bits to...
-
VB6 is a fine language but you're right, VB.Net does make a lot of things far easier out of the box.
I must warn you though, if at some point you get comfortable with VB.Net, you may find it very...
-
I'm curious about something joaquim. You are pretty prolific in VB6 so why the sudden move to VB.Net?
The reason I ask is because jumping from VB6 to VB.Net is not that straightforward. There are...
-
By the way, As Any and As Object are not even remotely the same thing.
As Object in .Net says to expect any type derived from Object which coincidentally is every type in .Net. If it were...
-
I don't think most VB6 programmers realize just how strange VB6 actually is. As Any breaks the contracts of the type system which is something you will almost never find in any statically typed...
-
Damn it! I actually had this in a follow up post I was going to make but didn't bother posting it since I was doing it all in my head and wasn't sure I had it correct. I like to avoid posting...
-
That entire thing in the C code is really just a dereferencing operation when you get right down to it. It takes a value hpda casts it to a BYTE pointer, advances that pointer by 4 or 8 bytes...
-
The idea is actually quite simple. From the point where the fill begins, you observe the pixel to the top, left, bottom and right of it and if you find "unfilled" pixels, do the same thing with each...
-
While I appreciate the compliment, I don't consider myself an expert. ;)
I do have a lot of experience with image processing but I still don't possess anywhere near the talent of true gods of...
-
Well I hope it works well for you when you do get around to it eventually.
In the meantime, I think I will make this a CodeBank entry. It's very surprising how hard it is to find a decent flood...
-
Ah ok. Well I tested it on some relatively complicated and gargantuan images. For example this one:-
https://www.vbforums.com/images/ieimages/2024/02/19.png
That one is 4840x2408 in size.
In...
-
Are you saying you're seeing similar performance on your end for both methods?
-
Sorry I took so long. I had to hammer away at this on and off for a couple days as I was a bit busy. It was pretty obvious when I saw the code why it was slow, but it wasn't so obvious what the best...
-
DOS had drivers but it was also a real mode operating system. Drivers in DOS were in the form of something called a TSR which is most closely equivalent to a modern Windows service or a Linux/Unix...
-
Yea, I think I'd need to see the code.
-
One more thing. I noticed your use of SAFEARRAYs, VarPtr and such in your VB6 version. If you feel more comfortable with that, you can even do similar things in VB.Net.
Now VB.Net doesn't use...
-
Unlike VB6, we don't need all this song and dance to handle bitmap images in .Net. It's far simpler. We don't even need to import even a single Win32 API, constant or structure. Everything we need...
-
Like I said, .Net Framework is different from .Net Core so it makes sense they will have different version numbers. 4.8.1 is the latest version of the Windows only .Net Framework and .Net 8 is the...
-
Don't take this as gospel but when I see LPRINT it evokes memories of writing directly to a parallel port like LPT1. It's been far too long since I touched a classic BASIC variant like QuickBasic. I...
|
Click Here to Expand Forum to Full Width
|