archive-com.com » COM » E » EFG2.COM

Total: 878

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".

  • 2001 06 41 52 0700 Lines 42 Path dnews Xref dnews borland public delphi winapi 134070 In article anatol tradeline com ua says Hi All Can anyone give me an example on how to use this function in Delphi In C Builder it works fine but in Delphi The big problem is that the TRIVERTEX structure is declared WRONG in Windows pas The Red Green Blue and Alpha fields are defined as COLOR16 and COLOR16 is erroneously defined as ShortInt signed 1 byte Integer COLOR16 should be a Word unsigned 2 byte Integer To make GradientFill work first create your own TRIVERTEX definition thus type TRIVERTEX packed record X Y DWORD Red Green Blue Alpha Word end Then declare GradientFill in your own code thus function GradientFill DC hDC pVertex Pointer dwNumVertex DWORD pMesh Pointer dwNumMesh dwMode DWORD DWord stdcall external msimg32 dll To gradient fill a rectangle create an array of two corrected TRIVERTEX structures Put the top left corner in the X and Y of one the bottom right in the X and Y of the other Fill the Red Green and Blue fields with the desired R G B colors BUT you must shift them left eight

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/2001/0501a.txt (2016-02-14)
    Open archived version from archive



  • abuse swip net X Trace nntpserver swip net 926810080 130 244 122 185 Sun 16 May 1999 01 14 40 MET DST Organization A Customer of Tele2 X MSMail Priority Normal NNTP Posting Date Sun 16 May 1999 01 14 40 MET DST Newsgroups alt comp lang borland delphi James K Bigelow skrev i diskussionsgruppsmeddelandet Yc8 2 25 Po5 8884 news callamer com I use an OCX that returns a

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/0516a.txt (2016-02-14)
    Open archived version from archive


  • us ascii Organization Another Netscape Collabra Server User Mime Version 1 0 Newsgroups borland public cppbuilder graphics Hi Yavuz I need an example of PlgBlt function in code Here s an example of using PlgBlt to render angled text POINT P 3 P 0 x 50 P 0 y 10 P 1 x 50 P 1 y 10 Label1 Width P 2 x 50 Label1 Height P 2 y 10

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/1220b.txt (2016-02-14)
    Open archived version from archive


  • don t remember Does anybody know where I might get this information I would just do this from scratch but I need parametric splines and that make it a bit harder Not sure what a parametric spline is as opposed to just a spline but there s no problem using PolyBezier to draw splines Um spline means lots of different things If you have a collection of points and tangent vectors there s no problem using PolyBezier to draw a curve through those points with the given tangent vectors at each point It seems to me that bezier curves are more general than this you can have different right hand and left hand tangent vectors with a bezier curve hence corners if you want The following is not supposed to be elegant code or nice code or proper or optimal or anything other than an illustration of how to use PolyBezier to draw a curve through specified points with specified tangent vectors Note in particular that using TPoint for the tangent vectors is absurd it should be TRealPoint instead similarly LC should return a pair of floats Etc The math goes like so unit duNewBezier interface uses Windows Classes Graphics

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/0206a.txt (2016-02-14)
    Open archived version from archive


  • can t call it directly It is quite easy to use Win32 drawing functions with Delphi by using the handle property of the Canvas which returns a HDC handle to a Device Context Here is a small example of drawing a single curve using PolyBezier procedure TForm1 FormPaint Sender TObject var pts array 0 3 of TPoint begin pts 0 Point 100 100 pts 1 Point 150 300 pts 2 Point 200 50 pts 3 Point 250 175 PolyBezier Canvas Handle pts 4 Show the points as well as the curve Canvas Rectangle pts 0 x 3 pts 0 y 3 pts 0 x 3 pts 0 y 3 Canvas Rectangle pts 1 x 3 pts 1 y 3 pts 1 x 3 pts 1 y 3 Canvas Rectangle pts 2 x 3 pts 2 y 3 pts 2 x 3 pts 2 y 3 Canvas Rectangle pts 3 x 3 pts 3 y 3 pts 3 x 3 pts 3 y 3 end If you are not familiar with Bezier curves the points which define them may seem confusing As you can see from the sample 4 points define a single curve For each additional curve add 3 more

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1998/0921.txt (2016-02-14)
    Open archived version from archive


  • Sender TObject procedure ClearBitmap begin with imgPreview Picture Bitmap do begin Canvas Brush Style bsSolid Canvas Brush Color clWhite Canvas FillRect Rect 0 0 Width Height end end procedure ConnectPoints const DC hDC const aPoints TPoints const aTypes TPointTypes var PointIdx integer PointCount integer LastMove TPoint begin PointIdx 0 PointCount Length aPoints while PointIdx PointCount do begin case aTypes PointIdx of PT MOVETO begin MoveToEx DC aPoints PointIdx x aPoints PointIdx y nil LastMove aPoints PointIdx end PT LINETO LineTo DC aPoints PointIdx x aPoints PointIdx y PT BEZIERTO begin PolyBezierTo DC aPoints PointIdx 3 inc PointIdx 3 CONTINUE end PT LINETO or PT CLOSEFIGURE begin LineTo DC aPoints PointIdx x aPoints PointIdx y LineTo DC LastMove x LastMove y end PT BEZIERTO or PT CLOSEFIGURE begin PolyBezierTo DC aPoints PointIdx 3 LineTo DC LastMove x LastMove y inc PointIdx 3 CONTINUE end else beep unsupported end inc PointIdx end end procedure Convert var Canvas TCanvas DC hDC aPoints TPoints dynamic array of TPoint structures aTypes TPointTypes dynamic array of bytes iNumPoints integer number of points in path rOut TRect clipping rectangle for DrawText begin get handle to target canvas Canvas imgPreview Picture Bitmap Canvas draw text transparently Canvas Brush

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/2001/0510b.txt (2016-02-14)
    Open archived version from archive


  • it has You could argue that a new class should have been made instead of merging the DIB functionality with TBitmap Or you could just write your own DIB class which wouldn t be that difficult if you are familiar with the API But TBitmap is a tool that all users get out of the box so many users choose to use it To change the color table of a DIB based bitmap you can 1 Use the Win32 function SetDIBColorTable with the Handle of a TBitmap with HandleType bmDib OR 2 Use CreatePalette to create a palette and assign it to the Palette property Internally TBitmap will call SetDIBColorTable BTW OWL had a TDib class but it had a implementation that was even worse than VCL s TBitmap IIRC it did crazy stuff like trying to allocate memory for a palette with a 24 bit bitmap On Thu 14 Jan 1999 17 20 09 0600 Joe C Hecht wrote David Jacobson wrote I have a 256 color bitmap in an image on a form and want to read pixel colors and set pixel colors in it Each byte in the scanline is an index into the color table of

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1999/0115a.txt (2016-02-14)
    Open archived version from archive


  • bmDIB Then use SetDIBColorTable API call to set entries in the DIB s color table Use TImage Canvas Handle TImage Canvas is an encapsulation of TImage Picture Bitmap Canvas as the first parameter Concerning b Info on why 256 color bitmaps don t use pallettes I think I explained this in my last message Is my English too bad You should be glad not to have to tamper with palettes

    Original URL path: http://www.efg2.com/Lab/Library/UseNet/1997/1118.txt (2016-02-14)
    Open archived version from archive



  •