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
 How to create multipage ICO file?

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
graph_man Posted - Oct 11 2022 : 10:50:01
Hello,

If I use

ImageEnView1->IO->Params->ICO_ImageIndex = 0;
ImageEnView1->IO->SaveToFileICO(AllSaveDialog_FileName);

ImageEnView1->IO->Params->ICO_ImageIndex = 1;
ImageEnView1->IO->SaveToFileICO(AllSaveDialog_FileName);

I am getting a file with one page ONLY.

I would like to have a function like
InsertToFileICO

Is there another way?
Somehow ImageEnMView->MIO->SaveToFileICO creates a multi-page ICO file.
6   L A T E S T    R E P L I E S    (Newest First)
graph_man Posted - Oct 18 2022 : 16:45:02
Thanks
xequte Posted - Oct 16 2022 : 21:14:48
Hi

Unlike other multi-image formats, icon files are not intended to store different images, but rather different sizes and bit depths of the same image (so Windows can choose the best one for a particular usage). That is why ImageEn builds an icon file of multiple sizes using a single image.

If you want to create an icon file of all your own images, you can use:

// Create an icon file from ten source images
mbmp := TIEMultiBitmap.create;
for i := 0 to 9 do
  mbmp.AppendImage( format( 'D:\Source\Frame %d.bmp', [i] ));
mbmp.Write( 'D:\output.ico' );
mbmp.Free;


Nigel
Xequte Software
www.imageen.com
graph_man Posted - Oct 13 2022 : 04:21:11
Your code shows how to create multiple pages from a single image.
As I wrote earlier, I need to create multipage ICO from different images.

How to use TIEMultiBitmap for this?

ps
Could you add InsertToFileICO function?
similar to other formats
xequte Posted - Oct 12 2022 : 16:00:06
Hi

OK, so ImageEn, by default, will create an icon file with multiple icons using a single image, if you set the sizes:

https://www.imageen.com/help/TIOParams.ICO_Sizes.html

e.g.

// Save the current image as 'output.ico'. It will contain three images with 64x64 32bit (24bit + alphachannel), 32x32 256 colors and 32x32 16 colors

// 64 x 64 x 32bit
ImageEnView.IO.Params.ICO_BitCount[0] := 32;
ImageEnView.IO.Params.ICO_Sizes[0].cx := 64;
ImageEnView.IO.Params.ICO_Sizes[0].cy := 64;

// 32 x 32 x 8bit
ImageEnView.IO.Params.ICO_BitCount[1] := 8;
ImageEnView.IO.Params.ICO_Sizes[1].cx := 32;
ImageEnView.IO.Params.ICO_Sizes[1].cy := 32;

// 32 x 32 x 4bit
ImageEnView.IO.Params.ICO_BitCount[2] := 4;
ImageEnView.IO.Params.ICO_Sizes[2].cx := 32;
ImageEnView.IO.Params.ICO_Sizes[2].cy := 32;

// Specify end of images
ImageEnView.IO.Params.ICO_BitCount[3] := 0;
ImageEnView.IO.Params.ICO_Sizes[3].cx := 0;
ImageEnView.IO.Params.ICO_Sizes[3].cy := 0;

// Save
ImageEnView.IO.SaveToFile('D:\output.ico');



If you want to create an multi-page icon from your own set of images, either use a TImageEnmView/TIEMultiBitmap, or IEWriteICOImages:

https://www.imageen.com/help/IEWriteICOImages.html


Nigel
Xequte Software
www.imageen.com
graph_man Posted - Oct 12 2022 : 04:26:08
I want to create a multi-page icon file.
See my code.
When calling the SaveToFileICO function, ImageEnView1 contains different images.
xequte Posted - Oct 11 2022 : 22:37:13
Sorry, can you clarify what you are wanting? Not a multi-page icon file?

Nigel
Xequte Software
www.imageen.com