25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

bezier.c 891 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include "config.h"
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <pipi.h>
  6. int main(int argc, char *argv[])
  7. {
  8. char *srcname = NULL, *dstname = NULL;
  9. pipi_image_t *img, *newimg;
  10. int ret = 0;
  11. if(argc < 2)
  12. {
  13. fprintf(stderr, "%s: too few arguments\n", argv[0]);
  14. fprintf(stderr, "Usage: %s <src> <dest>\n", argv[0]);
  15. return EXIT_FAILURE;
  16. }
  17. srcname = argv[1];
  18. dstname = argv[2];
  19. img = pipi_load(srcname);
  20. if(!img) {
  21. fprintf(stderr, "Can't open %s for reading\n", srcname);
  22. return -1;
  23. }
  24. newimg = pipi_copy(img);
  25. pipi_free(img);
  26. int w = pipi_get_image_width(newimg);
  27. int h = pipi_get_image_height(newimg);
  28. pipi_draw_bezier4(newimg , 1, 1, w-1, 1, w-1, h-1, 1, h-1 , 0x00FF0000, 20, 1);
  29. pipi_save(newimg, dstname);
  30. pipi_free(newimg);
  31. return ret;
  32. }