UPDATE: Upon reading the documentation over and over, I noticed that I had missed this previously:
"Note that the function currently only works with Memory Devices with 32-bpp color
depth and a system color depth of 32 bpp."
Now I feel like an idiot!!!
The question remains; How do I scale down the Yresolution from 360 to 238!
In order to print the ticket drawn, currently I declare a memdev handle as such;
due to some supply issues, I have to change the printer and the new printer is 67dpi, so printing the above buffer results in a stretched image in the Y direction! Using scaling factor of 101dpi/67dpi = 1.5, I came up with new Y resolution to be 238.
I tried to use the following to fix it, but it's not working.
Display All
By the way, I also tried the GUI_MEMDEV_WriteExAt since I can scale the y values, but it has an alpha component and that also didn't work.
The only thing that worked was writing a down-sampling algorithm that reduced the y pixels, but that added some delay.
Cheers,
Simon
"Note that the function currently only works with Memory Devices with 32-bpp color
depth and a system color depth of 32 bpp."
Now I feel like an idiot!!!
The question remains; How do I scale down the Yresolution from 360 to 238!
In order to print the ticket drawn, currently I declare a memdev handle as such;
I tried to use the following to fix it, but it's not working.
Source Code
- GUI_MEMDEV_Handle m_memhandle= GUI_MEMDEV_CreateFixed(0, 0, 224, 360, 0, GUI_MEMDEV_APILIST_1, GUI_COLOR_CONV_1);
- GUI_MEMDEV_Handle m_memhandleDst = GUI_MEMDEV_CreateFixed(0, 0, 224, 238, 0, GUI_MEMDEV_APILIST_1, GUI_COLOR_CONV_1);
- GUI_MEMDEV_Select(m_memhandle);
- draw_stuff();
- GUI_MEMDEV_Select(m_memhandleDst);
- // x and y = 0
- // h0 and h1 = 238 (New Y edge)
- // dx = 224 (width didn't change)
- // dy = 0
- GUI_MEMDEV_DrawPerspectiveX(m_memhandle, 0, 0, 238, 238, 224, 0);
- buffer = (U8 * )GUI_MEMDEV_GetDataPtr(m_memhandleDst);
- // this prints rubbish
- print_buffer();
The only thing that worked was writing a down-sampling algorithm that reduced the y pixels, but that added some delay.
Cheers,
Simon
The post was edited 2 times, last by sayo9394: added more info about GUI_MEMDEV_WriteExAt and downsampling ().