問題タブ [nsimage]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
objective-c - NSImage の色空間を変更する
NSimage または NSBitmapImageRep/CGimage などの色空間を変更する方法はありますか。私はどんな方法にもオープンです。できればPhotoshopの方法で。
cocoa - NSImageのピクセルデータに入る
白黒画像で動作するアプリケーションを書いています。私は NSImage オブジェクトをメソッドに渡し、NSImage から NSBitmapImageRep を作成しています。すべて動作しますが、かなり遅いです。これが私のコードです:
だから私はCIImageを使用しようとしましたが、(x、y)座標で各ピクセルに入る方法がわかりません。それは本当に重要です。
objective-c - 特定の NSRect の周りの NSImage のクリッピング
内部にさまざまな画像を含む NSImage があります。その中の画像の位置は常に同じであるため、四角形が画像の中にある位置でサブイメージを取得するには、四角形を指定する必要があります。これはどのように行うことができますか?
objective-c - IKImageView choppy?
I have an IKImageView, and I'm putting CGImages (That I make out of NSImages) onto it. However, a normal 200DPI 8.5/11 page takes like 3 seconds to come up, appearing in rectangles about 2inches (screen) on a side at a time. This is really annoying. Is there a way around this?
Alternatively, is there a way to double buffer the view? To have 2 IKImageViews and draw into one, and then display it?
ETA: doubling my scrollviews (with ikimageviews inside) and then drawing into them, and then unhiding them, doesn't seem to help... or, maybe it helps a little, but not much
I did a little poking around with instruments, and found that a lot of work seems to be being done in memcopy:
I'm not sure what that tells me though...
EDIT: For the record, the problem is NOT data size. I have an old version of the program, that uses deprecated quickdraw method calls. When I zoom the image up to 300%, so that one screen pixel = one image pixel, so it needs to be using the whole image, it STILL zips right along page after page.
I'm being ridiculed by the guy who wrote this originally, because his version moves faster on his ancient 10.3 G5 than it does on my up-to-date Intel box. faster by at least a factor of 10.
objective-c - ビットマップデータから NSImage を作成する
わかりました、私が作成した画像で pixelWidth が正しくない PDFDocument を作成しているようです。質問は次のようになります。画像に正しい解像度を取得するにはどうすればよいですか?
スキャナーからのビットマップ データから始めます。私はこれをやっています:
インチまたはポイント単位の実際の幅/高さ、またはこの時点で知っている実際の解像度を含める場所はどこにもないようです...どうすればよいですか?
objective-c - NSImage -> PDFPage -> NSImage 解像度を維持するにはどうすればよいですか?
PDFPagesとして、PDFDocumentに保持しているNSImagesがたくさんあります。初めて NSImage を挿入するとき、NSImage のサイズはポイント (72 dpi) で、(唯一の) NSImageRep のサイズはピクセル (200 dpi) です。
ただし、PDFPage から取得した NSImage は、イメージとイメージレップの両方で 72 dpi です。
NSImage に戻ったときに解像度を回復するにはどうすればよいですか?
macos - NSImageおよび関連するAPIがメモリリークしている
以下は私が持っているコードスニペットです:
image = [mCapture getCurrentFrameImage];
自動リリースされたを返していることに注意してくださいNSImage
。私はオブジェクトをリリースしていて、それもNSAutoreleasePool
配置しています。ただし、このコードスニペットが実行されるたびに、約3〜4MBのメモリがリークしています。どこに間違いがあるのかわかりません。
objective-c - nsimage を「グリーン スクリーン」として使用する
フォトブースのように、背景を切り取ってグリーン スクリーンとして使用することはできますか?
objective-c - NSImage を作成できませんか?
私がするときはいつでも:
xxxは読み込まれますが、幅と高さは 0 のままです。NSImageCell に読み込もうとすると、次のエラーが発生します。
NSImageCell のオブジェクト値は NSImage でなければなりません。
誰かが私を助けることができますか?私はこれまでこの問題を抱えたことはありません。
編集:申し訳ありませんが、私はこのビットを見逃していました. そのため、データ ソース デリゲートで実行すると機能せず、' return cell; ' の後に上記のエラーが表示されます。'。
編集2:これは悪化しています。何が起こったのかわかりませんが、画像は高さと幅を適切にロードしますが、NSImageCell に追加するとまだ文句を言います。
objective-c - NSImage 操作を使用してクロップ効果を作成する
画像を表示する NSView があり、このビューをトリミング画像効果のように動作させたいと考えています。次に、3つの長方形(imageRect
、secRect
およびIntersectRect
)を作成しimageRect
ます。これは、画像を表示する四角形であり、secRect
全体を暗くするだけの四角形であり、四角形を観察するような四角形です。私がやりたいことは、「穴」を作るようなものです"上に直接(暗くせずに)見えるようにします。これが私の drawRect メソッドです:imageRect
intersectRect
secRect
imageRect
マウスのクリックに基づいて長方形を描画する独自のクラス(myDrawRect)がある[self bounds]
ため、コマンドを無視してくださいbeginDrawing
。
どんな助けでも大丈夫です、ありがとう。へビアン。