I want to add custom designed buttons to my Inno Script with the TBitmapImage
class.
My Inno Setup script is compiling just fine but the bitmap isn’t showing in the form. I looked into any possibilities but can’t seem to find the error I made. That’s how the TBitmapImage
part looks like atm:
procedure CreateMuteButton(ParentForm: TSetupForm);
var
MuteImage: TBitmapImage;
BitmapFileName: String;
begin
BitmapFileName := ExpandConstant('{tmp}\muteBtn.bmp');
ExtractTemporaryFile(ExtractFileName(BitmapFileName));
MuteImage := TBitmapImage.Create(ParentForm);
MuteImage.Bitmap.LoadFromFile(BitmapFileName);
MuteImage.Cursor := crHand;
MuteImage.OnClick := @MuteButtonOnClick;
MuteImage.Parent := ParentForm;
MuteImage.Left := 45;
MuteImage.Top := 80
MuteImage.Width := 38;
MuteImage.Height := 50;
end;
procedure InitializeWizard();
var
val: Integer;
begin
CreateMuteButton(WizardForm);
(...)
end;
asked May 27, 2012 at 20:49
3
The WizardForm
client area itself is only visible below the bottom bevelled line. Above that is WizardForm.InnerPage
, and the individual/current Wizard pages in the middle contained in a private InnerNotebook
.
This puts the image to the left of the pages:
MuteImage := TBitmapImage.Create(WizardForm.InnerPage);
MuteImage.Parent := WizardForm.InnerPage;
MuteImage.Left := 0;
{ Uses the top of the wizard pages to line up }
MuteImage.Top := WizardForm.SelectDirPage.Parent.Top;
Whereas this puts it in the bottom section:
MuteImage := TBitmapImage.Create(WizardForm);
MuteImage.Parent := WizardForm;
MuteImage.Left := 0;
{ Below the inner page }
MuteImage.Top := WizardForm.InnerPage.Height;
answered May 28, 2012 at 10:32
DeannaDeanna
23.9k7 gold badges71 silver badges156 bronze badges
1
Делал все на основе этой статьи: ссылка
Но в логах пишет
Error: Class 'app\models\Country' not found in /home/artyom/www/localhost/controllers/CountryController.php:19
Мой Country.php
<?php
/**
* Created by PhpStorm.
* User: artyom
* Date: 09.08.17
* Time: 14:45
*/
namespace app\models;
use yii\db\ActiveRecord;
class Country extends ActiveRecord
{
}
Мой CountryController.php
<?php
/**
* Created by PhpStorm.
* User: artyom
* Date: 09.08.17
* Time: 14:48
*/
namespace app\controllers;
use yii\web\Controller;
use yii\data\Pagination;
use app\models\Country;
class CountryController extends Controller
{
public function actionIndex()
{
$query = Country::find();
$pagination = new Pagination([
'defaultPageSize' => 5,
'totalCount' => $query->count(),
]);
$countries = $query->orderBy('name')
->offset($pagination->offset)
->limit($pagination->limit)
->all();
return $this->render('index', [
'countries' => $countries,
'pagination' => $pagination,
]);
}
}
Мой файл в views/country/index.php
<?php
/**
* Created by PhpStorm.
* User: artyom
* Date: 09.08.17
* Time: 14:51
*/
use yii\helpers\Html;
use yii\widgets\LinkPager;
?>
<h1>Countries</h1>
<ul>
<?php foreach ($countries as $country): ?>
<li>
<?= Html::encode("{$country->name} ({$country->code})") ?>:
<?= $country->population ?>
</li>
<?php endforeach; ?>
</ul>
<?= LinkPager::widget(['pagination' => $pagination]) ?>
Может автолодеру нужно что-то сказать?
Problem Description:
I am getting the error “Class ‘Imagick’ not found”. Somehow I need to make this library accessible to php. I am using Php 5.2.6 on Fedora 8. my php_info has no mention of ImageMagick.
I have tried: yum install ImageMagick and restarted apache, which didn’t work.
I also added extension=imagick.ext to my php.ini file and restarted apache, which didn’t work.
Solution – 1
From: http://news.ycombinator.com/item?id=1726074
For RHEL-based i386 distributions:
yum install ImageMagick.i386
yum install ImageMagick-devel.i386
pecl install imagick
echo "extension=imagick.so" > /etc/php.d/imagick.ini
service httpd restart
This may also work on other i386 distributions using yum package manager. For x86_64, just replace .i386 with .x86_64
Solution – 2
For all to those having problems with this i did this tutorial:
How to install Imagemagick and Php module Imagick on ubuntu?
i did this 7 simple steps:
Update libraries, and packages
apt-get update
Remove obsolete things
apt-get autoremove
For the libraries of ImageMagick
apt-get install libmagickwand-dev
for the core class Imagick
apt-get install imagemagick
For create the binaries, and conections in beetween
pecl install imagick
Append the extension to your php.ini
echo "extension=imagick.so" >> /etc/php5/apache2/php.ini
Restart Apache
service apache2 restart
I found a problem. PHP searches for .so files in a folder called /usr/lib/php5/20100525, and the imagick.so is stored in a folder called /usr/lib/php5/20090626. So you have to copy the file to that folder.
Solution – 3
Ubuntu
sudo apt-get install php5-dev pecl imagemagick libmagickwand-dev
sudo pecl install imagick
sudo apt-get install php5-imagick
sudo service apache2 restart
Some dependencies will probably already be met but excluding the Apache service, that’s everything required for PHP to use the Imagick
class.
Solution – 4
For MAMP running on Mac OSX
Find out the what version of PHP and install the right version via brew
brew install homebrew/php/php56-imagick
Add the extension by modifying the php.ini template in MAMP
Verify the Imagick
Solution – 5
Debian 9
I just did the following and everything else needed got automatically installed as well.
sudo apt-get -y -f install php-imagick
sudo /etc/init.d/apache2 restart
Solution – 6
Install Imagic in PHP7:
sudo apt-get install php-imagick
Solution – 7
On an EC2 at AWS, I did this:
yum list | grep imagick
Then found a list of ones I could install…
php -v
told me which version of php I had and thus which version of imagick
yum install php56-pecl-imagick.x86_64
Did the trick. Enjoy!
Solution – 8
Docker container installation for php:XXX
Debian based images:
RUN apt-get update && apt-get install -y --no-install-recommends libmagickwand-dev
RUN pecl install imagick && docker-php-ext-enable imagick
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* || true
Solution – 9
imagick become not supported in <= php7.0
the Ideal Solution is alternative Package Please find this here
https://github.com/DantSu/php-image-editor
Solution – 10
Install Base Imagick Repos
Many of these answers are great, if you are using PHP5, but PHP8 offers too many features to just pass up, and imagick is a bit different here.
Install the base imagick repos:
sudo apt-get install php8.0-imagick php8.1-imagick imagemagick php-imagick php-pear php-dev
Install Imagick’s Extension into PHP
You may want to omit php8.1-imagick
if you are not up to version 8.1 yet. php-pear
is where the pecl
command lives, so, if that doesn’t install correctly, you’ll get an error when you need to do the next command…
sudo pecl install imagick
Update PHP.ini
Find your php.ini
file with…
php -i | grep -i php.ini
You may get output like…
Configuration File (php.ini) Path => /etc/php/8.1/cli
Loaded Configuration File => /etc/php/8.1/cli/php.ini
Open this file and add to the end of the file this text: extension=imagick.so
.
Restart PHP
Then restart your server. Any of these will do:
systemctl restart apache2
/etc/init.d/apache2 restart
sudo service apache2 graceful
Check if the Install Worked
- See the results of
phpinfo()
on a web page, which should mention imagick. - See the results of simulated
phpinfo()
info calls from the command line withphp -r "echo phpinfo();" | grep 'imagick';
. - See the internal storage of
phpinfo()
from the command line withphp -i | grep 'imagick'
. - See the installed packages containing
imagick
in the name withdpkg --list | grep 'imagick'
.
Note: These are all important, because while I was debugging, I was able to see Imagick installed at lower layers (i.e. with dpkg
), but was not seeing it in the higher layers (i.e. with phpinfo();
through webhost). Cheers.
|
|
|
Пожалуйста, выделяйте текст программы тегом [сode=pas] … [/сode]. Для этого используйте кнопку [code=pas] в форме ответа или комбобокс, если нужно вставить код на языке, отличном от Дельфи/Паскаля.
Следующие вопросы задаются очень часто, подробно разобраны в FAQ и, поэтому, будут безжалостно удаляться:
1. Преобразовать переменную типа String в тип PChar (PAnsiChar)
2. Как «свернуть» программу в трей.
3. Как «скрыться» от Ctrl + Alt + Del (заблокировать их и т.п.)
4. Как прочитать список файлов, поддиректорий в директории?
5. Как запустить программу/файл?
… (продолжение следует) …
Вопросы, подробно описанные во встроенной справочной системе Delphi, не несут полезной тематической нагрузки, поэтому будут удаляться.
Запрещается создавать темы с просьбой выполнить какую-то работу за автора темы. Форум является средством общения и общего поиска решения. Вашу работу за Вас никто выполнять не будет.
Внимание
Попытки открытия обсуждений реализации вредоносного ПО, включая различные интерпретации спам-ботов, наказывается предупреждением на 30 дней.
Повторная попытка — 60 дней. Последующие попытки бан.
Мат в разделе — бан на три месяца…
Проблема с созданием класса TBitmap …?
, В головном юните работает а в моем нет.
- Подписаться на тему
- Сообщить другу
- Скачать/распечатать тему
|
|
Проблема с созданием класса TBitmap. |
Albinos_X |
|
Full Member Рейтинг (т): 16 |
а на что ругается-то? Добавлено Цитата dimfil @ bm: TBitmap.; а где знак «=» |
andrew.virus |
|
dimfil опиши проблему и тебе помогут, но Albinos_X правильно заметил за синтаксисом надо следить …. |
Albinos_X |
|
Full Member Рейтинг (т): 16 |
если проблема в не в подключении Graphics, то значит в синтаксисе… |
dron-s |
|
dimfil
public bm: TBitMap; //….. begin bm := TBitMap.Create; bm.Transparent := true; if FileExists(‘FileName.bmp’) then bm.LoadFromFile(‘FileName.bmp’); end;
всё просто до безумия… |
dimfil |
|
Проблема в общем не в синтаксисе, а в подключении списка содержимого класса после его названия и точки. |
antonn |
|
совершенно не верно Цитата Если самому дописать Create; после точки, то компилятор ругается. значит была нажата F9 (или в меню), значит компилятор попробывал скушать то, что было написано, и естественно споткнулся на отсутствующий символ. И проблема в синтаксисе. |
andrew.virus |
|
в данном случае все объясняется тем что классы TBitmap для модулей Windows и Graphics несколько различны, а тебе был нумет класс последнего при твоем объявлении antonn компилятор перекрывает в твоем проекте первый класс вторым … |
0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
0 пользователей:
- Предыдущая тема
- Delphi: Общие вопросы
- Следующая тема
[ Script execution time: 0,0599 ] [ 16 queries used ] [ Generated: 21.09.23, 09:34 GMT ]
When I deployed my magento store from local host to server then I am getting
Fatal error: Class ‘IntlDateFormatter’ not found in
vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php on
line 93`
After uploading it on server I not seeing my magento home page. when I hit the URL only this error display.
asked Sep 20, 2017 at 7:02
1
Check your php version :
php -v
Check php-intl packages available :
sudo apt search php | grep intl
Install the php-intl according to your php version (7.1 in my case) :
sudo apt install php-intl php7.1-intl
You may also want to switch PHP version :
sudo update-alternatives --config php
php -v
Restart your webserver if you are done
service apache2 restart
Black
3,1004 gold badges26 silver badges95 bronze badges
answered Nov 1, 2017 at 9:50
DevonDahonDevonDahon
8791 gold badge15 silver badges32 bronze badges
2
Just need to clear comment before this line in php.ini
file:
;extension=php_intl.dll
to
extension=php_intl.dll
answered Jan 4, 2018 at 4:22
2
If PHP version: 7.2.11
Just need to clear comment before this line in php.ini
file:
;extension=intl
to
extension=intl
answered Aug 20, 2019 at 6:45
Jugal KishorJugal Kishor
1,22512 silver badges36 bronze badges
I had the same Problem, a new Magento 2.1.7 installation, php 7.0.2, mysql 5.6. in developer mode and the cronjob always send me an email with:
Class ‘IntlDateFormatter’ not found in
/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on
line 93
My solution was:
Both entries for the base-urls (secure und unsecure) under stores > configuration > general > web had to be the secure (https://) domain.
Now everything works fine.
Piyush
5,8739 gold badges32 silver badges63 bronze badges
answered Feb 6, 2018 at 10:56
I was stuck on this error for hours. For whatever reason I was getting this error even though I had the PHP ext intl
installed and loaded. The cause for me turned out to be a files/directories permissions issue.. hope this saves someone a headache.
I ran at docroot:
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
and all was well again.
answered Mar 23, 2021 at 4:47
Nick RolandoNick Rolando
1,2025 gold badges17 silver badges35 bronze badges