- This topic has 14 replies, 2 voices, and was last updated 2 years, 10 months ago by Koushik Halder.
-
AuthorPosts
-
December 17, 2021 at 6:45 pm #70629Koushik HalderParticipant
I have coded to add the AlphaHints on FormCreation using MemoryStream. To do this I have copied ImgData from my DFM File to MemoryStream and tried to load my custom Procedure as LoadAlphaHintsData. I am getting error as Argument out of range. What is the solution?
I this regard, I have another question that what is the code to activate sAlphaHints1.Templates[1] by coding?
- This topic was modified 2 years, 11 months ago by Koushik Halder.
Attachments:
You must be logged in to view attached files.December 19, 2021 at 4:08 pm #70632SupportKeymasterThanks for the demo.
You should add new item before properties defining, like this:sAlphaHints1.Templates.Add;
But I’m not sure your AText parameter has the correct image format.
Maybe you can store it in the TsAlphaImageLsit and load it in the run-time?
Or load from external file?December 19, 2021 at 5:00 pm #70636Koushik HalderParticipantI am hundred percent sure
AText parameter has the correct image format
. I can createTsAlphaImageLsit
usingAText parameter
. Please see there is something more.December 20, 2021 at 11:44 am #70638Koushik HalderParticipantUsing the same piece of code I can add
sImage1.Picture
andsBitBtn1.Glyph
so why I am unable to loadsAlphaHints1.Image
?
As per you suggestion I have addedsAlphaHints1.Templates.Add;
, no my Argument out of range is gone but new error has come as Cannot load image. Invalid or unexpected PNG image format.. So I thinks it can be done with some little bit of modification. So you are requested to help me to modify myLoadAlphaHintsData
.
Another thing is that when I am defining a variable asAacHintImage: TacHintImage;
and trying to useAsAlphaHints.Templates[TemplatesIndex].AacHintImage.LoadFromStream(LData);
instead ofAsAlphaHints.Templates[TemplatesIndex].ImageDefault.LoadFromStream(LData);
, I a am getting error atAacHintImage
as Undeclared identifier. What is the correct way?FYI : I don’t like to load
sAlphaHints1.Image
fromTsAlphaImageLsit
or from from external file run-time.I have updated my project. Please see details.
- This reply was modified 2 years, 11 months ago by Koushik Halder.
Attachments:
You must be logged in to view attached files.December 22, 2021 at 6:58 pm #70651SupportKeymasterI need to know what you want to do, then I can suggest a best way.
I’m not sure that copying of binary data from Dfm is good idea.Type of ImageDefault is TacHintImage.
It’s not the image, this is an object including an image and some other information (look the TacHintImage type in the acAlphaHints.pas unit).December 23, 2021 at 5:58 am #70663Koushik HalderParticipantMy requirement is very simple. I don’t like to allow me like simple user to extract my own
sAlphaHintsTemplate
using PE Editors likePE Explorer
,Resource Tuner
andResource Hacker
etc. So I have decided not store any Binary Data to my PE. I will load Binary Data into Memory Stream then I will call it at Runtime. So I need to create to createsAlphaHintsTemplate
from Memory Stream using Binary Data. So what is the solution of conversion?January 3, 2022 at 7:41 am #70674SupportKeymasterThe ImageDefault.Image property should have Png format for loading.
In the new release I will add support of Bitmaps also (at the nearest days).
Will be possible using of such code:
LoadGlyphData(sAlphaHints1.Templates[0].ImageDefault.Image, 'B6430000424DB6430000000000003600000028000000480000003C....
January 3, 2022 at 12:01 pm #70676Koushik HalderParticipantThe above solution is not working. I am getting error as
Cannot load image. Invalid or unexpected PNG image format.
January 3, 2022 at 1:18 pm #70680SupportKeymasterSorry, you are right, I have added some changes in the package and this Image can load bitmaps on my side.
Your package can load Png only there. Please, wait new release at the nearest days.January 3, 2022 at 7:12 pm #70685Koushik HalderParticipantNo! No! I don’t have no problem with PNG Image. Please modify my project to load PNG image.
January 3, 2022 at 7:36 pm #70686SupportKeymasterYou just need have Png there as a text parameter, pass it in the my demo instead of bitmap text.
January 3, 2022 at 7:56 pm #70687SupportKeymasterLook the new demo with Png
Attachments:
You must be logged in to view attached files.January 4, 2022 at 7:26 am #70689Koushik HalderParticipantI have a checked you demo. I have not found PNG Data. I have tried to add Image Data from to code to
Image1: TImage;
in DFM File but no image is shown inImage1: TImage;
. Please see the case again. I need to load real PNG Data which is available in DFM File.January 8, 2022 at 4:47 pm #70695SupportKeymasterBinary data is Png there, but you can try bitmap also with v16.22 released today.
January 10, 2022 at 7:25 pm #70703Koushik HalderParticipantThanks a lot. Now it is working flawlessly. I have checked using Frame also and working properly.
-
AuthorPosts
- You must be logged in to reply to this topic.