News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

CreateDIBitmap

Started by masitecno, May 31, 2012, 12:47:34 PM

Previous topic - Next topic

masitecno


Well is like a process:

1. A data comes in
2. I save it to file
3. <<operations>>
4. I translate data to colors
5. I send it to screen

Operations can be zoom, change color pallete, draw a line or something like that.


dedndave

you have been busy   :biggrin:

yah - that one is old - as far as implementation goes
however - much of the bitmap format stuff still applies

so you are going for something like this:



based on pressure changes...


masitecno

But what I need now is to simulate the scrolling (rotation) to the left like the miller example you gave me but using a DIBitmap.

That's what i need to do now.

Hope you can help me a little or guide me.

dedndave

i will see what i can come up with

i will just generate some random pixels as data - for now - lol
but - before i do - i want to finish up another project

masitecno

It's something like that!

yeah that's right...


I've tested other technologies but, i think there's nothing like assembler.
Am I on the right way? or should I take another way?

dedndave

i don't see why not
but then, i am biased - i like assembler   :P

as for data processing - you may eventually want to delve into SSE
so - assembler lends itself well for that type of data crunching

dedndave

i recall seeing an oscilloscope library someplace
it may have what you need already written   :t

let me see if i can find it...

dedndave

http://www.oscilloscope-lib.com/



probably not quite what you need
although - it may be helpful as a guideline

dedndave

i have been doing some reading this morning - out of curiosity   :biggrin:

i think the function we want to use is CreateDIBSection
it even allows for file-mapped memory - although, we don't have to use that to get started

dedndave

masitecno - are you still out there ?   :P

Zen

MASITECNO,
EDGAR has a terrific graphics library available for free his website. He uses the DIB functions almost exclusively. This is production-quality code. Website: Donkey's Stable
Look at this page: Libraries. Scroll down the page to: Graphics.Lib
Note: This library only functions with 32bit DIB sections. All the source code is supplied in the zip file.

The important issue here is to realize what the difference between a Bitmap and a DIB (Device Independent Bitmap) is. Bitmaps, MSDN,...and,...CreateDIBSection Function, MSDN. Essentially, a DIB is a Bitmap loaded into memory (without the Bitmap File format headers), so that you can access the pixel bit data with: GetDIBits Function, MSDN,...and,...SetDIBits Function, MSDN
Zen

dedndave

Quote from: Weird Zen on June 07, 2012, 03:15:56 AMThe important issue here is to realize what the difference between a Bitmap and a DIB (Device Independent Bitmap) is.

... and a DDB (Device Dependant Bitmap)
that's why i think CreateDIBSection is the right function, rather than CreateDIBitmap

wjr

I did something like this with my Mandelbrot Set program M with vertical and/or horizontal auto-scrolling. The following outlines how I set things up for the bitmap:

RegisterClassEx with style CS_OWNDC

for WM_CREATE:
GetDC giving your [hcdMain] for the main window
CreateCompatibleDC giving your [hdcMem]
CreateDIBSection giving your [hBitmap] and [pBits] for use later with your translate data to colors
SelectObject [hBitmap] into [hdcMem]

for WM_PAINT:
BitBlt to SRCCOPY from [hdcMem] into [hdcMain].

for WM_CLOSE:
DeleteDC [hdcMem]
DeleteObject [hBitmap]

dedndave

hi Wayne
yes - i think that's the way to go
i have just never had a need to do it

at this point, i am wondering if we have lost the original poster, though   :redface:

it would be cool to make a rotatable 3-D display of the result
the doctors that use the software would probably find it easier to use in diagnosis
i can figure out the rotation, but i don't know how to figure out which surfaces to display/hide

xiahan

my little bitmap process program,
hope to give you  a little of manuplating bitmap  :biggrin:

ps:push Alt+left arrow/right arrow to change tansparency