May 25, 2022, 04:53:04 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Simple Image fault - simple solution.

Started by GWS, July 05, 2020, 10:39:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

July 05, 2020, 10:39:17 AM Last Edit: July 06, 2020, 01:43:49 AM by GWS
Hi,

I'm working on a small graphics program which uses a jpeg background image.

I could not understand why a vertical white line was showing on the left hand side of the DX window when the image was displayed ???   

Initially I suspected my program was not displaying the standard 1024x768 jpeg correctly.

I tried other jpegs of the same size and there was no white line.

The solution eventually turned out to be simple.

I had cut the image from a larger image and inadvertently included a small amount of the original left hand border.

Easy solution, was to crop another small amount from the left side, and expand the image back to 1024x768 ..

All working well now .. :)

Graham

 
Tomorrow may be too late ..

aurelCB

forum for hobby programming:<br />https://aurelsoft.ucoz.com

GWS

Hi Aurel, :)

Not easy to do when using Direct X ..

' load background image ...
if dxnewmap(w,getstartpath + "image.jpg",wW,wH,1) = 0
messagebox w, "Could not load the background image","Error"
run = 0
endif

' create a blank map filled with tile#0 ...
dxcreatemap w,1,1,0
dxdrawmap w

Just cutting a bit off the left hand side seemed the best solution. :)

All the best,

Graham
______________________________________

Note: I just noticed the Forum will not display a plus sign between getstartpath and the file name.  That's not good. ???
Tomorrow may be too late ..