Improve company productivity with a Business Account.Sign Up

x
?
Solved

DrawDIB

Posted on 1998-11-02
10
Medium Priority
?
495 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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 600 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…
Watch the working video to know how to import Outlook PST/OST files to Amazon WorkMail. Kernel released this tool which is very easy to use and migrate single or multiple PST and OST files to Amazon WorkMail. To know more about Kernel Import PST to …

606 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