Jump to content

Issue with drawimage


jamesmintram
 Share

Recommended Posts

Hi Everyone,

 

Me again!

 

I am having an issue with drawing images to the screen, it appears the coordinates gradually deviate the further away from the top left you try and draw things.

 

I have a piece of code which does this:

 

for ( int t = 0; t < winHeight + texHeight; t+=texHeight )

{

context->SetTranslation(0, 0);

context->SetScale(1, 1);

context->SetRotation(0);

context->DrawImage(m_BlockTex, 0, t);

}

 

winHeight is 768 and texHeight is 64

 

Therefore 12 images should be drawn and fit on the screen vertically. However, as you can see from the attached image this is not the case.

 

Leadwerks_Drawimage.png

 

Anyone know what might be going on?

 

Regards,

James

Link to comment
Share on other sites

i would have to agree with shadmar. i've noticed in a few libraries that when measuring window height, that measurement also includes the status bar at the bottom of the window, and the window bar at the top of the window. this bar contains the programs name, and the minimize, maximize, and close buttons. i'm not sure if it also includes the few pixels on the sides of the windows (the resize frame).

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...