OK, I have added 8 bytes all round in my above snippet.
Should now cover the full image area plus the header.
Thank you for pointing out the error.
How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)
Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)
The wiki shows the image buffer returned by ImageCreate as ANY PTR, however, it has a known public structure.
See: inc/fbgfx.bi
Also this tutorial: FBgfx Image and Font Buffers.
Maybe the wiki has historically, shown fb image buffers as ANY PTR only because fbgfx.bi and FB.Image type declaration is optional to the programmer.
See: inc/fbgfx.bi
Also this tutorial: FBgfx Image and Font Buffers.
Maybe the wiki has historically, shown fb image buffers as ANY PTR only because fbgfx.bi and FB.Image type declaration is optional to the programmer.
Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)
Indeed, ImageCreate() returns an Any Ptr.
I seem to remember that we discussed this topic (return either an Any Ptr or an Image Ptr) at time when adding the ImageCreate () statement, but I do not remember the reason of choice (maybe to avoid a Cast if the user want to use a numeric pointer).
Maybe dkl?
I seem to remember that we discussed this topic (return either an Any Ptr or an Image Ptr) at time when adding the ImageCreate () statement, but I do not remember the reason of choice (maybe to avoid a Cast if the user want to use a numeric pointer).
Maybe dkl?
Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)
That would make sense. That image buffer data location could be declared as a variety of data types. BYTE PTR, array() as BYTE, etc.fxm wrote:maybe to avoid a Cast if the user want to use a numeric pointer
Re: How and Why to make Abstraction by Object Encapsulation, with FB Syntax in UDTs (basics)
I quit freebasic coding for about two years. But when i came back, what i can see is such great posts and comments. I feel sad that it's too late to read this. Thanks for this post.