AutoCAD .NET :: Reading Attached Image Directly From Memory Using API?
Nov 30, 2013
I have a large JPEG image (10000*11000px), attached to an Autocad drawing, that I want to crop multiple times. I cannot load it into memory using .Net, I get an out of memory exception. the only thing I think I can do is read it directly from Autocad. To do that, there is a method of the "RasterImageDef" class called "OpenImage" witch returns an IntPtr to the image. I tried to create a Bitmap object from the IntPtr and the save it to disk. I get no errors but the saved image is black. here' the code :
public static void IntPtrTest(){ Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; ObjectId imageDict = RasterImageDef.GetImageDictionary(db);
We are using Inventor 2012 and would like to read Solidworks 2012 files directly into the system. This can be done with Solidworks 2011 files but our vendor upgraded his software between the time he sent us test files to try the import and now. Can you tell me if the is a plug in or something that will allow us to read SW 2012 files or should we upgrade to Inventor 2013?
I have unchecked the box for "Show import dialogue when memory card is attached" in LR 4 and checked it in LR 5, but LR 4 is still opending every time when I insert a card in my card reader.
I am trying to clean up our drawing database and have run across several drawings that are showing external file references with a status of 'unreferenced'. During a scan early last week of all current revisions of our drawings (about 120000) we uncovered about 7500 drawings that don't quite cut the mustard as it pertains to the use of attachments. I have written a small .NET app that scans through my drawings, but I am having difficulty with one aspect of my probing.
I need to be able to open up an AutoCAD drawing, navigate to said drawings image dictionary, get a RasterImageDef from that dictionary, and then check to see what the 'status' of that drawing is. By 'status' I mean the status as reported in the External References dialog that appears when using the command 'xref'. In particular, I want to write out/show a message when I encounter a drawing with an attachment that has a status of 'Unreferenced', which I take to mean that the drawing was attached at one point, has been unloaded, but not properly detached.
My problem is that I can't seem to get to any property that shows that status. I have used ARXDBG to snoop the database and I can verify that I see the images still in the image dictionary, but not in the drawing itself. I also can't seem to get at thte status of the attachment. To compund the matter, everytime I try to inspect the RasterImageDef object I get, AutoCAD locks up and bombs out.
I am guessing I could get at what I need via C++/ObjectARX but I don't want to go that route if I dont have to. I have attached a snippet of the code I am currently using to scan through my drawings, not perfect or even pretty, but it works.
I'm experiencing a strange behavior when i import a DXF with a plugin for AutoCAD 2012, but only when i'm on Win7 64bits.
The plugin normally (in WinXP) would load the .dxf file, then if it has a reference for an ortophoto picture, it places the picture on the right place and "visible" (you'll get what i mean by this later).
On the other hand, on win7 64bits when i import the dxf file using the plugin, it only shows the frame of the picture, but no picture inside!
cadgis_1
But, if i close the file i just opened and open the .dxf using Autocad "default" open, on the layout the picture is showing just like it was supposed to...
Autocad_layout
So, now i've opened the .dxf using Autocad, let's try again to open it using the plugin and.... voilá! The picture is displayed, bright and shinny! A miracle i must say!
cadgis_2
And if i open it again using the "default" open from Autocad, not only it displays the picture on Layout but also on the Model!
Autocad_Model
I'll attach the dxf with the external .tiff file.
DXF File
Tiff File
I wasn't able to upload the picture, so i've placed in a zip file and attached it to the post.
I've got a issue with working with images. I draw furniture full scale and sometimes it necessary to hard draw and scan the drawing and then attached the image in autocad and trace over the image in AutoCAD 2013. everything is fine until I attach the image, then it freezes with every move that I try to make. The images are around 700 kbs in size. Is there anything I can do or change some kind of setting?? btw. version 2004 doesn't have this problem.
I'm running windows 7 pro Dell XPS M1710 4 gb memory
attach an image and hide it, but when the user take the mouse over the hidden image, he/she can see it, for example I want to send a daily report to my manager and I want to attach some Image in the drawing and hide it, But it can be seen by moseovering.
I am looking for a way of integrating an image, actually a logo jpeg directly into the dwg instead of an image reference and each time having to have the logo.jpeg in the same directly and reloading the image.
I am trying to write a LISP that does the following:
-Open drawing
-Saveas as NEW drawing based on certain criteria from DCL menu
-Deletes old drawing
-*THEN, if drawing contain attached IMAGE FILE (.tiff in my case)
-Rename image file and repath image file based on the new file name
I have gotten it to do all of this, except I can not figure out how to change the "reference name" of the attached image file (.tiff)
Is this read-only data? I can manualy change it under xref manager, so there should be a way to do it via code...
The closest I have gotten:
;;after renaming and repath image file...
(SETQ NAME2 (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4))) (setq item (vlax-ename->vla-object (entlast)));convert to vl object (setq check (vlax-property-available-p item "Name" T));check if the entity can be updated ;if it can (if check ;change value to match (vlax-put-property item 'Name NAME2))
'Name seems to be valid w/ xref'd blocks but not xref'd/attached image files..
ok, i have a jpeg i want to email. i click on attach and the drop down comes up, i navigate to the image i want and highlight. at this point--always in the past up until last week--a thumbnail of the image shows up in the column to the right of the name of the image, so i can make sure i'm sending the right image. suddenly, i'm no longer seeing the image to the right. (see attached).
I have a few users which are all experiencing the same issue. They didn't seem to have this issue until upgrading from CS5 to CS6.
Basically AI stops responding (usually permanantly hangs and requires restarting app) for at least 30 seconds when trying to copy an image from AI into PS. The method they're using is to directly select the image from AI and then simply paste directly into PS (I know there are other methods of doing this but this is apparently the way they have always done it).
Their machines are very well spec'd OS - Win7 64-bit RAM - 8 to 32GB! CPU - i7 INTEL GPU - Standard (but compatible) and has latest drivers but disabled by PS as i suspect it's not quite grunty enough? Win7 has been fully updated as well as all Adobe products / Drivers etc...
I have tweaked both AI & PS (including the File Handling & Clipboard setting which enables AICB) for better performance. I think I have basically tried everything and confused as this wasn't a problem when they were using CS5?
how to scan an image directly into Elements 12 (for Mac). Just "upgraded" from 6 and can find no answers other than to go to Apple menu, scan in with Preview or Image Capture, save to desktop, then retrieve with Elements.
I need the attached image edited so the people in the photo appear shirtless. The people in the photo needs to have an athletic build and a non-hairy body. I'm new to PhotoShop.
I saved an image attached to an email in jpg with 4000 x 2664 pixels to the organizer. Even though I designated jpg format, it was saved in png and was downsized to 150 x 100 pixels. How do I save the attachment in jpg format and not be downsized?
Can the pictures file name be printed directly on to each image so that a preview book could be printed by Blurb with each photograph numbered.I can do this in slideshow but when I export the files for printing the numbers are gone.Several of my friend in the profession would also like the ability to apply the file names in this way.
I am trying to increase the memory limit to my raster options and it wont let me change the size. I have plenty of available memory(mb) to use, but after i restart civil 3d and go back to the same options menu, its back to what it was..
Is it possible to read raw image data into Gimp? By raw, I mean image data without a header or compression, i.e., RGB, 16-bit unsigned, or 32-bit floating point grayscale, etc.
I see "Raw image data" under "Open > Select File Type", but grayscale isn't listed. Is the only option? Are there any add-ons for grayscale?
My corel x4 was coryupt and I had to install my older Corel 12.
Options on this corel are different. So in Corel 12, how do i change the settings so that when I double click on an image, it will open it in Corel photo for editing?
I would like to somehow save the depth reading (in mm or inches) at each pixel of the image through a camera viewport. Currently, I'm using this script to save each reading in inches to a text file but it is really slow. I've learnt that OpenEXR can save a single floating-point channel image. Are there a faster way that I can save all the readings (in mm or inches) to .exr file or other format that support 32 bits single channel? If not, is it possible to scale the output (grayscale) floating point reading in exr to mm. (are they linear?) given that I set the minimum/maximum zdepth range.
script:
startFrame = 0 endFrame = 50 for frameNum = startFrame to endFrame do ( sliderTime = (int(frameNum)) fname = ("H:HAND_DATAdepthh" + (int(framenum) as string) + ".txt") myfile = createfile (fname) rbm = render outputsize: channels:#(#zDepth) vfbff for y=0 to 239 do (
I am using corel x3 a long time but never, never had this kind of problem. When i work in corel enviorenment after i have finished my work i go to save my work. But then is the problem It Saves the file with Large Memory on it. let's say if the file normally would be 200 K, now it saves with 3 MB. And if i import some other files in my work then the saved file will be even bigger. If i Delete the files that were imported The Saved File will be Again the same SIZE ! Even if a take one part of the file, let's say if i import only one small text and put it in another file and save it like that, the saved file will be 2 MB. I had a lots of problems, i had saved files on this way with 23-24 MB and when i open them it takes like forever. When you look that file in corel it has nohing in it, absolutely nothing that should be 24 MB. But all of my important work is in that files how to make all things back to normal again,
I do have problem with my newly installed CorelDraw X5. Before X5 we used Corel 12 in our company.
I have project file (150 MB) with lots of text, bitmaps, vectors - about 100 pages. File opens but I can't save it. I always get OUT OF MEMORY error. I even tried to divide this file into 2 smaller parts but still doesn't work.
What I noticed - Corel X5 after clean start (without opened project) takes about 80MB of RAM in task manager. When I open project usage changes from 80MB to 1,2GB. While saving it takes 1,6GB of RAM and it crashes.
To compare - Corel 12 and after opening same project file Corel 12 takes much less of memory - about 770MB and it works without problem.
I cannot print anything from Photoshop CS5. I always get the message: Could not print “image name” because there is not enough memory (RAM).I'm using Mac OS 10.6.8, with 8 GB RAM. I have tried setting memory usage to 100% of RAM (7379 MB for me). The "Ideal Range" is 4058-5313 MB. I cannot print anything, not even a 20 kB file because I always get that error message.
(I don't have a problem printing from any other programs, like Gimp, but I want to print from Photoshop because of they way it allows you to adjust what part of the image you print when you are cropping the image during printing.)
When I use the image processor in PSCS4 to process a large number of raw files using ACR 5.1 (Nikon D3 NEFs), I consistently receive an error message after about 10-11 files have been processed that the instruction at 0x696336ab tried to read memory at 0x6C (or thereabouts) and the memory could not be read. I am saving as JPEGs with the color space set to sRGB.
I de-installed and reinstalled PSCS4, but the error persists. The image processor worked fine with PSCS3. A workaround that solves the problem is to process the files as a batch using a simple action to accomplish the task.
I am running Windows XP Pro Service Pack 3 with a dual Xeon processor and 2G of error correcting memory.
I love tethered Shooting but as default (at least for Nikon) Lightroom does only save the file on the computer, not on the memory card.
Now I want to have a backup of the image file on the memory card additionally to downloading it. The tethering software digiCamControl can do this with my camera, so it is technically possible.
So how can I achieve this using Lightroom tethering?
I've found is copy the image, then go to Ps to new (the image size will be updated), then paste your image there by dragging and dropping with shift (places the image evenly in the window). But surely there must be an easier way to do this.
I'm running Map 2014 SP1 on my machine and the rest of the users in our organization are running Map 2013.
If I save a drawing back to a dwg 2010 version all is fine, but if I save the same drawing to a dwg 2013 version other users are not able to activate and query from it, even though they are otherwise still able to open and work with the drawing.
I have some building department forms in pdf format that I have inserted into paperspace in a layout. They appear fine in layout view and in print preview.
But when I print the layout to pdf, the attached pdfs all print faded. The pdf (as an underlay) is set to fade = 0, contrast = 100. No transparency setting I can find. The layer transparency is 0 and the plot style is at 100% screening.
If I set the layout to *NOT* print transparencies, then the pdfs print dark as they should. But I sometimes use transparency for shading or poche, and would like to be able to use that and also have an inserted pdf print properly.
Is there a way to set pdf underlays to print at full density? I seem to remember finding a global setting for this once, but can't find it now.