Хорошо, после некоторой тряски и еще одного исследования, вот общее решение (которое работает и для нормальных div'ов).
Div, содержащий текст (v-card-text, в приведенном выше примере) должен иметь «position: absolute;», родительский div (v-card, в приведенном выше примере) должен иметь «position: относительный; переполнение -y: auto; "
Это решение, как сказано выше, работает вполне обычно, даже если в некоторых случаях (например, когда все находится в V-вкладках), оно все равно не работает, по причине, все еще не ясной.
Вот кодовая ручка с макетом, работающим так, как задумано. https://codepen.io/anon/pen/gZVqBE?editors=1010
Это интересующие строки:
...
{{ lorem.slice(0, 90) }} {{lorem}} {{lorem}} {{lorem}} {{lorem}} {{lorem}}
...
И это весь код в авторучке
{{ lorem }}
{{ lorem }}
{{ lorem.slice(0, 70) }}
{{ lorem.slice(0, 40) }}
{{ lorem.slice(0, 90) }} {{lorem}} {{lorem}} {{lorem}} {{lorem}} {{lorem}}
{{ lorem.slice(0, 100) }}
Я нашел решение, которое работает над Vista, начинающей со ссылки, предоставленной OregonGhost. Это - базовый процесс в синтаксисе C#. Этот код находится в классе, наследовавшемся Форме. Это, кажется, не работает если в UserControl:
//this will allow you to import the necessary functions from the .dll
using System.Runtime.InteropServices;
//this imports the function used to extend the transparent window border.
[DllImport("dwmapi.dll")]
static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMargins);
//this is used to specify the boundaries of the transparent area
internal struct Margins {
public int Left, Right, Top, Bottom;
}
private Margins marg;
//Do this every time the form is resized. It causes the window to be made transparent.
marg.Left = 0;
marg.Top = 0;
marg.Right = this.Width;
marg.Bottom = this.Height;
DwmExtendFrameIntoClientArea(this.Handle, ref marg);
//This initializes the DirectX device. It needs to be done once.
//The alpha channel in the backbuffer is critical.
PresentParameters presentParameters = new PresentParameters();
presentParameters.Windowed = true;
presentParameters.SwapEffect = SwapEffect.Discard;
presentParameters.BackBufferFormat = Format.A8R8G8B8;
Device device = new Device(0, DeviceType.Hardware, this.Handle,
CreateFlags.HardwareVertexProcessing, presentParameters);
//the OnPaint functions maked the background transparent by drawing black on it.
//For whatever reason this results in transparency.
protected override void OnPaint(PaintEventArgs e) {
Graphics g = e.Graphics;
// black brush for Alpha transparency
SolidBrush blackBrush = new SolidBrush(Color.Black);
g.FillRectangle(blackBrush, 0, 0, Width, Height);
blackBrush.Dispose();
//call your DirectX rendering function here
}
//this is the dx rendering function. The Argb clearing function is important,
//as it makes the directx background transparent.
protected void dxrendering() {
device.Clear(ClearFlags.Target, Color.FromArgb(0, 0, 0, 0), 1.0f, 0);
device.BeginScene();
//draw stuff here.
device.EndScene();
device.Present();
}
Наконец, Форма с настройкой по умолчанию будет иметь гладкий взгляд частично прозрачным фоном. Установите FormBorderStyle ни на "один", и это будет на 100% прозрачно с только Вашим довольным плавание выше всего.
WPF является также другой опцией.
Разработанный Microsoft, Windows Presentation Foundation (или WPF) является программным обеспечением графическая подсистема для рендеринга пользовательских интерфейсов в приложениях на базе Windows.
Я предполагаю, что это будет твердо, не используя Настольный Менеджер окон, т.е. если Вы хотите поддерживать Windows XP. С DWM это, кажется, довольно легко все же.
Если скорость не является проблемой, можно сойти с рук рендеринг на поверхность и затем копирование представленного изображения к многоуровневому окну. Не ожидайте, что это будет быстро все же.