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".

  • 207 34 113 138 30 May 2001 07 21 42 0700 Path dnews Xref dnews borland public delphi graphics 39346 Is your TImage on the MDI parent or MDI child It should work on the MDI child but will not work on an MDI parent form You have to do some extra coding to get that to work Here is an example from Peter Below that worked for me The only problem I have is when you move an MDI child slightly off the screen and the scrollbars appear Then the picture is not redrawn properly I m still trying to figure out how to make that work I hope this works for you unit Main interface uses Windows Messages SysUtils Classes Graphics Controls Forms Dialogs Menus StdCtrls ToolWin ComCtrls type TForm1 class TForm ToolBar1 TToolBar ToolButton1 TToolButton ToolButton2 TToolButton procedure FormCreate Sender TObject procedure FormDestroy Sender TObject procedure FormResize Sender TObject private Private declarations FLogoBitmap TBitmap FOldProc Pointer public Public declarations end var Form1 TForm1 implementation R DFM Function ClientWindowProc wnd HWND msg Cardinal wparam lparam Integer Integer stdcall Var f TForm1 r Trect Begin f TForm1 GetWindowLong wnd GWL USERDATA Case msg of WM ERASEBKGND Begin GetClientrect wnd

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



  • code do I need to put in the FormResize to limit the smallest that the form can be resized to In D4 you can use the Contraints property where you can set the min and max size of a form If you use D3 or lower you should use the WM GETMINMAXINFO message like this procedure TForm1 WMGetMinMaxInfo var Message TWMGetMinMaxInfo sets Size limits for the Form var MinMaxInfo PMinMaxInfo

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


  • can determine the format by decoding the first several bytes but it would probably be better just to store the class name in the stream this is how image data are stored in DFM files by the way I could save the type info in a string but I m not sure how to do that procedure SaveGraphicToStream Graphic TGraphic Stream TStream var L Word S String begin S Graphic

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


  • article Lord Crc wrote Now no matter how i try to use the TIcon object they turn out to be 16 colors after a SaveToFile Is there some magic involved in doing this After all the impression i got about 16 colored icons is that its a rather big hack The Delphi TIcon class is very limited in this respect Icon files ICO can contain several separate images at different resolutions and sizes But if you load an Icon with LoadFromFile it will load only the single image that matches your current screen settings The algorithm that decides which image to load is a ghastly tangle Have a look at ReadIcon in Graphics pas and try to figure out what it s doing Seeing as Delphi only ever loads a single image from your ICO file when you call LoadFromFile it can only write a single image when you call SaveToFile All other images will be discarded And SaveToFile can only write 16 color icons anyway Have a look at the code for WriteIcon Especially the lines InternalGetDIBSizes IconInfo hbmMask MonoInfoSize MonoBitsSize 2 InternalGetDIBSizes IconInfo hbmColor ColorInfoSize ColorBitsSize 16 The 16 means 16 colors in other words Delphi can only

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


  • SaveToStream m1 m2 TMemoryStream Create TRY Icon2 SaveToStream m2 IF m1 Size m2 Size THEN RESULT CompareMem m1 Memory m2 Memory m1 Size FINALLY m2 Free END FINALLY m1 Free END END AreTIconsEqual procedure TForm1 Button1Click Sender TObject VAR iconA TIcon iconB TIcon iconC Ticon begin iconA TIcon Create iconB TIcon Create iconC TIcon Create TRY iconA LoadFromFile A ICO iconB LoadFromFile B ICO A B iconC LoadFromFile C ICO

    Original URL path: http://www.efg2.com/Lab/Library/Delphi/Graphics/CompareTIcons.TXT (2016-02-14)
    Open archived version from archive


  • var Form1 TForm1 implementation R DFM Load Icon and create AND bitmap mask and OR color bitmap Based on Tomes of Delphi 3 Win32 Graphical API pp 389 391 procedure TForm1 ButtonICOtoBMPClick Sender TObject VAR BitmapIconA TBitmap BitmapIconB TBitmap BitmapAND TBitmap BitmapOR TBItmap Icon TIcon IconInfo TIconInfo begin Icon TIcon Create TRY Icon LoadFromFile C Program Files Common Files Borland Shared Images Default delphi ico ImageIcon1 Picture graphic Icon BitmapIconA TBitmap Create TRY BitmapIconA Width Icon Width BitmapIconA Height Icon Height BitmapIconA PixelFormat pf24bit BitmapIconA Canvas Draw 0 0 Icon ImageIconA Picture Graphic BitmapIconA This bitmap does not show transparency correctly i e this TBitmap displayed in a TImage does not appear the same way as a TIcon in a TImage BitmapIconB will appear just like a TIcon in a TImage BitmapIconA Transparent TRUE BitmapIconB TBitmap Create TRY BitmapIconB Width Icon Width BitmapIconB Height Icon Height BitmapIconB PixelFormat pf24bit BitmapIconB Canvas Brush Color clBtnFace BitmapIconB Canvas FillRect BitmapIconB Canvas ClipRect BitmapIconB Canvas Draw 0 0 BitmapIconA ImageIconB Picture Graphic BitmapIconB FINALLY BitmapIconB Free END FINALLY BitmapIconA Free END GetIconInfo Icon Handle IconInfo TRY Hot Spot for icon is center of bitmap LabelHotSpot Caption Hot Spot IntToStr IconInfo xHotSpot IntToStr IconInfo

    Original URL path: http://www.efg2.com/Lab/Library/Delphi/Graphics/ICOtoBMP.pas.txt (2016-02-14)
    Open archived version from archive


  • Newsgroups borland public delphi graphics On Thu 14 Jan 1999 01 53 31 GMT pserg chat ru Pershin Sergey wrote I m using ExtractIcon to get icon from file but it s type is HICON How can i convert HICON into other type like TPicture or TBitmap You can create a TIcon object and assign the handle received from the ExtractIcon function to the TIcon Handle property If you want

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


  • in the VCL By Joe C Hecht procedure StretchDrawIcon Canvas TCanvas IconHandle HIcon x integer y integer Width integer Height integer var IconInfo TIconInfo bmMaskInfo Windows TBitmap bmColorInfo Windows TBitmap dc hDc CanvasHandle HDC OldBrushColor TColor OldPenColor TColor OldTextColor TColor OldBkColor TColor oldbm HBitmap bmMaskInfobmHeightdiv2 integer begin CanvasHandle Canvas Handle FillChar bmMaskInfo sizeof bmMaskInfo 0 FillChar bmColorInfo sizeof bmColorInfo 0 GetIconInfo IconHandle IconInfo if IconInfo FIcon FALSE then begin Exit end if IconInfo hbmMask 0 then begin GetObject IconInfo hbmColor sizeof bmColorInfo bmColorInfo end if IconInfo hbmMask 0 then begin exit end dc CreateCompatibleDc 0 OldBrushColor Canvas Brush Color Canvas Brush Color clWhite OldPenColor Canvas Pen Color Canvas Pen Color clBlack OldTextColor SetTextColor CanvasHandle RGB 0 0 0 OldBkColor SetBkColor CanvasHandle RGB 255 255 255 if bmMaskInfo bmBitsPixel bmMaskInfo bmPlanes 1 AND IconInfo hbmColor 0 then begin bmMaskInfobmHeightdiv2 bmMaskInfo bmHeight div 2 oldbm SelectObject dc IconInfo hbmMask StretchBlt CanvasHandle x y Width Height dc 0 0 bmMaskInfo bmWidth bmMaskInfobmHeightdiv2 SRCAND StretchBlt CanvasHandle x y Width Height dc 0 bmMaskInfobmHeightdiv2 bmMaskInfo bmWidth bmMaskInfobmHeightdiv2 SRCINVERT SelectObject dc oldbm DeleteObject IconInfo hbmMask end else begin oldbm SelectObject dc IconInfo hbmMask StretchBlt CanvasHandle x y Width Height dc 0 0 bmMaskInfo bmWidth bmMaskInfo bmHeight

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



  •