PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/bitmap_factory_test.c

http://ftk.googlecode.com/
C | 28 lines | 24 code | 4 blank | 0 comment | 2 complexity | ac2498c8d4e622e3cc4e41a9f084e121 MD5 | raw file
 1#include "ftk.h"
 2#include "ftk_bitmap_factory.h"
 3#include "ftk_image_jpeg_decoder.h"
 4#include "ftk_image_png_decoder.h"
 5
 6int main(int argc, char* argv[])
 7{
 8	const char* filename = argv[1];
 9	ftk_init(argc, argv);
10
11	FtkBitmapFactory* thiz = ftk_bitmap_factory_create();
12	FtkDisplay* display = ftk_default_display();
13
14	if(display != NULL)
15	{
16		FtkRect rect = {0};
17		FtkBitmap* bitmap = ftk_bitmap_factory_load(thiz, filename); 
18		rect.width = ftk_bitmap_width(bitmap);
19		rect.height = ftk_bitmap_height(bitmap);
20		ftk_display_update(display, bitmap, &rect, 0, 50);
21		printf("width=%d height=%d\n", ftk_display_width(display), ftk_display_height(display));
22		ftk_bitmap_unref(bitmap);
23	}
24	ftk_bitmap_factory_destroy(thiz);
25	ftk_run();
26
27	return 0;
28}