Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: Closing File Stream Pin
mav.northwind15-Mar-05 20:42
mav.northwind15-Mar-05 20:42 
GeneralRe: Closing File Stream ... close calls dispose Pin
Pushkar Pathak15-Mar-05 20:56
Pushkar Pathak15-Mar-05 20:56 
GeneralRe: Closing File Stream ... close calls dispose Pin
S. Senthil Kumar16-Mar-05 18:11
S. Senthil Kumar16-Mar-05 18:11 
GeneralVS 's Installer Pin
zecodela15-Mar-05 15:21
zecodela15-Mar-05 15:21 
GeneralRe: VS 's Installer Pin
Dave Kreskowiak16-Mar-05 14:37
mveDave Kreskowiak16-Mar-05 14:37 
GeneralGDI GradientFill Pin
Mathew Hall15-Mar-05 14:33
Mathew Hall15-Mar-05 14:33 
GeneralRe: GDI GradientFill Pin
Christian Graus15-Mar-05 14:52
protectorChristian Graus15-Mar-05 14:52 
GeneralRe: GDI GradientFill Pin
Mathew Hall15-Mar-05 17:10
Mathew Hall15-Mar-05 17:10 
why?

why not? Smile | :) (For my article XPExplorerBar[^] I'm doing animation with transparency which can be quite slow using GDI+. Thought I might try the same thing with GDI since it is hardware accelerated to see if I can get a decent performance boost)

Do you mean you can't call it, or it does nothing?

It doesn't do anything, yet GradientFill returns that it was successful. This is what I have so far:

[DllImport("Msimg32.dll", CharSet=CharSet.Auto, SetLastError=true)]<br />
public static extern bool GradientFill(IntPtr hdc, TRIVERTEX[] pVertex, int dwNumVertex, ref GRADIENT_RECT pMesh, int dwNumMesh, int dwMode);<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public struct TRIVERTEX <br />
{<br />
public long x;<br />
public long y;<br />
public ushort Red;<br />
public ushort Green;<br />
public ushort Blue;<br />
public ushort Alpha;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public struct GRADIENT_RECT <br />
{<br />
public ulong UpperLeft;<br />
public ulong LowerRight;<br />
}<br />
<br />
public bool FillRectangle(IntPtr hdc, Color startColor, Color endColor, int x, int y, int width, int height)<br />
{<br />
TRIVERTEX[] vert = new TRIVERTEX[2];<br />
GRADIENT_RECT rect = new GRADIENT_RECT();<br />
<br />
vert[0].x = x;<br />
vert[0].y = y;<br />
vert[0].Red = (ushort) (startColor.R << 8);<br />
vert[0].Green = (ushort) (startColor.G << 8);<br />
vert[0].Blue = (ushort) (startColor.B << 8);<br />
vert[0].Alpha = 0;<br />
<br />
vert[1].x = x + width;<br />
vert[1].y = y + height;<br />
vert[1].Red = (ushort) (endColor.R << 8);<br />
vert[1].Green = (ushort) (endColor.G << 8);<br />
vert[1].Blue = (ushort) (endColor.B << 8);<br />
vert[1].Alpha = 0;<br />
<br />
rect.UpperLeft = 0;<br />
rect.LowerRight = 1;<br />
<br />
return GradientFill(hdc, vert, 2, ref rect, 1, 0);<br />
}


"I think I speak on behalf of everyone here when I say huh?" - Buffy
Generali want to know something Pin
snouto15-Mar-05 12:32
snouto15-Mar-05 12:32 
GeneralRe: i want to know something Pin
Christian Graus15-Mar-05 12:57
protectorChristian Graus15-Mar-05 12:57 
GeneralUsing the update command of the datagrid to alter the data in a dataset Pin
Anonymous15-Mar-05 12:18
Anonymous15-Mar-05 12:18 
GeneralReceiving SMS problem Pin
ccui15-Mar-05 10:18
ccui15-Mar-05 10:18 
GeneralDataGrid TableStyles Pin
dennista15-Mar-05 9:03
dennista15-Mar-05 9:03 
GeneralRe: DataGrid TableStyles Pin
Kodanda Pani15-Mar-05 18:06
Kodanda Pani15-Mar-05 18:06 
GeneralRe: DataGrid TableStyles Pin
dennista16-Mar-05 3:31
dennista16-Mar-05 3:31 
GeneralFile IO in Webservice gives Error Pin
James Poulose15-Mar-05 8:21
James Poulose15-Mar-05 8:21 
GeneralRe: File IO in Webservice gives Error Pin
TylerBrinks15-Mar-05 9:46
TylerBrinks15-Mar-05 9:46 
QuestionHow to create a shallow copy of List&lt;T&gt; ? Pin
Andres Coder15-Mar-05 7:50
Andres Coder15-Mar-05 7:50 
AnswerRe: How to create a shallow copy of List&lt;T&gt; ? Pin
leppie15-Mar-05 8:51
leppie15-Mar-05 8:51 
GeneralSending a web form as parameter Pin
see0715-Mar-05 7:45
see0715-Mar-05 7:45 
GeneralRe: Sending a web form as parameter Pin
Pushkar Pathak15-Mar-05 18:16
Pushkar Pathak15-Mar-05 18:16 
GeneralRe: Sending a web form as parameter Pin
see0716-Mar-05 11:59
see0716-Mar-05 11:59 
GeneralRe: Sending a web form as parameter Pin
see0722-Mar-05 7:00
see0722-Mar-05 7:00 
GeneralRe: Sending a web form as parameter Pin
see0722-Mar-05 12:20
see0722-Mar-05 12:20 
GeneralSystem.Timers problem Pin
sjhart15-Mar-05 7:17
sjhart15-Mar-05 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.