Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要通过 F# 访问 .png 文件的像素。
我可以通过它的方法将它加载到图像中FromFile,但我无法访问它的像素。我不知道如何将图像变成位图。我可以在哪里使用GetPixel方法?
FromFile
GetPixel
您可以将图像直接加载到 Bitmap 对象中:
let img = "C:\\MyImages\\MyImage.png" let bitmap = new System.Drawing.Bitmap(img)
从那里您可以在图像上使用位图的方法和属性。
您可以将 a 转换Image为Bitmapwith
Image
Bitmap
System.Drawing.Bitmap(loadedimage)
为什么在我的电脑上cout<<main;打印1?我以为它会打印main的地址。但是当我使用时,printf("%x",main);我会得到不同的输出。
cout<<main;
1
printf("%x",main);
编辑:
我尝试std::cout了其他功能。我得到1了每一个案
std::cout