![]() |
|
Модераторы: Poseidon |
![]()
|
|
| Deiv |
|
||||
|
Новичок Профиль Группа: Участник Сообщений: 43 Регистрация: 11.2.2006 Где: ЛаПаc-Боливия (Ю жная Америка) Репутация: нет Всего: нет |
Привет,
Для не записи несколько изображениx (images) в диске, я решил записать единственный образ 128x640 pixels (где одно букбa тянется каждое 64 pixels в 2x линиях [10 букб выше и 10 букб ниже] кажды/64 pixels) нагружая это с TIMAGELIST'om (как будто это казалось матрицей 10x2) Мой Образ имеет БЕЛОЕ дно. _________________________________________ | A | B | C | D | E | F | G | H | I | J | | K | L | M | N | O | P | Q | R | S | T | ------------------------------------------ Со следующим кодoм я положу индекс:
Как сделать ту же работу в Timage?Я попробывал c: ImageList1.BkColor:=clNone; ImageList1.BlendColor:= clNone; ImageList1.DrawingStyle:= dsTransparent; ImageList1.Masked:= True; И, Image1.Transparent:=true; BitMap.TransparentColor:=BitMap.Canvas.Pixels[0,0]; //white bottom BitMap.Transparent:= True; BitMap.TransparentMode:= tmFixed; И Я не получаю прозрачную частью BitMap'a в TImage Тянучи, Как я могу показать индекс например 15 [5,1] 5+ (1*10) =15 ПРОЗРАЧНЫЙ TImageList'a в TImage? Hello, For to avoid and save several images in disk, I decided to save a single image of 128x640 pixels (where a Letter is drawn each 64 pixels in 2 lines [10 letters above and 10 letters below] each/64 pixels) that I load it with a TImageList (as if it seemed a matrix of 10x2) My Image has WHITE bottom _________________________________________ | A | B | C | D | E | F | G | H | I | J | | K | L | M | N | O | P | Q | R | S | T | ------------------------------------------ With the following code position an index:
How to make the same work in a Timage? I have proven with ImageList1.BkColor:=clNone; ImageList1.BlendColor:= clNone; ImageList1.DrawingStyle:= dsTransparent; ImageList1.Masked:= True; and, Image1.Transparent:=true; BitMap.TransparentColor:=BitMap.Canvas.Pixels[0,0]; //white bottom BitMap.Transparent:= True; BitMap.TransparentMode:= tmFixed; And I don't get the transparent of a part of the BitMap in a TImage When drawing, How I show the index for example 15 [5,1] 5+(1*10)=15 TRANSPARENT of the TImageList in a TImage? |
||||
|
|||||
| Alexeis |
|
||||
![]() Амеба Профиль Группа: Админ Сообщений: 11743 Регистрация: 12.10.2005 Где: Зеленоград Репутация: 23 Всего: 459 |
Deiv, I сan`t understand what вщ you need to do....
To copy an image from a bitmap to TImage you should simply assign it to TImage.
To get only tranparent part, you must use WINAPI function AlphaBlend. It combines two DCs with transparency Here is an example (by Snowy) which combines two bitmaps with transparency.
p.s. Don`t use Promt to translate from English into Russian. It does it badly. Nobody ever can understand these sentences. Это сообщение отредактировал(а) Exception - 10.11.2006, 18:13 -------------------- Vit вечная память. Обсуждение действий администрации форума производятся только в этом форуме гениальность идеи состоит в том, что ее невозможно придумать |
||||
|
|||||
| Deiv |
|
|||
|
Новичок Профиль Группа: Участник Сообщений: 43 Регистрация: 11.2.2006 Где: ЛаПаc-Боливия (Ю жная Америка) Репутация: нет Всего: нет |
Спасибо, мой вопрос был :
Как сделать ту же работу в Timage? How to make the same work in a Timage? QUOTE: Here is an example (from Snowy) which combines two bitmaps with transparency. не нужно комбинировать (Dont' need to combine) Мой код показывает часть от BitMap'a в TPaintBox'e, мне нужно делать то же самое, но в TImage (прозрачной) с TImagelist'oм (Изменять мой код TPaintBox'a к TImage). My code shows a part of the BitMap in a TPaintBox, I need to do the same but in a TImage (transparent) with TImagelist. |
|||
|
||||
| Alexeis |
|
|||
![]() Амеба Профиль Группа: Админ Сообщений: 11743 Регистрация: 12.10.2005 Где: Зеленоград Репутация: 23 Всего: 459 |
Like TPaintBox has, TImage also has a canvas. You can use Image1.Canvas instead of PaintBox1.Canvas. It seems to me that you already know this but Image1.Canvas doesn`t works as indeed, does it? Это сообщение отредактировал(а) Exception - 10.11.2006, 18:14 -------------------- Vit вечная память. Обсуждение действий администрации форума производятся только в этом форуме гениальность идеи состоит в том, что ее невозможно придумать |
|||
|
||||
| Deiv |
|
||||
|
Новичок Профиль Группа: Участник Сообщений: 43 Регистрация: 11.2.2006 Где: ЛаПаc-Боливия (Ю жная Америка) Репутация: нет Всего: нет |
Я подумал нужно было только изменить
чтобы показать тот кусок [15], но это не показывает мне прозрачному. Мне нужно только переводить мой Код из TPaintBox к TImage и показал мне прозрачному. Как я могу это сделать? I thought alone it would be to change with ImageList1.Draw(PaintBox1.Canvas,0,0,15) x ImageList1.Draw(Image1.Canvas,0,0,15) for to show that piece [15], but it doesn't show me transparent. I only need help in to translate my Code from a TPaintBox to a TImage and it also shows me transparent. How can I make that? |
||||
|
|||||
| Alexeis |
|
|||
![]() Амеба Профиль Группа: Админ Сообщений: 11743 Регистрация: 12.10.2005 Где: Зеленоград Репутация: 23 Всего: 459 |
TPaintBox is just a DC, but TImage is a storage for picture. May be you need to convert internal TImage bitmap in to 32bit/color as TPaintBox has. Image1.picture.bitmap.PixelFormat := pf32bit; //default is pfDevice Or you can combine two images Image1.picture.bitmap.canvas and Image received with ImageList1.GetBitmap() (With function AlphaBlend) Result Canvas will be TImage canvas. It will give you same result as ImageList1.Draw(PaintBox1.Canvas,0,0,15) I checked this method. It works well. Это сообщение отредактировал(а) alexeis1 - 7.11.2006, 03:04 -------------------- Vit вечная память. Обсуждение действий администрации форума производятся только в этом форуме гениальность идеи состоит в том, что ее невозможно придумать |
|||
|
||||
| Deiv |
|
||||||||
|
Новичок Профиль Группа: Участник Сообщений: 43 Регистрация: 11.2.2006 Где: ЛаПаc-Боливия (Ю жная Америка) Репутация: нет Всего: нет |
Я проверил код и работает очень хорошо c TTimer'om, спасибо. Сейчас у меня два вопроса:
Нагружая программу, TIMAGE показывает мне белый цвет в TFORM:
Когда я нагружаю с кнопкой:
также показывает мне часть bitmap'a с белым дном 1.- Могу ли показать нагружая мою программу бездонную TImage (прозрачный)? значит без белого цвета?, и Так же со click'oм кнопки "Load Part of BitMap" TImage может показать мне непосредственно (прямо) прозрачному? 2.- Alexei Вы проверили другой Bitmap? Почему TImageList не поддерживает bitmaps 32 bits'a? I have checked the code and it works very well with TTimer, thank you. Now I have two questions: When loading the program, TImage shows me a white color in the TForm:
When I load with the button:
It also shows me the part of the BitMap with white bottom 1.- Can I show when loading my program a bottomless TImage (transparent)? that is to say without any color?, likewise to the click of the button "Load Part of BitMap" could the TIMage show me directly transparent? 2.- Alexei Have you checked the other BitMap? Why doesn't TImageList support bitmaps of 32 bits? |
||||||||
|
|||||||||
| Alexeis |
|
|||
![]() Амеба Профиль Группа: Админ Сообщений: 11743 Регистрация: 12.10.2005 Где: Зеленоград Репутация: 23 Всего: 459 |
You need to fill alpha channel with 255 and 0 s. Zero for transparent fields and 255 for not transparent fields. This binary mask can help you draw correct transparensity. Then you made so, you can use funtion alphablend to draw transparent fields witch are filled with various color. TImageList supports addition of binary mask. It can be used for transparensy. function Add(Image, Mask: TBitmap): Integer;//see help for more information No, I checked only initial settings. -------------------- Vit вечная память. Обсуждение действий администрации форума производятся только в этом форуме гениальность идеи состоит в том, что ее невозможно придумать |
|||
|
||||
| Deiv |
|
|||
|
Новичок Профиль Группа: Участник Сообщений: 43 Регистрация: 11.2.2006 Где: ЛаПаc-Боливия (Ю жная Америка) Репутация: нет Всего: нет |
Thanks, I solved it in the following way:
Only he stays to know about the bitmap of 32 bits ('Metals2.bmp'=32 bits) |
|||
|
||||
![]()
|
| Правила форума "Центр помощи" | |
|
|
ВНИМАНИЕ! Прежде чем создавать темы, или писать сообщения в данный раздел, ознакомьтесь, пожалуйста, с Правилами форума и конкретно этого раздела.
Более подробно с правилами данного раздела Вы можете ознакомится в этой теме. Если Вам помогли и атмосфера форума Вам понравилась, то заходите к нам чаще! С уважением, Poseidon, Rodman |
| 0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
| 0 Пользователей: | |
| « Предыдущая тема | Центр помощи | Следующая тема » |
|
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |