Solved

DrawDIB

Posted on 1998-11-02
10
434 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now