Author Topic: CreateDIBitmap  (Read 25011 times)

masitecno

  • Regular Member
  • *
  • Posts: 25
    • castellanosbarragan
Re: CreateDIBitmap
« Reply #15 on: May 31, 2012, 02:34:49 PM »

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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: CreateDIBitmap
« Reply #16 on: May 31, 2012, 02:39:38 PM »
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

  • Regular Member
  • *
  • Posts: 25
    • castellanosbarragan
Re: CreateDIBitmap
« Reply #17 on: May 31, 2012, 02:40:37 PM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: CreateDIBitmap
« Reply #18 on: May 31, 2012, 02:42:18 PM »
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

  • Regular Member
  • *
  • Posts: 25
    • castellanosbarragan
Re: CreateDIBitmap
« Reply #19 on: May 31, 2012, 02:42:28 PM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: CreateDIBitmap
« Reply #20 on: May 31, 2012, 02:44:46 PM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: CreateDIBitmap
« Reply #21 on: May 31, 2012, 02:47:44 PM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: CreateDIBitmap
« Reply #22 on: May 31, 2012, 02:49:35 PM »
http://www.oscilloscope-lib.com/



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

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: CreateDIBitmap
« Reply #23 on: June 01, 2012, 12:01:59 AM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: CreateDIBitmap
« Reply #24 on: June 07, 2012, 12:10:26 AM »
masitecno - are you still out there ?   :P

Zen

  • Member
  • ****
  • Posts: 962
  • slightly red-shifted
Re: CreateDIBitmap
« Reply #25 on: June 07, 2012, 03:15:56 AM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: CreateDIBitmap
« Reply #26 on: June 07, 2012, 09:53:15 AM »
The 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

  • Member
  • **
  • Posts: 204
    • WJR's website
Re: CreateDIBitmap
« Reply #27 on: June 08, 2012, 05:35:50 AM »
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

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: CreateDIBitmap
« Reply #28 on: June 08, 2012, 06:06:04 AM »
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

  • Guest
Re: CreateDIBitmap
« Reply #29 on: June 08, 2012, 09:22:02 AM »
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