Jump to content

Search the Community

Showing results for tags 'unigui component tbitmap'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • uniGUI Public
    • Announcements
    • General
    • Feature Requests
    • Installation
    • Deployment
    • Other Platforms
  • Licensing
    • Licensing
    • Ordering uniGUI
  • Bug Reports
    • Active Reports
    • Closed Reports
    • Old Bug Reports
  • uniGUI Development
    • General Development
    • uniGUI Releases & Roadmaps
    • Utilities
  • Mobile Platform
    • uniGUI Mobile
    • Mobile Browsers
  • Users Area
    • Sample Projects
    • Components and Code Samples
    • Third Party Components
  • Non-English
    • Non-English
  • Miscellaneous
    • Hosting
    • Server Security
    • Jobs

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. I'm trying to develop a custom unigui component within a TFrame parent. Everything was fine so far but I have to add an icon to this component. I added a Tbitmap property for this. I'm creating and freeing the bitmap in the contructor and destructor. I can change the bitmap at design time using object inspector. My problem is, when I try to remove the component from my form, Delphi crashes with Access Violation error. If I comment out Icon.Free on destructor, it does not crash. unit unit_device_type_a; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIFrame, uniGUIBaseClasses, uniPanel, uniLabel, Vcl.Imaging.pngimage, uniImage, uniEdit; const Fversion = '1.0.0'; type Tframe_device_type_A = class(TUniFrame) panel_parent: TUniPanel; UniPanel2: TUniPanel; label_header: TUniLabel; bitmap_icon: TUniImage; UniLabel1: TUniLabel; UniLabel4: TUniLabel; UniLabel5: TUniLabel; UniImage1: TUniImage; UniImage2: TUniImage; function GetVersion: string; procedure SetVersion(const Value: string); function GetIcon: Tbitmap; procedure SetIcon( icon : TBitmap ); private { Private declarations } public { Public declarations } constructor Create(Aowner: TComponent); override; destructor Destroy; override; published property Version: string read GetVersion write SetVersion; property Icon: Tbitmap read GetIcon write SetIcon; end; implementation {$R *.dfm} constructor Tframe_device_type_A.Create(AOwner: TComponent); begin inherited; Icon := TBitmap.Create; end; destructor Tframe_device_type_A.Destroy; begin Icon.Free; inherited; end; function Tframe_device_type_A.GetIcon: TBitmap; begin result := bitmap_icon.Picture.Bitmap; end; procedure Tframe_device_type_A.SetIcon(icon : TBitmap); begin bitmap_icon.Picture.Bitmap.Assign( icon ); end; end.
×
×
  • Create New...