notro / fbtft

Linux Framebuffer drivers for small TFT LCD display modules. Development has moved to https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/fbtft?h=staging-testing
1.86k stars 494 forks source link

I lowered my waveshare 3.5 screen resolution now i want to center the screen #368

Closed thechosenone98 closed 8 years ago

thechosenone98 commented 8 years ago

Part of my screen is not used (white), but that's the only way I can get a great deal of fps out of it. So I lowered the resolution by changing it after the init sequence in /etc/modules. The last thing I'm trying to do is to center the part of the screen im using so that it is in the middle of the screen (not starting in the top left corner of the screen) If someone could help me I'd really appreciate it :) I'm pretty sure the only required step is to fiddle with the init sequence but I don't know how it exactly work.

I looked at fbtft_core.c and i found variables called start_line and end_line. I looked at the code that uses them and it looks like I have to set them in the init sequence but i don't exactly know wich part of the init sequence to modify...

The pixel i want the image to start drawing on (assuming a grid like pattern of pixel with (0,0) at the top left of the screen) is (80, 40) and to end at (400, 280)(this is formatted as [x,y] where x is width and y height).

One last information, my normal screen resolution is 480x320 but i lowered it to 320x240. This is why I need to center the image. This was just to be sure I made clear what i wanted to do :)

notro commented 8 years ago

Closing old issues, reopen if needed.