reading data from image file
#1

Hi,
how can I read data from image file(jpeg, bmp or ico)? I need to get image size and pixel's color. For example image size is 200x200 and I need to get pixel's which is at x=50 and y=60 color.
Thanks .
Reply
#2

any one? I may need to use fread for this thing, but I don't know how.
Reply
#3

You can't use image files in SA:MP.
Reply
#4

I'm not talking about sa-mp, I'm talking about reading image's pixel's color in pawn. It doesn't matter, pawn or c++(without any libraries), they all have function to read file, like fread in pawn.
Let's say I have image file and I want to get pixel's which is at x=50, y=60(coords doesn't matter, it's just a example) color. Only get that pixel's color in variable, nothing else. Reading methods may be different in different image formats, but one example would be enough for me.
Reply
#5

I don't know if such library/include you're looking for exists for PAWN, anywhere...
But here's something ****** made back in '12, though it was for writing a simple BMP image,
but I guess you can reverse it for reading as well: http://pastebin.com/8A2kC10D

Though I'm not sure why would you want to go through all that much of effort when you can
simply define colours, etc.. and there are already image2textdraw converters...
Reply
#6

Thanks, but I'm not searching for library/include(like you said in first sentence). It's a great example for writing, but I'm not sure if I can easily reverse it for reading...
Reply
#7

I found on some websites, that bmp file reading is the easiest. Can someone make an example of reading it like I said above?
Reply
#8

https://www.******.co.uk/search?q=ho...ead+a+bmp+file
Reply
#9

I have checked almost all examples, they all are using classes and additional libraries, I don't know how to convert that code to pawn.
Reply
#10

Why would you even need this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)