GPWiki.org
GPWiki.org
It is currently Wed May 22, 2013 1:45 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Aug 03, 2011 7:56 pm 
Hi
I am making RPGMaker thingy, and it uses GDI+ which isn't good way for getting good FPS...
I need to rewrite GDI+ in my app to directdraw, but i dont know how to start...

I need ONLY to know how to copy 32x32 part of image1 and paste it to X, Y in image2

Like on this GDI+ script:

Code:
Dim Target As New Bitmap(Map.Width, Map.Height)
        Dim Graphics As Graphics = Graphics.FromImage(Target)
        Dim Source1 As New Bitmap(Tileset.Image)
        Dim Source2 As New Bitmap(Map.Image)
        Dim Copy As New Rectangle(16, 16, 16, 16)
        Dim Paste As New Rectangle(0, 0, 16, 16)
        Dim Punkt As New PointF(0, 0)
        Paste = New Rectangle(X * 16 - 16, Y * 16 - 16, 16, 16)
        Graphics.DrawImage(Source2, Punkt)
        Graphics.DrawImage(Source1, Paste, Copy, GraphicsUnit.Pixel)
        With Copy
            .X = (TextureX - 1) * 16
            .Y = (TextureY - 1) * 16
            .Width = 16
            .Height = 16
        End With
        With Paste
            .X = X * 16 - 16
            .Y = Y * 16 - 16
            .Width = 16
            .Height = 16
        End With
        Graphics.DrawImage(Source1, Paste, Copy, GraphicsUnit.Pixel)
        Map.Image = Target


Thanks for your time! :)

BTW: I love your Anti-Spam thingy :D


Top
  
 
PostPosted: Thu Aug 04, 2011 5:30 am 
Rookie

Joined: Wed Aug 03, 2011 8:17 pm
Posts: 1
Nevermind! Just found solution!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group