I am trying to compare 2 images by storing a hash of one and then comparing against the produced hash of another (SHA1). I’m having problems with getting image data. Whatever I try (and I seem to be going by the docs), I get an error message:
You’ll need to use the classic API for this project. API 2.0 is not available in older IDEs or the Web framework, but that’s all that’s available with the online documentation.
Edit: You updated which IDE version you’re using, so I think this is a result of using the Web framework
Do you have something in your project that conflicts with the naming? Why are you trying to cast the enumerations when passing them? What happens if you base the line off the docs line .ToData(Picture.Formats.JPEG, Picture.QualityHigh) ?
Update:
Answered the second two questions by staring at your screenshot.
The first syntax-error thing is because you don’t use enumerations anything close to like that. The “no member named formats” line is how the function is supposed to work. If it’s a desktop project, I’d suspect a naming conflict next.
The quality parameter is supposed to be optional, and since it looks like your working with PNG try removing the parameter just to see if this might be an API 2.0 glitch.
Formats not a member of Picture
Int32 has no member named JPEG
Parameter “format” expects enum Picture.Formats, but this is type Int32
Type mismatch error. Expected class MemoryBlock, but got Int32
I would look for a naming conflict because it seems like something in your project (or plugins?) is defining “Picture”
I fired up 2019 R3.1 because I’m quite curious, and had no issues
As a test, this should compile:
dim tp as new Picture(32, 32)
dim tmb as MemoryBlock = tp.ToData(Picture.Formats.PNG)
Ok thanks Tim - I’ll have a look. In this instance all I did was open an example project (Desktop -> Container Controls -> Download) and make some minor mods to it.