Форум: "Основная";
Текущий архив: 2004.09.19;
Скачать: [xml.tar.bz2];
ВнизСложные формы Найти похожие ветки
← →
Stype © (2004-08-30 09:01) [0]Как создать форму со сложным контуром и с "дырками" посередине ?
← →
KADAN © (2004-08-30 09:11) [1]CreateВсякоРазныеRgn и CombineRgn особенно.
← →
BillyJeans (2004-08-30 09:29) [2]форма с дырками, это в second hand :)
← →
Ozone © (2004-08-30 09:39) [3]LOL
← →
Endi (2004-08-30 18:14) [4]Проще всего, посмотри стороние компоненты для создания форм с контурами по определенным картинкам.
← →
Rem (2004-08-30 18:24) [5][4]
Точно-точно! Нужны специальные компоненты! А лучше - готовые проекты! :))
А что, TForm.TransparentColor кто-то отменял?
← →
antonn © (2004-08-30 18:28) [6]Совсем недавно было, вроде...
function BitmapToRgn(Image: TBitmap): HRGN;
var
TmpRgn: HRGN;
x, y: integer;
ConsecutivePixels: integer;
CurrentPixel: TColor;
CreatedRgns: integer;
CurrentColor: TColor;
begin
CreatedRgns := 0;
Result := CreateRectRgn(0, 0, Image.Width, Image.Height);
inc(CreatedRgns);
if (Image.Width = 0) or (Image.Height = 0) then
exit;
for y := 0 to Image.Height - 1 do
begin
CurrentColor := Image.Canvas.Pixels[0,y];
ConsecutivePixels := 1;
for x := 0 to Image.Width - 1 do
begin
CurrentPixel := Image.Canvas.Pixels[x,y];
if CurrentColor = CurrentPixel then
inc(ConsecutivePixels)
else
begin
// ?????? ? ????? ????
if CurrentColor = clWhite then
begin
TmpRgn := CreateRectRgn(x-ConsecutivePixels, y, x, y+1);
CombineRgn(Result, Result, TmpRgn, RGN_DIFF);
inc(CreatedRgns);
DeleteObject(TmpRgn);
end;
CurrentColor := CurrentPixel;
ConsecutivePixels := 1;
end;
end;
if (CurrentColor = clWhite) and (ConsecutivePixels > 0) then
begin
TmpRgn := CreateRectRgn(x-ConsecutivePixels, y, x, y+1);
CombineRgn(Result, Result, TmpRgn, RGN_DIFF);
inc(CreatedRgns);
DeleteObject(TmpRgn);
end;
end;
end;
Применение: Суешь в image1 картинку, все белые места вырезаются.
вызов
SetWindowRgn(Handle,BitmapToRgn (image1.Picture.Bitmap) , true);
← →
Кирилл (2004-08-30 18:48) [7]а ещё можно так:
загружаешь в Image1 картинку и
Image1.Transparent := true;
Form1.BorderStyle := bsNone;
Form1.TransparentColorValue := GetSysColor(COLOR_BTNFACE);
Form1.TransparentColor := true;
Совсем просто!
Кроме того http://delphimaster.net/view/1-1093422967/
У меня недавно было
← →
Stype © (2004-08-31 13:22) [8]>Endi (30.08.04 18:14) [4]
Где посмотреть?
← →
antonn © (2004-08-31 16:18) [9]BUPack поищи.
← →
ALS © (2004-08-31 16:33) [10]>Где посмотреть?
http://web.ict.nsc.ru/~cancel/delphi/projects/getfile.php?i=44
← →
Stype © (2004-09-05 13:24) [11]Спасибо
← →
O?O (2004-09-06 09:00) [12]Jedi - бесплатная библиотека компонентов, там есть компонента для создания дырок на форме и компонента делающая форму по образцу рисунка
← →
O?O (2004-09-06 09:02) [13]Jedi - http://homepages.borland.com/jedi/jvcl/
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2004.09.19;
Скачать: [xml.tar.bz2];
Память: 0.48 MB
Время: 0.189 c