ViJ2005 Posted August 19, 2005 Posted August 19, 2005 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 Quote
Leaders Iceplug Posted August 20, 2005 Leaders Posted August 20, 2005 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? Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
ThePentiumGuy Posted August 21, 2005 Posted August 21, 2005 He might have posted in the wrong section. But the 2048x2048 image jsut might be taking a long time to load (becuase it's a large image right). -The Pentium Guy Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
ViJ2005 Posted August 26, 2005 Author Posted August 26, 2005 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. Quote
Leaders Iceplug Posted August 27, 2005 Leaders Posted August 27, 2005 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? Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
ViJ2005 Posted August 29, 2005 Author Posted August 29, 2005 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? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.