ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIEBitmap PUBLISHED property

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
HeartWare Posted - Feb 26 2018 : 02:48:58
I am making a custom component for a project, which includes a TIEBitmap as one of its properties (actually, a TCollection of classes which include a TIEBitmap). I would like to be able to add my class to the collection (this part seems to work), and then - in the standard collection editor - be able to browse to a picture file to put into the TIEBitmap.

But, when I add my class

TPictureItem  = CLASS(TCollectionItem)
                    BitMap      : TIEBitMap;
                  PRIVATE
                    FUNCTION    GetWidth : Cardinal;
                    FUNCTION    GetHeight : Cardinal;
                    FUNCTION    GetBitMap : TIEBitMap;
                  PUBLISHED
                    PROPERTY    Picture : TIEBitMap Read GetBitMap;
                    PROPERTY    Width : Cardinal Read GetWidth;
                    PROPERTY    Height : Cardinal Read GetHeight;
                  END;


to the collection, it correctly displays my Picture item:



but doesn't allow me to either Expand the Picture or (preferably) simply allow me to select an image to load into it. Preferably, I would like the Object Inspector to simply have a button to browse for at picture file (using ImageEn's OpenImageEnDialog), secondary option is to allow expansion of the Picture element and then allow me to load the picture file from there.

How do I accomplish this?
2   L A T E S T    R E P L I E S    (Newest First)
HeartWare Posted - Feb 26 2018 : 05:52:08
A Step further:

Property Editor should descend from TClassProperty and then I can access the item in the collection that is being edited via the the GetOrdValue, typecasting it to the proper class type. So now I am able to edit the collection and select images to put into it.

But it doesn't save (stream) it to the .DFM file. I suspect it is because I need to have the TPic descend from TPersistent, and then provide a private variable within the class that contains the TIEBitmap, but how do I make sure that when the TPic is being streamed out, I get called and can stream out the TIEBitmap (and how do I read it back in again)?
HeartWare Posted - Feb 26 2018 : 04:16:41
I have managed to create a custom property editor and it almost works. I have made the "..." button appear, and I can click it and get my Edit event called in my property editor, but I can't seem to locate the IEBitmap in order to update it. In the property editor, I have a lot of Get functions (GetFloatValue, GetInt64Value, GetOrdValue and GetVarValue), but I can't figure out how I get access to the TPictureItem (descended from TCollectionitem). I have registered the property editor for type TPic, which is descended from TIEBitMap, and have defined a TPictureItems=CLASS(TCollection) and the values added to the collection is a TPictureItem=CLASS(TCollectionItem), which includes Read/Only properties Width, Height (to quickly be able to see the size of the attached image), and a R/W property Picture which is of type TPic.

And the button appears to the right of the Picture property and I can click it and call my Edit method, but I can't figure out how to the get TPic item that is currently being edited.

Can anyone guide me in the right direction?