Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2009.10.11;
Скачать: [xml.tar.bz2];

Вниз

Как запихнуть в ресурсы 32-хбитный битмап?   Найти похожие ветки 

 
CSS   (2009-08-03 10:35) [0]

делаю такой RC-файл:

MY_BMP BITMAP "picture.bmp"

Если изображение обычное (24-хбитное), то нормально делается RES...
Но если оно 32-хбитное (с прозрачностью), то brcc32 говорит, мол:

Error RES.RC 1 15: Invalid bitmap format


 
Anatoly Podgoretsky ©   (2009-08-03 11:12) [1]

> CSS  (03.08.2009 10:35:00)  [0]

Тип смени с BITMAP на другой


 
CSS   (2009-08-03 11:19) [2]

Хм... И на какой же, например?))
А она тогда загрузится в переменную типа TBitmap?


 
Юрий Зотов ©   (2009-08-03 11:39) [3]

Попробуйте компилировать не brcc32, а майкрософтовским rc.


 
Anatoly Podgoretsky ©   (2009-08-03 12:04) [4]

> CSS  (03.08.2009 11:19:02)  [2]

Да хотя бы на пользовательский


 
TIF ©   (2009-08-03 20:02) [5]

<off>
А чем brcc32 вообще лучше rc? Точки в именах ресурсов даже не поддерживает...


 
Юрий Зотов ©   (2009-08-03 20:42) [6]

> TIF ©   (03.08.09 20:02) [5]

Я бы сказал - хуже. Не раз натыкался на проблемы с ним, а с RC - все ОК проходило. Поэтому и предложил попробовать RC.


 
TIF ©   (2009-08-03 22:26) [7]

> Я бы сказал - хуже

Насчёт этого я тоже уже убедился на практике, двух-трёх проблем мне хватило, чтобы на майкрософтский компилятор ресурсов перейти.

Просто интересно узнать, почему в Borland было решено создать свой аналог?


 
antonn ©   (2009-08-04 02:24) [8]


> CSS   (03.08.09 11:19) [2]
>
> Хм... И на какой же, например?))
> А она тогда загрузится в переменную типа TBitmap?

Придумай свою секцию.
MY_BMP MYBITMAPS "picture.bmp"

var Res : TResourceStream;
begin
Res := TResourceStream.Create(hInstance, Pchar("MY_BMP"), Pchar("MYBITMAPS"));
try
   res.position:=0; //на всякий :)
   Tbitmap.loadfromstream(res);
finally
  res.Free;
end;


PS Почти сразу после знакомства с борландовским ресорсером стал паковать ресурсы в свои секции и не парится с какими то ихними форматами и ограничениями.


 
CSS   (2009-08-04 08:19) [9]

Заработало... ^__^

antonn, огромная благодарность... =)


 
TIF ©   (2009-08-08 11:05) [10]

> Просто интересно узнать, почему в Borland было решено создать
> свой аналог?

Откопал-таки :)
http://docwiki.embarcadero.com/RADStudio/en/RC.EXE,_the_Microsoft_SDK_Resource_Compiler

RC is the command-line version of the standard Microsoft SDK resource compiler. It accepts a resource script file (.RC) as input and produces a resource object file (.RES) as output.

Both C++Builder 2009 and Delphi 2009 give you a choice of resource compilers. On the Project > Options > Resource Compiler dialog box, you can select either of the following:
* BRCC32.exe, the C++Builder resource compiler
* RC.exe, the Microsoft platform SDK Resource Compiler

RC supports Unicode characters in resource files and file names, as well as new Vista resource types such as icons with alpha channel.

The actual filename of the RC compiler in the RAD Studio environment is CGRC.exe.

Differences Between BRCC32 and RC

If you choose to use RC, several differences between BRCC32 and RC need to be addressed in existing .RC files, as follows:
* To use Windows types or constants with RC, you need to explicitly #include <winresrc.h> for both C++ and Delphi.
* RC does not handle image data inline as BRCC32 does. To use an image with RC, you need to save the image and refer to the image inline.
* RC handles line continution differently than BRCC32. The simplest change is to combine strings with embedded newlines (\n).
* For RC, the order of command elements requires that all command options must come first, before the name of the resource file.
* RC does not allow trailing commas after the string in a STRINGLIST.
* RC treats strings as C-style strings. This means that you need to do either of the following:
** Escape a single backslash (\) in filenames by using a double backslash (\\).
** Use a forward slash (/) in place of a single backslash (\).
* For RC, specifying #include <dirname> does not search the current directory. To search the current directory, use #include "dirname".
* To embed a double-quote character in a string, use two consecutive double-quote characters ("") instead of using the backslash escape character.
* RCDATA and byte values are handled differently. For example:
** BRCC32 treats "11 aa 22 bb" as a string of bytes.
** For RC, you would need to specify 0xaa11 0xbb22.



Страницы: 1 вся ветка

Форум: "Начинающим";
Текущий архив: 2009.10.11;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.48 MB
Время: 0.006 c
2-1249976482
N-Tek
2009-08-11 11:41
2009.10.11
Вопрос по ListView


2-1249977509
Foster14
2009-08-11 11:58
2009.10.11
Работа с БД IB


15-1249641398
Cyrax
2009-08-07 14:36
2009.10.11
Почему многие интернет-магазины не принимают электронные деньги ?


6-1207843756
anton
2008-04-10 20:09
2009.10.11
поменять стиль документа


3-1227795794
samalex
2008-11-27 17:23
2009.10.11
Как мне узнать хост пк и логин пользователя





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский