Solved

DrawDIB

Posted on 1998-11-02
10
448 Views
Last Modified: 2010-04-06
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
Comment
Question by:Matvey
  • 5
  • 5
10 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 1345485
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
 
LVL 17

Expert Comment

by:inthe
ID: 1345486
B.T.W the functions are documented in mm.hlp

InThe
0
 
LVL 3

Author Comment

by:Matvey
ID: 1345487
Hey, thanks, this looks promising! Do you have a sample how to use it? BTW where have you got this from?
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 17

Expert Comment

by:inthe
ID: 1345488
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
 
LVL 3

Author Comment

by:Matvey
ID: 1345489
Sure, thanks. Please tell me when you got something...
0
 
LVL 3

Author Comment

by:Matvey
ID: 1345490
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
 
LVL 17

Accepted Solution

by:
inthe earned 150 total points
ID: 1345491
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
 
LVL 3

Author Comment

by:Matvey
ID: 1345492
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
 
LVL 17

Expert Comment

by:inthe
ID: 1345493
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
 
LVL 3

Author Comment

by:Matvey
ID: 1345494
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question