BBC BASIC for Windows
« Reading and Writing Screen Pixels »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:25am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Reading and Writing Screen Pixels  (Read 938 times)
Kipper
New Member
Image


member is offline

Avatar




PM


Posts: 8
xx Re: Reading and Writing Screen Pixels
« Reply #8 on: Feb 11th, 2015, 11:11pm »



Hi

Trying to make it work but what is the "handy pointer"? Could you give me one line of code showing addressing of data indexed by pointer?

420 SYS "CreateDIBSection", @memhdc%, bmih{}, 0, ^bits%, 0, 0 TO hbm%

Assuming it is in the above line?

Any help appreciated !

Kipper
User IP Logged

rtr2
Guest
xx Re: Reading and Writing Screen Pixels
« Reply #9 on: Feb 12th, 2015, 08:29am »

on Feb 11th, 2015, 11:11pm, Kipper wrote:
Trying to make it work but what is the "handy pointer"?

MSDN has all the details:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd183494.aspx

Quote:
Could you give me one line of code showing addressing of data indexed by pointer?

Sorry, I can't, because I don't know the format of your bitmap.

In general terms you will need to calculate the offset into the bitmap from your x and y coordinates, add that offset to the base address (bits% in the case of the code you listed), then read the pixel data from memory and separate it into its RGB components (assuming you have selected a colour format rather than monochrome).

But the detailed code will depend on your bitmap's format and dimensions (for example that will determine whether you need to pad each line to an exact multiple of DWORDs).

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls