Click here to Skip to main content
16,006,452 members
Home / Discussions / C#
   

C#

 
GeneralSet a node in a Treeview to bold Pin
Gian19-Apr-04 22:41
Gian19-Apr-04 22:41 
GeneralRe: Set a node in a Treeview to bold Pin
Baris Kurtlutepe20-Apr-04 3:07
Baris Kurtlutepe20-Apr-04 3:07 
GeneralRe: Set a node in a Treeview to bold Pin
Heath Stewart20-Apr-04 4:21
protectorHeath Stewart20-Apr-04 4:21 
GeneralRe: Set a node in a Treeview to bold Pin
Gian20-Apr-04 5:40
Gian20-Apr-04 5:40 
Generalerror with tab page Pin
robmays19-Apr-04 22:14
robmays19-Apr-04 22:14 
GeneralRe: error with tab page(Heath) Pin
robmays19-Apr-04 22:31
robmays19-Apr-04 22:31 
GeneralRe: error with tab page Pin
Heath Stewart20-Apr-04 4:34
protectorHeath Stewart20-Apr-04 4:34 
GeneralA managed DirectDraw / DirectX question Pin
yoaz19-Apr-04 21:32
yoaz19-Apr-04 21:32 
I've been porting code to C# while using Managed DirectX 9.0b. To access memory surfaces directly i used the Surface.Lock() method, which should return an Array, but returns a byte[,]. Annoyingly, the size of this array is the size of the surface in pixels, not in bytes. E.g. working with a 100X100 pixels surface with 16bits per pixel, the method returns a byte[100,100] (half the size). Using the array position as a pointer, and navigating it manualy using SurfaceDescription.Pitch didn't help either. If you had the patience to read this, read the code:
<br />
int stride = back.SurfaceDescription.Pitch;<br />
byte[,] barr = back.Lock  (Microsoft.DirectX.DirectDraw.LockFlags.SurfaceMemoryPointer );<br />
unsafe<br />
{<br />
  fixed (byte* pbdata = barr)<br />
  {<br />
    for (int j=0; j<100; j++)<br />
    {<br />
	for (int i=0; i<100; i++)<br />
	{<br />
	  *(pbdata+j*stride+2*i+1) = 0xF8;<br />
	}<br />
    }<br />
  }<br />
}<br />
back.Unlock(barr);<br />


this should paint my surface red, but it only paints half of it red.
What am I doing wrong?
GeneralRe: A managed DirectDraw / DirectX question Pin
Jeremy Kimball20-Apr-04 6:42
Jeremy Kimball20-Apr-04 6:42 
GeneralRe: A managed DirectDraw / DirectX question Pin
yoaz20-Apr-04 8:15
yoaz20-Apr-04 8:15 
Questioncan i get a 256 colors bitmap from DC directly ? Pin
fu019-Apr-04 21:04
fu019-Apr-04 21:04 
AnswerRe: can i get a 256 colors bitmap from DC directly ? Pin
Heath Stewart20-Apr-04 4:47
protectorHeath Stewart20-Apr-04 4:47 
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
yoaz20-Apr-04 21:24
yoaz20-Apr-04 21:24 
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
Heath Stewart21-Apr-04 3:09
protectorHeath Stewart21-Apr-04 3:09 
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
yoaz21-Apr-04 5:26
yoaz21-Apr-04 5:26 
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
fu024-Apr-04 15:38
fu024-Apr-04 15:38 
Generalhelp convert a line of code Pin
User 96257819-Apr-04 19:41
User 96257819-Apr-04 19:41 
GeneralRe: help convert a line of code Pin
Mazdak19-Apr-04 19:54
Mazdak19-Apr-04 19:54 
GeneralRe: help convert a line of code Pin
Roman Rodov20-Apr-04 2:54
Roman Rodov20-Apr-04 2:54 
GeneralRe: help convert a line of code Pin
User 96257820-Apr-04 9:53
User 96257820-Apr-04 9:53 
GeneralRe: help convert a line of code Pin
Roman Rodov20-Apr-04 14:52
Roman Rodov20-Apr-04 14:52 
GeneralRe: help convert a line of code Pin
User 96257820-Apr-04 15:38
User 96257820-Apr-04 15:38 
GeneralWebconfig question Pin
dabuskol19-Apr-04 19:17
dabuskol19-Apr-04 19:17 
GeneralRe: Webconfig question Pin
Mazdak19-Apr-04 19:57
Mazdak19-Apr-04 19:57 
GeneralRe: Webconfig question Pin
dabuskol19-Apr-04 21:40
dabuskol19-Apr-04 21:40 

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.