小编Raf*_*afe的帖子

使用PHP查找JPEG分辨率

打电话给所有PHP大师!

我知道您可以使用getimagesize()来获取PHP中图像的实际像素高度和宽度.但是,如果您在Photoshop中打开图像并查看图像大小对话框,您会注意到有一个分辨率值决定了图像的打印尺寸.

给定一个任意的jpg图像文件,我需要使用PHP来确定这个分辨率.看来这个信息存储在某个地方的jpg文件中,所以我该怎么做呢?

另一个要求 - 我只有gdlib可供我使用.我需要在不使用其他php库的情况下执行此操作(imagemagick等)

谢谢您的帮助!

php image-processing gdlib

4
推荐指数
2
解决办法
7915
查看次数

在.Net中将带有笔划的文本绘制到图像上

我目前正在使用.Net中的System.Drawing.Graphics.DrawString()方法在图像上绘制文本,然后将其保存到新文件:

// define image file paths
string sourceImagePath = HttpContext.Current.Server.MapPath("~/img/sourceImage.jpg");
string destinationImagePath = HttpContext.Current.Server.MapPath("~/img/") + "finalImage.jpg";

// create new graphic to draw to
Bitmap bm = new Bitmap(200, 200);
Graphics gr = Graphics.FromImage(bm);

// open and draw image into new graphic
System.Drawing.Image sourceImage = System.Drawing.Image.FromFile(sourceImagePath, true);
gr.DrawImage(sourceImage, 0, 0);
sourceImage.Dispose();

// write "my text" on center of image
gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;

PrivateFontCollection fontCollection = new PrivateFontCollection();
fontCollection.AddFontFile(HttpContext.Current.Server.MapPath("~/fonts/HelveticaNeueLTStd-BlkCn.ttf"));
// prototype (1)
gr.DrawString("my text", …
Run Code Online (Sandbox Code Playgroud)

.net graphics text gdi

2
推荐指数
1
解决办法
3525
查看次数

windows api - 检测何时打开某种类型的文件

是否可以在打开某种类型的文件时执行某些代码?就我而言,我想“监听”视频文件(“.avi、mp4 等”)打开的时间(通过 Windows 文件资源管理器 shell,或者直接从视频播放器?),以便我可以存储播放视频的历史记录。

一个小时的谷歌搜索没有结果,所以我向你求助 stackoverflow。请指出我正确的方向。

谢谢。

windows winapi windows-shell

2
推荐指数
1
解决办法
2284
查看次数

使用母版页时如何从代码隐藏修改 <html> dom 元素

假设我有一个<html>定义了我的元素的母版页。然后我有一个使用所述母版页的 default.aspx 页面。如何<html>从default.aspx后面的代码修改标签?特别是,我想更改其属性“data-custom”的值,以便它呈现为<html data-custom="my dynamic value">.

asp.net webforms

2
推荐指数
1
解决办法
6345
查看次数