Drawing Large Images on Surface

ViJ2005

Newcomer
Joined
Aug 19, 2005
Messages
3
Hi,

I am trying to draw a large image(2048x2048) on a surface using Graphics.DrawImage.
The problem that I am having is that there is no image shown on the surface.
But if I reduce the image size to 1024x1024 the image is drawn.

can anyone help me find a solution for this without changing the image size?

Thanks
 
Wait... you are drawing to DirectX surfaces with Graphics.DrawImage?
Or did you post in the wrong section?

What kind of surface are you drawing to? Have you tried drawing only part of it?
 
hi,
sorry for the delay. I have created a single surface on which I have to keep on drawing images. So I am using the Graphics object to do so by obtaining the DC of the surface. Is there any other way to draw the image without creating a new surface for every new bitmap.
 
Yes... you should be able to draw a background color over the whole surface and then draw your character.
But is this DirectX or not? If not, what is the 'surface' that you are talking about.
If so, why are you using GDI+ Graphics on the surface?

And why do you need to create a new surface for every new bitmap? Are those bitmaps loaded directly onto the surface from file or being drawn onto the surface?
 
Hi,

I am trying to draw a new bitmap on a DirectDraw Surface every few seconds.
I could only find in the constructor of the Surface an option to change the bitmap. So instead of creating a new surface for every new bitmap I followed this code

IntPtr hDC = surface.GetDc();
Graphics g = Graphics.FromHdc(hDC);
g.DrawImage(bitmap, 0, 0);
g.Dispose();
surface.ReleaseDc(hDC);

Any other better way to do this?
 
Back
Top