DrawImage(img, pts)

Sorry if this is the wrong place for this question but it it related to 3D games programming...

I have noticed that Graphics.DrawImage(img, pts) accepts an array of 3 Point objects in the second argument.  In the spirit of adventure I passed in an array of 4 to see what would happen (I was hoping it would render an image inside an uneven quad).  It did not work but it did throw an exception indicating tht this functionality had not yet been implemented.

Does this mean that in future releases of the framework, the Graphics object will have the ability to render images stretched to fit a quad

Cheers

Wossy






Answer this question

DrawImage(img, pts)

  • TravisGaffney

    There have been no announced plans on improvements to the DrawImage method.  In the future, you should consider using the Windows Presentation Framework for simple graphics that have been traditionally solved using GDI/GDI+.

  • TomaszJ

    The Graphics class will already stretch an image:



    Dim gr As Graphics = Me.CreateGraphics

    Dim img As Bitmap = Image.FromFile(Application.StartupPath & "\test.jpg")

    gr.DrawImage(img, New Rectangle(0, 0, 256, 256))


     

    Plug any numbers you want in there and it'll stretch or shrink the image as necessary.

  • dgrigsby

    Hi,

    I have the same problem. Have you resolve it

    Thanks,


  • Michael J Brown

    Yeah I resolved it by forgetting about GDI+ altogether and writing my own blitter.  Getting huge speeds now with much improved texture quality.  Unsafe code is so much faster than GDI+.

    Check this thread out.  (skip to the last few pages)...
    http://www.vbforums.com/showthread.php t=352207


  • BPM

    Yeah I know that.  That is just a plain rectangle, a quad is something like this...

    http://www.vbforums.com/attachment.php attachmentid=40586&stc=1

    That screeny was generated by my own code but its not fast enough and it leaves occasional pixel artifacts.  The number in the titlebar is the framerate.  Far too slow.

    We are not allowed to use ANY hardware accelaration for this, nothing at all.


  • DrawImage(img, pts)