Search found 10 matches

by abarkley
Sat Sep 05, 2009 11:16 pm
Forum: Coding Questions
Topic: Grayscale conversion - what's wrong?
Replies: 5
Views: 1190

Yes, Rule 1 of forums..search around first. Apologies.

That looks very helpful but I'm trying to avoid using API calls. I don't really understand them anyway.
by abarkley
Sat Sep 05, 2009 10:57 pm
Forum: Coding Questions
Topic: Grayscale conversion - what's wrong?
Replies: 5
Views: 1190

Grayscale conversion - what's wrong?

I want to convert a colour bitmap to a grayscale image. There's a Luminance formula for converting 24 bit to 8 bit (R * 0.3 + G * 0.5 + B * 0.2).

Easy enough to extract with POINT. Do the maths and I've then got a grid array of 8 bit entries. So, CreateImage an 8 bit depth image and plot the ...
by abarkley
Sun Jul 19, 2009 4:27 pm
Forum: Coding Questions
Topic: Work on image in memory
Replies: 7
Views: 4368

Thanks for that. A bit complex for this noob - useful for me to try to work through it though.

Can I rephrase the question?

Is it realistic for me to work on a bitmap in memory without making any operating system calls? You say that the native PB commands are pretty quick.

The app is fairly ...
by abarkley
Sun Jul 19, 2009 12:47 am
Forum: Coding Questions
Topic: Work on image in memory
Replies: 7
Views: 4368

Work on image in memory

Still pretty new to PB.

I want to do some RGB or grayscale image Pixel data (image manipulation) work. I'd like these ops to work fast. This is probably best done by working directly on memory - and if necessary, using some simple assembly language routines (I did this for 8-bit MPU's many years ...
by abarkley
Thu Jul 02, 2009 8:15 pm
Forum: Coding Questions
Topic: Where's my bitmap filename?
Replies: 4
Views: 732

That doesn't really get me any further.

Are you saying that that the characters of a filename are NOT contained within a file? It's not an unreasonable suggestion - other operating systems do it. I seem to remember name data in MS-DOS files.

If it's not, where is it? Going back to my USB stick ...
by abarkley
Thu Jul 02, 2009 7:43 pm
Forum: Coding Questions
Topic: Where's my bitmap filename?
Replies: 4
Views: 732

Where's my bitmap filename?

Sorry to keep going on about .bmp files.

I want to read/analyse the header of a .bmp file on disk and do some stuff based on the analysis result.

I found this link helpful:

http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html


But where's the filename? It must be embedded in the file ...
by abarkley
Mon Jun 29, 2009 1:20 am
Forum: Coding Questions
Topic: Where's my image data in memory?
Replies: 4
Views: 978

Where's my image data in memory?

I'm still very much a PB beginner but getting a bit better with practice.

I want to simplify the 24 bit RGB data in a colour bitmap into a 'custom' 8-bit format (imagine it's a grayscale, although that's not exactly what I'll be doing). Assume the original image is a .jpg. I then want to do a bit ...
by abarkley
Sun Jun 07, 2009 10:07 pm
Forum: Coding Questions
Topic: [newbie] Explorer Tree Gadget problem
Replies: 5
Views: 1037

Thanks.

Exactly what I was trying unsuccessfully to do.
by abarkley
Sun Jun 07, 2009 8:41 pm
Forum: Coding Questions
Topic: [newbie] Explorer Tree Gadget problem
Replies: 5
Views: 1037

Thanks. I knocked together the code from a couple of examples - I guess I'll see the error next time.

Please can you advise on the second problem: once I've been through the file tree and double clicked on the file that I want, how do I get the filename$?
by abarkley
Sun Jun 07, 2009 7:58 pm
Forum: Coding Questions
Topic: [newbie] Explorer Tree Gadget problem
Replies: 5
Views: 1037

[newbie] Explorer Tree Gadget problem

A real PB beginner here - been going about 2 weeks.

I want to show a directory (and contents) and get the user to select a (image) file which then gets loaded and worked on. Hard, huh?

What's wrong with this code:

If OpenWindow(0, 0, 0, 230, 220, "File example...", #PB_Window_SystemMenu | #PB ...