Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 483
  • Last Modified:

DrawDIB

Has anybody got the pascal implementation of the DrawDIB functions? And/or an example how to use it (even in C)?

Hi Igor: I want to try this for drawing the spectrum, do you think it's a good idea?

sincerely, Matvey
0
Matvey
Asked:
Matvey
  • 5
  • 5
1 Solution
 
intheCommented:
Hello
Not sure this is what you want but hope this is of help .it is DrawDIB.Pas

InThe


unit DrawDIB;
interface
uses WinTypes;
const  {DrawDIB Flag Constants}
  DDF_0001              = $0001;
  DDF_UPDATE            = $0002;
  DDF_SAME_HDC          = $0004;
  DDF_SAME_DRAW         = $0008;
  DDF_DONTDRAW          = $0010;
  DDF_ANIMATE           = $0020;
  DDF_BUFFER            = $0040;
  DDF_JUSTDRAWIT        = $0080;
  DDF_FULLSCREEN        = $0100;
  DDF_BACKGROUNDPAL     = $0200;
  DDF_NOTKEYFRAME       = $0400;
  DDF_HURRYUP           = $0800;
  DDF_HALFTONE          = $1000;
  DDF_2000              = $2000;
  DDF_PREROLL           = DDF_DONTDRAW;  DDF_SAME_DIB          = DDF_SAME_DRAW;
  DDF_SAME_SIZE         = DDF_SAME_DRAW;  {DrawDIBProfileDisplay Constants}
  PD_CAN_DRAW_DIB       = $0001;  PD_CAN_STRETCHDIB     = $0002;
  PD_STRETCHDIB_1_1_OK  = $0004;  PD_STRETCHDIB_1_2_OK  = $0008;
  PD_STRETCHDIB_1_N_OK  = $0010;type  HDrawDIB              = HDC;
  DWord                 = LongInt;
  PBitmapInfoHeader     = ^TBitmapInfoHeader;
  LPVoid                = Pointer;
  TDrawDIBTime = record
    timeCount:        LongInt;
    timeDraw:         LongInt;
    timeDecompress:   LongInt;
    timeDither:       LongInt;
    timeStretch:      LongInt;
    timeBlt:          LongInt;
    timeSetDIBits:    LongInt;
  end;
  PDrawDIBTime          = ^TDrawDIBTime;
function  DrawDIBInit: WordBool; far;
function  DrawDIBOpen: HDrawDIB; far;
function  DrawDIBClose(hDD: HDrawDIB): WordBool; far;
function  DrawDIBGetBuffer(hDD: HDrawDIB; pbmpInfo: PBitmapInfoHeader;dwSize, dwFlags: DWord): LPVoid; far;
function  DrawDIBError(hDD: HDrawDIB): Word; far;
function  DrawDIBGetPalette(hDD: HDrawDIB): HPalette; far;
function  DrawDIBSetPalette(hDD: HDrawDIB; hPal: HPalette):         WordBool; far;
function  DrawDIBChangePalette(hDD: HDrawDIB; nStart, nLen: Integer;  pPalEntry: PPaletteEntry): WordBool; far;
function  DrawDIBRealize(hDD: HDrawDIB; hbmpDC: HDC;
          fBackground: WordBool): Word; far;
function  DrawDIBStart(hDD: HDrawDIB; dwRate: DWord): WordBool; far;
function  DrawDIBStop(hDD: HDrawDIB): WordBool; far;
function  DrawDIBBegin(hDD: HDrawDIB; hbmpDC: HDC; dxDst, dyDst: Integer;pbmpInfo: PBitmapInfoHeader; dxSrc, dySrc: Integer;
                       wFlags: Word): WordBool; far;
function  DrawDIBDraw(hDD: HDrawDIB; hBmp: HDC;xDst, yDst, dxDst, dyDst: Integer;pbmpInfo: PBitmapInfoHeader; lpBits: LPVoid;
xSrc, ySrc, dxSrc, dySrc: Integer;wFlags: Word): WordBool; far;
function  DrawDIBUpdate(hDD: HDrawDIB; hbmpDC: HDC;
                        xDst, yDst: Integer): WordBool; far;
function  DrawDIBEnd(hDD: HDrawDIB): WordBool; far;
function  DrawDIBTime(hDD: HDrawDIB; pDDTime: PDrawDIBTime): WordBool; far;
function  DrawDIBProfileDisplay(pbmpInfo: PBitmapInfoHeader): DWord; far;
implementationfunction  DrawDIBInit: WordBool; external 'MSVideo';
function  DrawDIBOpen: HDrawDIB; external 'MSVideo';
function  DrawDIBClose(hDD: HDrawDIB): WordBool; external 'MSVideo';
function  DrawDIBGetBuffer(hDD: HDrawDIB; pbmpInfo: PBitmapInfoHeader;
                           dwSize, dwFlags: DWord): LPVoid; external 'MSVideo';
function  DrawDIBError(hDD: HDrawDIB): Word; external 'MSVideo';
function  DrawDIBGetPalette(hDD: HDrawDIB): HPalette; external 'MSVideo';
function  DrawDIBSetPalette(hDD: HDrawDIB; hPal: HPalette): WordBool;
                            external 'MSVideo';
function  DrawDIBChangePalette(hDD: HDrawDIB; nStart, nLen: Integer;pPalEntry: PPaletteEntry): WordBool;external 'MSVideo';
function  DrawDIBRealize(hDD: HDrawDIB; hbmpDC: HDC;      fBackground: WordBool): Word; external 'MSVideo';
function  DrawDIBStart(hDD: HDrawDIB; dwRate: DWord): WordBool;
                       external 'MSVideo';
function  DrawDIBStop(hDD: HDrawDIB): WordBool; external 'MSVideo';
function  DrawDIBBegin(hDD: HDrawDIB; hbmpDC: HDC; dxDst, dyDst: Integer; pbmpInfo: PBitmapInfoHeader; dxSrc, dySrc: Integer;wFlags: Word): WordBool; external 'MSVideo';
function  DrawDIBDraw(hDD: HDrawDIB; hBmp: HDC;
xDst, yDst, dxDst, dyDst: Integer;pbmpInfo: PBitmapInfoHeader; lpBits: LPVoid;xSrc, ySrc, dxSrc, dySrc: Integer;wFlags: Word): WordBool; external 'MSVideo';
function  DrawDIBUpdate(hDD: HDrawDIB; hbmpDC: HDC;xDst, yDst: Integer): WordBool; external 'MSVideo';
function  DrawDIBEnd(hDD: HDrawDIB): WordBool; external 'MSVideo';
function  DrawDIBTime(hDD: HDrawDIB; pDDTime: PDrawDIBTime): WordBool;external 'MSVideo';
function  DrawDIBProfileDisplay(pbmpInfo: PBitmapInfoHeader): DWord;external 'MSVideo';
end.
0
 
intheCommented:
B.T.W the functions are documented in mm.hlp

InThe
0
 
MatveyAuthor Commented:
Hey, thanks, this looks promising! Do you have a sample how to use it? BTW where have you got this from?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
intheCommented:
Hello Matvey
sorry for not getting back sooner i could'nt access ex-ex for 3 day's ???? and
sorry  i have never used this before but i will try to have a look soon and get back to you if i find anything :-)
InThe
0
 
MatveyAuthor Commented:
Sure, thanks. Please tell me when you got something...
0
 
MatveyAuthor Commented:
Oh I beg your pardon. I alwais forget about my questions! Please go ahead and receive the points! Very thankful, and alwais glad to see you ;-)

Can I ask you again where you got this source from? I'm kinda searching for these places, you know...
0
 
intheCommented:
hello matvey
cheers for points.
i dont know where i got drawdib.pas from i save everything like pas files on the web when i find them and was just lucky to have it .i find one of the best places to find stuff in on dejanews or even newsgroups i also goto a newish site called www.delphi32.com and awnser some questions there .
i have still been trying to find stuff on drawdib but i cant find anything good anywhere but dejanews has made my pas file collection grow :-)
good luck with it
Barry
0
 
MatveyAuthor Commented:
Hey I'm rich now, no problems with the points ;-)

Thanks again. I see that you deal with sound at your job, did I understand right? This isn't concerning my job, but I try to explore all kinds of audio. I'm very curious what exactly are you working on?
0
 
intheCommented:
hi again,  wow 600 did you win lottery :-)
im a electronic and mechanical engineer for a company that makes cd's (music and games )in the u.k. i get to play all the new games before they are released it's great.sometimes we have to develop machines that is where the programming interest came from. programming the machines is a good laugh but not as much fun as delphi eh.
cheers Barry
0
 
MatveyAuthor Commented:
That sounds good! I still haven't played NFS 3. Have you? This is my kind of a job ;-)

Do you actually write any sound software? I try a bit myself, but I'm not specialized in it. I wonder if you could give me some advice sometimes, if you don't mind of course? I'd be very very thankful. Right now one friend and I try to write some real-time processing, and I wonder if you had something to do with it anyhow? This would be just great, because very few people wanted to help me with this.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now